flat assembler
Message board for the users of flat assembler.
Index
> Main > Equating a data entry to an import macro entry |
Author |
|
Tomasz Grysztar 15 May 2019, 21:47
CS_Print is not an address of imported function, it is an address of a 32-bit data field that contains an address of a function once the imports have been resolved. You call the function indirectly through this variable:
Code: call [CS_Print] Therefore if you need [_b] to have the address of imported function, you have to copy the value like: Code: mov eax,[CS_Print] mov [_b],eax |
|||
15 May 2019, 21:47 |
|
ssjcoder 15 May 2019, 21:59
thank you for your answer it's much appreciated.
It turns out _b stored the address of CS_Print rather than matching it (obviously) So I needed to alter my code to this: Code: mov eax, dword [_b] call dword [eax] In order to actually call the correct address, and as you have mentioned I need to copy it at the start of the program to get the correct value (without needing to go through extra instructions). Thanks |
|||
15 May 2019, 21:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.