atom0s / Steamless

Steamless is a DRM remover of the SteamStub variants. The goal of Steamless is to make a single solution for unpacking all Steam DRM-packed files. Steamless aims to support as many games as possible.
Other
3.08k stars 195 forks source link

Unhandled exception - Index was out of range #113

Open pkt01 opened 4 months ago

pkt01 commented 4 months ago

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 commented 4 months ago

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

pkt01 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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.