Hello,
I think i don't understand the processing order regarding fasmg.
Using fasmg hll54, this source does not compile for me :
Code: |
include 'format/format.inc'
format PE64 CONSOLE
macro library p&
irp dll, p
dd 0, 0, 0
dd RVA dll#_name, RVA dll#_table
end irp
dd 0, 0, 0, 0, 0
end macro
macro import dll, p& ; import functions
dll#_name db \ ; 'name.dll'
`dll, '.DLL', 0
dll#_table: ; table
irp name, p ; import rvas
if used name
name dq RVA _#name
end if
end irp
dq 0
irp name, p ; import names
if used name
_#name dw 0 ; ordinal=0
db `name, 0 ; 'name'
end if
end irp
end macro
entry start
section '.text' code readable executable
start:
sub rsp, 7*8
mov rcx, 0
call [GetModuleHandleA]
mov rcx, 0
call [ExitProcess]
section '.idata' import data readable writeable
library KERNEL32
include 'kernel.inc'
;import KERNEL32, \
; ExitProcess,\
; GetModuleHandleA
|
|
The error i get is :
Code: |
win64.asm [39]:
call [GetModuleHandleA]
macro call [1] macro parse_jump_operand [11] macro parse_operand [27] macro parse_operand_value [21] macro parse_address [21]:
ns.address = +addr
Processed: @dest.address = +GetModuleHandleA
Error: symbol 'GetModuleHandleA' is undefined or out of scope.
|
|
If i comment the line "'kernel.inc'" and uncomment the import lines, it does compile and produces a valid application.
The kernel.inc contains one long import statement with all the imports for KERNEL32.DLL, nothing more.
So the include statement gets processed later than i expected i guess ?
Thanks in advance.