Hi guys,

supposing I have the c++ line

void callback(int 1, int 2, int 3)
{
do something with ints;
}

Where the ints have been populated in other areas of the program. How would this translate in asm? I have written a quick one using c and debugged with ollydbg, but lost myself. :/

Cheers in advance
Posted on 2008-12-11 06:06:25 by sidey1234
Masm Code:


invoke callback, int1, int2, int 3

callback proc int1:DWORD, int2:DWORD, int3:DWORD
mov eax, int1
mov edx, int2
ret
endp


Juts like in C++ the int value is passed. for the address of the int you would invoke the like saying something like


invoke callback, addr int1, addr int 2, addr int3

callback proc int1addr:DWORD, int2addr:DWORD, int3addr:DWORD
mov eax, int1addr
mov , 17h
endp
Posted on 2008-12-11 06:17:50 by JimmyClif
Nice simple and to the point, cheers
Posted on 2008-12-11 06:34:26 by sidey1234