flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > inline proc macro

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1855
Roman 14 Jul 2020, 08:47
I do
Code:
 macro inline chP {
       ;call chP
       repeat chP#_gE-chP#_gB
         load ttt byte from chP+%-1
         db ttt
   end repeat
       }

proc Pproc1 pu:dword
     rR1 EQU edx
     mov eax,[pu]
Pproc1_gB:   mov rR1,12
            imul rR1,2
Pproc1_gE:
     ret
endp 

In code:

mov eax,Pproc1
inline Pproc1

    


IDA pro get me this code. But why ?!
Code:
push    ebp
mov     ebp, esp
mov     eax, [ebp+8]
mov     edx, 0E42EE80Ch
    

I expected this:
Code:
            mov edx,12
            imul edx,2
    


If i write:
Code:
proc Pproc1 
     rR1 EQU edx     
Pproc1_gB:   mov rR1,12
            imul rR1,2
Pproc1_gE:
     ret
endp 
    


i get this:
mov edx,12
imul edx,2
Post 14 Jul 2020, 08:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20468
Location: In your JS exploiting you and your system
revolution 14 Jul 2020, 08:56
I presume you want to load some code and make a duplicate?

If so then probably your load is not correct. Maybe try::
Code:
load ttt byte from chP#_gB+%-1    
Post 14 Jul 2020, 08:56
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1855
Roman 14 Jul 2020, 09:02
Oh ! This is my mistake.
Thanks.
Post 14 Jul 2020, 09:02
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.