flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Passing EQUs to macros - Compile Error

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 28 May 2016, 08:07
Code:
format PE GUI 4.0 DLL
entry DllEntryPoint
include 'win32a.inc'
section '.text' code readable executable
export_cmd equ 'ERRORMSG.DLL'
macro prec [arg] {
  common
  match a b, arg \{
    export_cmd equ export_cmd,a,\`a
    proc a b
  \}
}
proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
        mov     eax,TRUE
        ret
endp
prec ShiftRight value, bits
        mov eax, [value]
        mov ecx, [bits]
        shr eax, cl
        ret
endp
prec ShiftLeft value, bits
        mov eax, [value]
        mov ecx, [bits]
        shl eax, cl
        ret
endp
invoke  MessageBox
section '.idata' import data readable writeable
  library user,'USER32.DLL'
  import user,MessageBox,'MessageBoxA'
section '.edata' export data readable
  export export_cmd
  ;export 'ERRORMSG.DLL',ShiftRight,'ShiftRight',ShiftLeft,'ShiftLeft'
section '.reloc' fixups data readable discardable
    
Post 28 May 2016, 08:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 28 May 2016, 08:43
You'll need to "match" the export_cmd if you expect that to work.
Code:
match x,export_cmd {export x}    
fasm is weird about how it decides to translate EQUs IMO.
Post 28 May 2016, 08:43
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 28 May 2016, 08:45
revolution wrote:
You'll need to "match" the export_cmd if you expect that to work.
Code:
match x,export_cmd {export x}    
fasm is weird about how it decides to translate EQUs IMO.
Thanks
Post 28 May 2016, 08:45
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.