23.03.2013 Views

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

add esp, 1Ch<br />

xor eax, eax ; return 0<br />

pop ebx<br />

mov esp, ebp<br />

pop ebp<br />

retn<br />

main endp<br />

It’s quite similar <strong>to</strong> what MSVC 2010 with optimization (/Ox) produce. With the exception that EBX<br />

register will be fixed <strong>to</strong> i variable. GCC is sure this register will not be modified inside of f() function, and<br />

if it will, it will be saved at the function prologue and res<strong>to</strong>red at epilogue, just like here in main().<br />

30

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!