Reverse Engineering Assembly to C

-6

Excuse the basic question here - trying to get to grips with assembly for the for the first time as part of college. Have been trying to understand the below - can somebody please explain what each line is doing here?

If you could provide an example of a C function that would result in the same machine code that would be even better.

0x00000000 <bar+0>:     push   %ebp

0x00000001 <bar+1>:     mov    %esp,%ebp 

0x00000003 <bar+3>:     mov    0xc(%ebp),%eax

0x00000006 <bar+6>:     mov    0x10(%ebp),%edx

0x00000009 <bar+9>:     add    0x8(%ebp),%edx

0x0000000c <bar+12>:    mov    %edx,(%eax)

0x0000000e <bar+14>:    leave




0x0000000f <bar+15>:    ret

Thanks!

c
assembly
x86
asked on Stack Overflow Dec 2, 2018 by Cian O'Shea • edited Dec 2, 2018 by melpomene

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0