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.12k stars 195 forks source link

CRC Repairing, DOS Stub Restoration, SizeOfImage Fix #26

Closed OdinVex closed 4 years ago

OdinVex commented 4 years ago

First time performing a Pull Request for any public project. Not sure why the Main.cs changes look so drastic in web diff compared to local diff.

I've come across PE32s protected with SteamDRM that use a per-user unique VLV section that takes the place of the DOS stub. Not only should executables have a proper DOS stub (though mostly irrelevant these days), the data could be used to identify users. Clearing the entire stub and restoring the de facto DOS stub most commonly seen can help protect build leaks.

It is recommended and common that a PE32 have a correct CRC checksum (or if undesired, Zero, for non-critical software). The CRC checksum can also identify per-user unique builds and should either be set Zero for non-critical software or set to the unpacked PE32.

It is required that PE32s have their SizeOfImage set to a multiple of SectionAlignment (rounded upward, zero-filled recommended). I have modified Pe32/64.cs to do just this.

I've added options and the code to address these considerations. I would like them to be considered, perhaps reworked if necessary, but considered at least.

OdinVex commented 4 years ago

Have made another modification that you might find controversial regarding Size Of Image fix. If interested, Compare.