flat assembler
Message board for the users of flat assembler.

Index > Windows > Last PE Section Padding

Author
Thread Post new topic Reply to topic
comrade



Joined: 16 Jun 2003
Posts: 1140
Location: Russian Federation
comrade 23 Mar 2004, 00:55
Last PE section does not have to be padded up to IMAGE_NT_HEADERS.FileHeader.FileAlignment. Would FASM rather be able to do this size optimization and not pad up last section (and of course adjust IMAGE_SECTION_HEADER.SizeOfRawData to reflect the change as well)?

Personally (in general), I think somehow such kind of options should be controllable via options, including the new test instruction optimization.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 23 Mar 2004, 00:55
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Mar 2004, 19:51
privalov still refuses to allow command line options.

Why? They could be optional, so no backward compatibility breaks, and newbies still could use "fasm <source> <destination>".
Post 23 Mar 2004, 19:51
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8263
Location: Kraków, Poland
Tomasz Grysztar 23 Mar 2004, 20:01
When did I say that I refuse? I plan to implement some switches than don't affect the output code, like the switch for setting the upper limit for memory usage. But all setting that affect the output are in fasm done using the directives in the source.

But you are not right about the section alignment, this is what PE/COFF docs from MS say about the SizeOfRawData field:
Quote:
Size of the section (object file) or size of the initialized data on disk (image files). For executable image, this must be a multiple of FileAlignment from the optional header.


Last edited by Tomasz Grysztar on 23 Mar 2004, 20:10; edited 1 time in total
Post 23 Mar 2004, 20:01
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1140
Location: Russian Federation
comrade 23 Mar 2004, 20:43
Try it out

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 23 Mar 2004, 20:43
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1140
Location: Russian Federation
comrade 23 Mar 2004, 21:41
Here is program from FASM\EXAMPLES\HELLO


Description:
Download
Filename: hello.zip
Filesize: 1.09 KB
Downloaded: 298 Time(s)


_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 23 Mar 2004, 21:41
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1140
Location: Russian Federation
comrade 23 Mar 2004, 21:42
This technique can be achieved using PE realigner program, so not really necessary for FASM to have it. Just bringing to your attention that it is indeed true. Very minor.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 23 Mar 2004, 21:42
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8263
Location: Kraków, Poland
Tomasz Grysztar 23 Mar 2004, 21:43
We cannot ignore the official specification just because it works.
Post 23 Mar 2004, 21:43
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Mar 2004, 21:47
I'm with privalov. Things have worked that broke on later windows versions (certain PE aspects, no-import PE's, port I/O, ring0/admin hacks, ...)
Post 23 Mar 2004, 21:47
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 29 Jul 2004, 18:21
privalov: so where is option to generate only result of preprocessing? It would be very useful and as I know, it is very easy to do (just save some buffer to file and exit)
Post 29 Jul 2004, 18:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8263
Location: Kraków, Poland
Tomasz Grysztar 29 Jul 2004, 18:35
Why are you asking about it in this thread?
Post 29 Jul 2004, 18:35
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.