Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception - Index was out of range #113

Open
pkt01 opened this issue Apr 20, 2024 · 4 comments
Open

Unhandled exception - Index was out of range #113

pkt01 opened this issue Apr 20, 2024 · 4 comments
Assignees
Labels
c: plugin Category: Plugin p: medium Priority: Medium t: bug Type: Bug

Comments

@pkt01
Copy link

pkt01 commented Apr 20, 2024

Hello atom0s,

When I try to unpack MassEffect.exe, Steamless correctly identifies the SteamStub variant, yet throws the following error:

[...]
[Steamless.Unpacker.Variant21.x86] Step 5 - Read, decrypt and process the main code section.
[Steamless.Unpacker.Variant21.x86] --> .bind section was removed from the file.
[Steamless.Unpacker.Variant21.x86] --> linked as main code section.
[Steamless.Unpacker.Variant21.x86] --> section is not encrypted.
[Steamless] Caught unhandled exception while trying to unpack file.
[Steamless] Exception:
[Steamless] Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Game in case is the original Mass Effect (2007). I can provide the executable if needed.

Steamless version: 3.1.0.5, default options selected
System: Windows 10 22H2, x64

@atom0s
Copy link
Owner

atom0s commented Apr 20, 2024

Hello, if you can provide the exe that would help.

@atom0s atom0s self-assigned this Apr 20, 2024
@atom0s atom0s added c: plugin Category: Plugin p: medium Priority: Medium t: bug Type: Bug labels Apr 20, 2024
@pkt01
Copy link
Author

pkt01 commented Apr 20, 2024

Thank you for your reply, here it is: ExeSample.zip

I tested Mass Effect 2 (2010) and that one unpacked correctly despite also being a Variant.21x86.

@atom0s
Copy link
Owner

atom0s commented Apr 23, 2024

Thank you for the file sample. The issue this file has is with Steamless, more specifically the manner in how the v2.x unpacker(s) work.

When this version is being unpacked, the embedded SteamDMRP.dll file is needed to pull out important offsets from the file. The manner in which Steamless handles this currently is prone to breaking and not working for all files, which this game would be one of them. The offsets being dumped from the dll file are wrong, so the information Steamless tries to use to decrypt the .text section is wrong causing it to fail.

If I get the free time to focus on it eventually, I want to fully rewrite the unpacker for this variant to make it function better for more (if not all) files.

@pkt01
Copy link
Author

pkt01 commented Apr 25, 2024

No worries, and thanks for the explanation.

If it's of any help, I tested Steamless versions 3.1.0.0 up to 3.1.0.3 and the exe was successfully unpacked in all of them. I'm unable to tell if the inwards are 100% correct but the game launched without Steam being opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: plugin Category: Plugin p: medium Priority: Medium t: bug Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants