Hi, I am learning ASM x86 and got this code for an example. I would like if someone could convert it from ASM to C or C++. Also explain what each line does.
I am new here and I know the basics of ASM. I am now trying to learn how to translate ASM code to C or a higher language.
Here's the code:
UnknownFunction:
MOV EDI,EDI
PUSH EBP
MOV EBP,ESP
MOV EAX,DWORD PTR SS:[EBP+8]
XOR EDX,EDX
LEA ECX,DWORD PTR DS:[EAX+4]
MOV DWORD PTR DS:[EAX],EDX
MOV DWORD PTR DS:[ECX+4],ECX
MOV DWORD PTR DS:[ECX],ECX
MOV DWORD PTR DS:[EAX+C],ECX
MOV ECX,DWORD PTR SS:[EBP+C]
MOV DWORD PTR DS:[EAX+18],ECX
MOV ECX,DWORD PTR SS:[EBP+10]
MOV DWORD PTR DS:[EAX+1C],ECX
MOV ECX,DWORD PTR SS:[EBP+14]
MOV DWORD PTR DS:[EAX+20],ECX
MOV ECX,DWORD PTR SS:[EBP+18]
MOV DWORD PTR DS:[EAX+14],EDX
MOV DWORD PTR DS:[EAX+10],EDX
MOV DWORD PTR DS:[EAX+24],ECX
POP EBP
RETN 14
All I know is that it's pushing stuff off and on a stack. It has pointers and uses exclusive or conditional statement.
I am guessing that RETN 14 is the same as returning 0 in C or C++.
This whole thing is a function.