Skip to content

Instantly share code, notes, and snippets.

@rikaardhosein
Created April 24, 2013 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikaardhosein/5451205 to your computer and use it in GitHub Desktop.
Save rikaardhosein/5451205 to your computer and use it in GitHub Desktop.
(gdb) disas main
Dump of assembler code for function main:
0x08048596 <main+0>: push ebp
0x08048597 <main+1>: mov ebp,esp
0x08048599 <main+3>: sub esp,0x18
0x0804859c <main+6>: and esp,0xfffffff0
0x0804859f <main+9>: mov eax,0x0
0x080485a4 <main+14>: sub esp,eax
0x080485a6 <main+16>: cmp DWORD PTR [ebp+0x8],0x2
0x080485aa <main+20>: je 0x80485ca <main+52>
0x080485ac <main+22>: mov eax,DWORD PTR [ebp+0xc]
0x080485af <main+25>: mov eax,DWORD PTR [eax]
0x080485b1 <main+27>: mov DWORD PTR [esp+0x4],eax
0x080485b5 <main+31>: mov DWORD PTR [esp],0x8048760
0x080485bc <main+38>: call 0x80483b8 <printf@plt>
0x080485c1 <main+43>: mov DWORD PTR [ebp-0x4],0x0
0x080485c8 <main+50>: jmp 0x8048618 <main+130>
0x080485ca <main+52>: call 0x804852d <pass>
0x080485cf <main+57>: mov DWORD PTR [esp+0x8],0x64
0x080485d7 <main+65>: mov eax,DWORD PTR [ebp+0xc]
0x080485da <main+68>: add eax,0x4
0x080485dd <main+71>: mov eax,DWORD PTR [eax]
0x080485df <main+73>: mov DWORD PTR [esp+0x4],eax
0x080485e3 <main+77>: mov DWORD PTR [esp],0x80491a0
0x080485ea <main+84>: call 0x80483a8 <mbstowcs@plt>
0x080485ef <main+89>: mov DWORD PTR [esp+0x4],0x8049140
0x080485f7 <main+97>: mov DWORD PTR [esp],0x80491a0
0x080485fe <main+104>: call 0x80483d8 <wcscmp@plt>
0x08048603 <main+109>: test eax,eax
0x08048605 <main+111>: jne 0x804860c <main+118>
0x08048607 <main+113>: call 0x80484b4 <win>
0x0804860c <main+118>: mov DWORD PTR [esp],0x8048795
0x08048613 <main+125>: call 0x80483e8 <puts@plt>
0x08048618 <main+130>: mov eax,DWORD PTR [ebp-0x4]
0x0804861b <main+133>: leave
0x0804861c <main+134>: ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment