I have a function with a signature:
extern "C" int foo(int a, int b, int c, int d, int e);
which is actually recorded in the assembly.
With ml (32 bits), using the standard calling convention, you can pretty much write
.code foo PROC a: DWORD, b: DWORD ,c: DWORD, d: DWORD, e: DWORD mov eax, d mov ebx, e
and start using these tags to access your arguments
With ml64 (64 bits) fastcall is the only convention available. I have no problem accessing the first arguments stored in registers, but to access them on the stack ( e in this example): I tried
.code foo PROC a: DWORD, b: DWORD ,c: DWORD, d: DWORD, e: DWORD
and
.code foo PROC e: DWORD
but the value in e is garbage.
I found that if I use the stack address directly, I find its value.
.code foo PROC e: DWORD mov eax, r9 ; d mov ebx, DWORD PTR[rbp + 48] ; e
Is there another way?