So i have been playing around with some abnormal optimization and was wondering if anyone knew why masm adds 4 bytes to the end of the import section even if its merged with the .text section ?
Posted on 2007-03-29 05:45:12 by paradox

So i have been playing around with some abnormal optimization and was wondering if anyone knew why masm adds 4 bytes to the end of the import section even if its merged with the .text section ?


Two guesses, either some form of alignment or your traditional null-termination sequence.

Anyone else have an idea???
Posted on 2007-03-29 06:43:40 by SpooK
in my opinion, if you care about every byte of executable that much, you shouldn't use MASM
Posted on 2007-03-29 06:53:42 by vid
There's som 0-termination required for the various structures for the import data, and on top of that, iirc link always does 4-byte align.

I agree with vid - if you really want to play with this kind of sillyness :), grab fasm (or nasm/yasm, but then there's a lot of tedious hand-filling to be done). With masm/link combination, you have very little control of specials like import/export data.
Posted on 2007-03-29 09:48:10 by f0dder
thanks for all the replies everyone.

and f0dder, i do enjoy this type of sillyness, so i have decided to go with nasm and write my own MZ/PE headers based on the Tiny PE example (132 bytes with an IAT )


edit:

i was just looking at the heap, and found a post by f0dder which was exactly what i wanted :P

Crinkler ;)
Posted on 2007-03-30 05:57:59 by paradox