News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Golden Oldie.

Started by hutch--, October 19, 2005, 05:15:08 AM

Previous topic - Next topic

hutch--

I have just ported an old TASM program to MASM so it can be built with current software. It was written by an old friend of mine in TASM back when I used to support MASM32 on IRC. His last known nick was "Goofium" which was to avoid a female associate who used to stalk him on IRC.

The tool realigns 32 bit PE files and it was useful with TASM that has a pile of dead padding in it but it can be useful at time to prtially fix up PE files that have some errors in them. It is supposed to properly calculate the checksum for the file and it removes a reasonable amount of dead space in a PE file. It is not much use for MASM produced EXE files as they already have a 512 byte alignment if built with the correct linker.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Vortex

Hi Hutch,

Thanks for this tool but I think I found a bug :
──────────────────────────────────────────────────
Goofium's PE Realigner v0.5, (c)1998-2005 Goofium
──────────────────────────────────────────────────

Realigned file:  hello.exe
Original File Alignment: 200h New File Alignment: 200h
Original Size: 29212 New Size: 29724 Difference: 4294966784

GAlign complete The 1 files decreased a total of 4294966784 bytes.


The size of the processed exe is increased by 512 bytes.

The original test file is compiled with Digital Mars tools, here is the exe

[attachment deleted by admin]

hutch--

Vortex,

Thanks. I know it is not much use on exe files that are already aligned to 512 bytes and the section larger is possible. The other result shows it is outputting the result as unsigned rather than a signed value so I will look it up later and change the conversion.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

diablo2oo2

why dont you use existing structures like IMAGE_NT_HEADERS. i think its less coding work then and maybe easier to read for other people.

hutch--

diablo2oo2,

I did not write it and it was written long enough ago that the correct structures were not yet available. I have done the minimum to port it to MASM where a complete rewrite would be a lot more work.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php