Advertisement
Guest User

Untitled

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