flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > [DONE] Align import binding addresses in IMPORT??.INC |
Author |
|
LocoDelAssembly 31 Jul 2010, 06:22
http://board.flatassembler.net/topic.php?p=107831#107831
I don't have the tools at hand not a 64-bit setup so, was the bug mentioned there fixed? |
|||
31 Jul 2010, 06:22 |
|
revolution 31 Jul 2010, 06:42
LocoDelAssembly wrote: I don't have the tools at hand not a 64-bit setup so, was the bug mentioned there fixed? |
|||
31 Jul 2010, 06:42 |
|
LocoDelAssembly 31 Jul 2010, 06:55
The PROCs without locals nor params problem which leave RSP unaligned on entry. A quick look to PROC64.INC tells me that "PUSH RBP" is avoided on such situation which could potentially keep RSP MOD 16 = 8, but maybe something else compensates that (but I can't test here).
|
|||
31 Jul 2010, 06:55 |
|
revolution 31 Jul 2010, 08:36
If one is concerned about "polluting" the data area with extraneous nops then we can use this instead:
Code: times (-rva $) and 3 db 0 ;<<<----- use '3' for 32-bit and '7' for 64-bit |
|||
31 Jul 2010, 08:36 |
|
revolution 12 Sep 2010, 09:49
BUMP
|
|||
12 Sep 2010, 09:49 |
|
Tomasz Grysztar 12 Sep 2010, 12:49
There is this wider problem with import macros - they are left almost unchanged since the very early fasm versions for Win32. Well, that may also speak in their favor, as they had to be not so bad at all if they managed to be useful through all this time - however initially I thought that some better variants would appear when some knowledgeable user realizes he needs more that this simplest solution. For instance, one could put the import addresses table into some other section (marking the table with "data 12") and mark the import section as "discardable" then. Also, in another variant, one might create "jump gates" for imported functions to make the call instructions shorter (but then you'd have to use "stdcall" instead of "invoke" to call them). And with the new abilities of fasm's preprocessor this certainly could be done at a small cost.
On the other hand, I'm afraid that even the new project of Windows headers maintained by community would be reluctant to change the usage of import macros, as they became de facto standard for fasm during all those years... |
|||
12 Sep 2010, 12:49 |
|
revolution 12 Sep 2010, 12:56
Does your response above mean that you are not keen to change them? My suggestion won't break any existing code.
I found in the past that messing with import tables and moving them around among sections has a tendency to trigger the paranoid AVs. In general. the tiny gain one might get with using various data sections is more than offset by the loss of triggering AVs and panicking users. [edit] BTW: There have been a number of import macro suggestions placed in this board. They never catch on though because whenever someone posts code here they have to use the "official" macros else no one else can assemble the code. |
|||
12 Sep 2010, 12:56 |
|
Tomasz Grysztar 12 Sep 2010, 13:01
revolution wrote: Does your response above mean that you are not keen to change them? My suggestion won't break any existing code. No, it is not about that. I just hoped to trigger some discussion about those macros and possible improvements. As for alignment, I can of course do it without breaking anything, but this does not solve the wider problems the import macros have, in my opinion. revolution wrote: I found in the past that messing with import tables and moving them around among sections has a tendency to trigger the paranoid AVs. In general. the tiny gain one might get with using various data sections is more than offset by the loss of triggering AVs and panicking users. Last edited by Tomasz Grysztar on 12 Sep 2010, 13:13; edited 1 time in total |
|||
12 Sep 2010, 13:01 |
|
Tomasz Grysztar 12 Sep 2010, 13:05
revolution wrote: [edit] BTW: There have been a number of import macro suggestions placed in this board. They never catch on though because whenever someone posts code here they have to use the "official" macros else no one else can assemble the code. On the other hand, I've seen sometimes programs distributed with a set of includes full of someone's own macro inventions for even the basic things - so that sometimes still happens. |
|||
12 Sep 2010, 13:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.