Cleanup loco.exe file (#6)

Amend loco.exe to reduce the size by removing all unnecessary data from it.
This is a squashed merge from the following 3 commits:

* Remove SecuROM section headers and zero the sections' contents
  ec5c8c4713 

The .lbceac and .bxfkm sections in the retail CD version of Loco.exe
exclusively contain code and data (respectively) for the SecuROM copy
protection scheme, used by Locomotion.

This EXE has already had the SecuROM copy protection mechanisms
circumvented, so these sections of the file are completely superfluous.

But beyond that, these sections contain components of the SecuROM copy
protection system that can only reasonably be described as malware (e.g.
covertly installed kernel drivers that interfere with CDROM access). As
such, it's probably for the best that we remove this garbage.

The section header information was changed, and the section contents
were zeroed; but all other sections have been left completely unmoved
and untouched, so that previously determined offsets will remain valid.

Additional minor modification: remove a few extra strings inserted into
the EXE file by the no-CD patch.

* Remove .idata and move .rsrc forward: size reduced to < 1.2 MiB
  dc774bd5c3

All traces of SecuROM are now completely gone, and the chasm of zeros
where its sections used to live has been removed. The vestigial .idata
section was removed, as it wasn't actually being used; and the .rsrc
section was moved from its former location at RA 2F2000 / VA F10000 to
its new location at RA 125000 / VA D43000.

The PE header data directory offsets were updated; the offsets in the
import table for openloco.dll were adjusted; the offsets in the resource
table were adjusted; and the jump at the beginning of WinMain to the
StartOpenLoco import was adjusted.

This has been verified and tested, and appears to work entirely
correctly.

* Invent new .idata section for the page containing the import directory
  68b488833b

This change simply shortens .rsrc by one page and then adds a
one-page-sized section called .idata in its place, so that there's no
longer import stuff in .rsrc, where it doesn't really belong.

Characteristics on .rsrc were modified so it's no longer writable;
writability was maintained for .rdata and .idata, as they both contain
import data.
This commit is contained in:
Justin Gottula 2018-01-21 05:18:43 -08:00 committed by Ted John
parent ab5c283ec3
commit 625337bb69
1 changed files with 0 additions and 0 deletions

BIN
loco.exe

Binary file not shown.