flat assembler
Message board for the users of flat assembler.
Index
> Windows > Unrolling FASM code |
Author |
|
comrade 25 Sep 2005, 02:47
GetModuleHandle is an OFFSET to a variable containing the address to GetModuleHandle
you should enclose it in square brackets: Code: push 0 call [GetModuleHandle] |
|||
25 Sep 2005, 02:47 |
|
casey 25 Sep 2005, 04:29
Of course that works.
Thank you comrade. It is unclear why the import is needed when it doesn't seem to be needed in RosAsm source or MASM source. I know it has something to do with the PE part from the FASM manual. section '.idata' import data readable writeable ... import KERNEL32, \ GetModuleHandle, \ 'GetModuleHandleA', \ The TD source code from RosAsm that I actually used to unroll the invoke statement, uses GetModuleHandleA. The 'A' I understand to mean plain asc rather than unicode (GetModuleHandleW). Why doesn't call [GetModuleHandleA] work? Undefined symbol error. Do I lack an include and/or import directive for the file with the required definition? I notice that Java, which I am also learning, uses the import directive. - John Casey |
|||
25 Sep 2005, 04:29 |
|
denial 25 Sep 2005, 07:04
Because you defined GetModuleHandle as symbol name, not GetModuleHandleA. Thats why the second one is an undefined symbol
If you include win32ax.inc, you can make life easier as all important WinAPI functions get imported automaticaly. |
|||
25 Sep 2005, 07:04 |
|
casey 25 Sep 2005, 08:52
I included win32ax.inc and it still declares GetModuleHandleA
as an undefined symbol. How do I define it? All I can find in the KERNEL32.inc is the same thing written in the section '.idata' |
|||
25 Sep 2005, 08:52 |
|
Reverend 25 Sep 2005, 10:00
Write:
Code: label GetModuleHandleA at GetModuleHandle |
|||
25 Sep 2005, 10:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.