Sorry for the noob questions.
So I'm given this code. From my understanding it adds two values, however I'm a thrown off the mov [ebp-1], al
instruction. What is currently at that address on the stack is the previous value of ecx which is unknown, so does this instruction change the lower byte of the previous value of ecx?
push 0ffffff80h
push 0ffffffffh
call Secretfunc
add esp, 8
mov [ebp - 1], al
nop
Secretfunc
push ebp
mov ebp, esp
movsx eax, [ebp+8]
movsx ecx, [ebp+12]
add eax, ecx
mov [ebp-1], al
mov al, [ebp-1] ; declare a char in c for this
mov esp, ebp
pop ebp
retn
I was also wondering if anyone knew of a good tutorial/manual for inline assembly on visual studio? Most I found were on gcc and not VS, and the Microsoft manual wasn't very helpful.
My professor wants me to turn this code into an inline assembly code on VS. Are there any basic rules that differentiate inline assembly from the code I am given above?
I tried turning secretfunc into a C function with -1, and -128 as its parameters I put all the code below Secretfunc
into __asm{...}
inside the Secretfunc function I made in C, but that left me not knowing what to do with the code after we return from call Secretfunc
Any information is appreciated.
Thank you