4 ms·
As every section needs to be aligned to the smallest possible section alignment of 0x200 bytes (1KB), we inflate our file by at least that amount of bytes just
by userbinator 3y ago
As every section needs to be aligned to the smallest possible section alignment of 0x200 bytes (1KB), we inflate our file by at least that amount of bytes just because of that.
0x200 is 512, or 0.5K. It's been a long time since I've done PE size optimisation at this level but I remember 512 was the minimum accepted by Windows 9x but NT could accept alignments as small as 1.
Also, I didn't see any mention of the old trick of overlapping the DOS MZ and PE headers, which was state-of-the-art when I was still doing this stuff: http://www.phreedom.org/research/tinype/ http://www.phreedom.org/research/tinype/
...and then you realise that the demoscene has managed to do this in a 1k binary:
https://www.pouet.net/prodlist.php?type%5B%5D=1k&platform%5B%5D=Windows&page=1 https://www.pouet.net/prodlist.php?type%5B%5D=1k&platform%5B...