Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dump of assembler code for function main:
- entry sequence?
- 0x08048250 <main+0>: push %ebp Push %ebp onto stack
- 0x08048251 <main+1>: mov %esp,%ebp copy %esp to %ebp
- function code?
- 0x08048253 <main+3>: and $0xfffffff0,%esp %esp && 0xff ff ff f0 to %esp
- 0x08048256 <main+6>: push %ebx Push %ebx onto stack
- 0x08048257 <main+7>: sub $0x1c,%esp %esp - 0x1c to %esp (destination - source)
- 0x0804825a <main+10>: mov $0x80808081,%ebx copy 0x80808081 to %ebx
- 0x0804825f <main+15>: cmpl $0x1,0x8(%ebp) is 0x1 equal to what's stored in (%ebp + 8 bytes)?
- 0x08048263 <main+19>: je 0x80482c7 <main+119> then jump to 0x80482c7 <main+119>
- 0x08048265 <main+21>: mov 0xc(%ebp),%eax copy what's stored in %ebp + 12 bytes to %eax
- 0x08048268 <main+24>: mov (%eax),%eax copy what's stored in %eax location into %eax
- 0x0804826a <main+26>: mov %eax,0xc(%esp) copy what's stored in %eax location to where (%esp + 8 bytes) points
- 0x0804826e <main+30>: movl $0x80a7188,0x8(%esp) copy value 0x80a7188 to (%esp + 8 bytes)
- 0x08048276 <main+38>: movl $0x1,0x4(%esp) copy value 0x1 to (%esp + 4 bytes)
- 0x0804827e <main+46>: mov 0x80c6440,%eax copy value 0x80c6440 to %eax
- 0x08048283 <main+51>: mov %eax,(%esp) copy what's stored in %eax location to where %esp points
- 0x08048286 <main+54>: call 0x80524c0 <__fprintf_chk> call function at 0x80524c0
- 0x0804828b <main+59>: mov $0x1,%eax copy value 0x1 into %eax
- 0x08048290 <main+64>: jmp 0x80482de <main+142> jump to main+142
- 0x08048292 <main+66>: lea -0x2e(%eax,%eax,1),%ecx
- 0x08048296 <main+70>: mov %ecx,%eax
- 0x08048298 <main+72>: mul %ebx
- 0x0804829a <main+74>: shr $0x7,%edx
- 0x0804829d <main+77>: mov %edx,%eax
- 0x0804829f <main+79>: shl $0x8,%eax
- 0x080482a2 <main+82>: sub %edx,%eax
- 0x080482a4 <main+84>: sub %eax,%ecx
- 0x080482a6 <main+86>: mov %ecx,0xc(%esp)
- 0x080482aa <main+90>: movl $0x80a7193,0x8(%esp)
- 0x080482b2 <main+98>: movl $0x1,0x4(%esp)
- 0x080482ba <main+106>: mov 0x80c6440,%eax
- 0x080482bf <main+111>: mov %eax,(%esp)
- 0x080482c2 <main+114>: call 0x80524c0 <__fprintf_chk>
- we land here if main+19 checks out.
- 0x080482c7 <main+119>: mov 0x80c643c,%eax copy value 0x80c643c into %eax
- 0x080482cc <main+124>: mov %eax,(%esp) copy content of %eax to where %esp points
- 0x080482cf <main+127>: call 0x8048d60 <getc> call getc (reads a character, character is put in ???)
- 0x080482d4 <main+132>: cmp $0xffffffff,%eax
- 0x080482d7 <main+135>: jne 0x8048292 <main+66>
- 0x080482d9 <main+137>: mov $0x0,%eax
- we land here after main+64
- 0x080482de <main+142>: add $0x1c,%esp %esp - 0x1c, store result in %esp
- 0x080482e1 <main+145>: pop %ebx get top of stack (remove it) and store it into %ebx
- standard exit sequence?
- 0x080482e2 <main+146>: mov %ebp,%esp copy contents of %ebp into %esp
- 0x080482e4 <main+148>: pop %ebp get top of stack (remove it) and store it into %ebp
- 0x080482e5 <main+149>: ret return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement