flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [bug] Using win32axp.inc breaks computed calls

Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
Code:
include 'win32axp.inc'

call_table:
        dd      function1
        dd      function2
        ;...

begin:
        ;...
        stdcall [ebx*4+call_table],eax,edx,ecx  ;<--- error: invalid expression.

function1:
function2:

.end begin    
Code:
        stdcall [ebx*4+call_table],eax,edx,ecx      ;<--- error: invalid expression.
C:\<path>\fasm\include/win32axp.inc [58] stdcall [5]:
             if defined proc \# % & count@stdcall <> proc \# %
error: invalid expression.    
The expression evaluates to:
Code:
if defined [ebx*4+call_table]% & count@stdcall <> [ebx*4+call_table]%    
And the workaround of loading the address first into a register is not possible when there are no spare registers:
Code:
        mov     reg,[ebx*4+call_table]
        stdcall reg,eax,edx,ecx ;<--- Okay only if we have a spare register    
Post 20 Sep 2014, 01:07
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-2020, Tomasz Grysztar.

Powered by rwasa.