Hello. Im just wondering, theres a way to let FASM take the section specific code on all the source code, and put it togheter in the same section?
For exmaple, if i do this:
format PE GUI 4.0
entry MAIN
include "%fasminc%\win32a.inc"
section '.idata' import data readable
library kernel,'KERNEL32.DLL'
import kernel,\
ExitProcess,'ExitProcess'
section '.data' data readable writable
varStrBuffer rb 65535
section '.code' code readable executable
proc MAIN
invoke ExitProcess,0
return
endp
i obtain an executable size of 1536
but, if i just add an extra var in other part of the code, but still a data section....
format PE GUI 4.0
entry MAIN
include "%fasminc%\win32a.inc"
section '.idata' import data readable
library kernel,'KERNEL32.DLL'
import kernel,\
ExitProcess,'ExitProcess'
section '.data' data readable writable
varStrBuffer rb 65535
section '.code' code readable executable
proc MAIN
invoke ExitProcess,0
return
endp
section '.data' data readable writable
varStr db "hello",0
Is supposed taking the result before, this for logic, this can bump i think, 7 bytes right?
Well, with this lite modification, im obtaining an executable of 2550 bytes, more than 1000 bytes.
I think is ussefull if we can use for example, the section definitions in macros for example, and when fasm clean the code, these code that are declared in section are ordered in the correspondent section... in this case, if fasm take the first variable defined, and memorize, and after the last section take the other variable, and memorize them, and at last, after end of the code, declares a section in the exe with all the data...
hehe, maybe im crazy.. but can be good if theres a way to do that
Thanks!