Steamless icon indicating copy to clipboard operation
Steamless copied to clipboard

Unhandled exception - Index was out of range

Open pkt01 opened this issue 1 year ago • 8 comments

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

pkt01 avatar Apr 20 '24 12:04 pkt01

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

atom0s avatar Apr 20 '24 21:04 atom0s

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.

pkt01 avatar Apr 20 '24 22:04 pkt01

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.

atom0s avatar Apr 23 '24 07:04 atom0s

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.

pkt01 avatar Apr 25 '24 01:04 pkt01

Here's another example that fails in the same way. As mentioned, it previously worked in v3.1.0.0 - v3.1.0.3 but fails in v3.1.0.5. ExeSample2.zip

BigheadSMZ avatar Nov 14 '24 03:11 BigheadSMZ

Same regression with crysis 2

mirh avatar Apr 13 '25 13:04 mirh