flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid
hmm, "format pe align 32" might be added, but how to distinguish file align and memory align?
|
|||
![]() |
|
shoorick
"pealign" "alignsect(ion)"
|
|||
![]() |
|
vid
ugh... new keywords
![]() or "format PE align 200h, 1000h" :DDD no new keywords |
|||
![]() |
|
GR-K
Anyway PE formatter does not support align directive.
Assembler don't need to distinguish them. Simply, file align means how many nulls will be added to the end of executable ![]() P.S.: I know only two ways to get executable with a file alignment smaller than 200h. 1st, is to write RAW PE, and 2nd is to use "format PE native" directive and then change subsystem manually. |
|||
![]() |
|
revolution
On disk the file will still occupy 4k minimum unless you are storing the file on a floppy. So a file size of 812 bytes is really going to be 4096 bytes anyway.
|
|||
![]() |
|
GR-K
Sure that is. Do you think that it is better to download an 4KB file? As assembler coder I like to write programs as small as possible. Don't you?
It is bad that when I am coding in my favorite assember, I need to cut all this nulls and set 4B alignment up manually. Because of it I am asking Tomasz for adding directive that will change default PE file alignment. |
|||
![]() |
|
chris
Maybe fasm's default value (0x200=512) for a non-native PE image is somehow optimized for disk access, since most disks have sector size of 512 bytes.
|
|||
![]() |
|
GR-K
Disk access? No. Simply, 200h bytes it is minimal aling value for w9x systems. And EXE with smaller alignment will not work on them. It means that your program will incompatible with older OS versions. The reason for adding directive that will change standart alignment value is that most of modern programs written directly for NT/W2K/XP systems and it will help to get smallest executables.
|
|||
![]() |
|
Tomasz Grysztar
It may make sense to allow custom file alignment, though for memory alignment alignments smallers that 4 kilobytes are not a good idea - the system wouldn't be able to apply the page attributes correctly for each section.
The reason why it's not implemented yet is that it would require rewriting some bits of PE formatter and thus it's not really a quick and easy addition. The PE formatter is one of the few parts of fasm that never got completely rewritten and remains really only a bit altered in general design since it's introduction in fasm 1.04 - and the time the PE documentations I had allowed no file alignment smaller than 200h. Later I inclined it a bit to make the "native" be handled differently, but it's still a bit of a special case - at the same time I tried preparing it allow custom alignment, but few details prevented me from finishing. But, since it's actually the first time that this feature is openly requested, I'm motivated to get back to it. |
|||
![]() |
|
vid
tomasz: and what about syntax for it?
|
|||
![]() |
|
Tomasz Grysztar
Your suggestion was good IMO, as I noted it would be only the file alignment to be adjusted.
|
|||
![]() |
|
GR-K
Thanks for reply, and thanks for your work.
It's easy to change align manually (and then cut off all not needed nulls), and everybody (or not?) can change hardcoded values in sources, but it will better to have customizable PE formatter. Tnx again, I'll wait :) |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.