Question: I am working on reverse-engineering and need to write a C translation of the NASM code below and this is what I've got so far

I am working on reverse-engineering and need to write a C translation of the NASM code below

I am working on reverse-engineering and need to write a C translation

and this is what I've got so far but not sure whether correct or not:

int a = 3;

int b = 4;

int main() {

f(a, b)

}

int f(int x, int y){

int z;

if(g == 3) {

return

}

}

And the output should be 4 when the code runs.

nclude asm io. inc segment data dd dd segment bss resd 1 segment text global asm main asm main enter 0,0 pusha push dword [b] push dword [a] call add esp, 8 add eax, [b] call print int call print nu popa eax, 0 mOV Leave ret push ebp ebp, esp lmov sub esp 4 mov dword [ebp-4], 1 cmp dword [ebp-121, 3 jz endf mov ebx, Cebp+81 dec ebx push ebx push dword [ebp-12] call f add esp, 8 mov ebx, [ebp+8] sub ebx, eax mov [ebp-41, ebx endf mov eax, [ebp-4] mov esp, ebp pop ebp ret

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!