Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. echo -e 'f(a,b){return a*b;}main(){printf("%d\\n",f(rand(),rand()));}' | gcc -m32 -O0 -xc -S -o - -
  2.  
  3. .file ""
  4. .text
  5. .globl f
  6. .type f, @function
  7. f:
  8. pushl %ebp
  9. movl %esp, %ebp
  10. movl 8(%ebp), %eax
  11. imull 12(%ebp), %eax
  12. popl %ebp
  13. ret
  14. .size f, .-f
  15. .section .rodata
  16. .LC0:
  17. .string "%d\n"
  18. .text
  19. .globl main
  20. .type main, @function
  21. main:
  22. pushl %ebp
  23. movl %esp, %ebp
  24. andl $-16, %esp
  25. pushl %ebx
  26. subl $28, %esp
  27. call rand
  28. movl %eax, %ebx
  29. call rand
  30. movl %ebx, 4(%esp)
  31. movl %eax, (%esp)
  32. call f
  33. movl %eax, 4(%esp)
  34. movl $.LC0, (%esp)
  35. call printf
  36. addl $28, %esp
  37. popl %ebx
  38. movl %ebp, %esp
  39. popl %ebp
  40. ret
  41. .size main, .-main
  42. .ident "GCC: (GNU) 4.4.2 20091208 (prerelease)"
  43. .section .note.GNU-stack,"",@progbits
Add Comment
Please, Sign In to add comment