5 ms·
You just need to add some compiler options; /MD should get the size down quite a bit already, then decrease the file alignment and merge sections together:
by userbinator 6y ago
You just need to add some compiler options; /MD should get the size down quite a bit already, then decrease the file alignment and merge sections together:
/MD /link /align:4096 /filealign:512 /merge:.rdata=.text /merge:.data=.text
That produced a 1.5K binary, which with a custom stub should reach 1K.
- simlevesque 6y agoSo the point is moot, you can't have a simple 1k C example.
- mcountryman 6y agoIn order to get that to 1Kb you would probably have to drop the `.idata` section and resolve syscalls from the PEB like I did.
- ChrisSD 6y agoHave you actually tried this? Merging .data into .text doesn't work. The binary doesn't run and there's this link warning: > LINK : warning LNK4254: section '.data' (C0000040) merged into '.text' (60000020) with different attributes
- deleted 6y ago[deleted]