Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GDB 4.81 KB | None | 0 0
  1. gdb -q helloworld-no-pie
  2. Reading symbols from helloworld-no-pie...done.
  3. gdb-peda$ set env LD_BIND_NOW
  4. Setting environment variable "LD_BIND_NOW" to null value.
  5. gdb-peda$ disp/gx 0x601018
  6. 1: x/xg 0x601018  0x601018:     0x00000000004003f6
  7. gdb-peda$ b main
  8. Breakpoint 1 at 0x4004eb: file helloworld.c, line 21.
  9. gdb-peda$ r
  10. Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie
  11. [----------------------------------registers-----------------------------------]
  12. RAX: 0x4004e7 (<main>:  push   rbp)
  13. RBX: 0x0
  14. RCX: 0x400500 (<__libc_csu_init>:       push   r15)
  15. RDX: 0x7fffffffe348 --> 0x7fffffffe608 ("HOME=/home/ubuntu")
  16. RSI: 0x7fffffffe338 --> 0x7fffffffe5ce ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
  17. RDI: 0x1
  18. RBP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:    push   r15)
  19. RSP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:    push   r15)
  20. RIP: 0x4004eb (<main+4>:        lea    rdi,[rip+0x92]        # 0x400584)
  21. R8 : 0x7ffff7dd0d80 --> 0x0
  22. R9 : 0x7ffff7dd0d80 --> 0x0
  23. R10: 0x0
  24. R11: 0x1
  25. R12: 0x400400 (<_start>:        xor    ebp,ebp)
  26. R13: 0x7fffffffe330 --> 0x1
  27. R14: 0x0
  28. R15: 0x0
  29. EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
  30. [-------------------------------------code-------------------------------------]
  31.    0x4004e5 <frame_dummy+5>:    jmp    0x400470 <register_tm_clones>
  32.    0x4004e7 <main>:     push   rbp
  33.    0x4004e8 <main+1>:   mov    rbp,rsp
  34. => 0x4004eb <main+4>:   lea    rdi,[rip+0x92]        # 0x400584
  35.    0x4004f2 <main+11>:  call   0x4003f0 <puts@plt>
  36.    0x4004f7 <main+16>:  mov    eax,0x0
  37.    0x4004fc <main+21>:  pop    rbp
  38.    0x4004fd <main+22>:  ret
  39. [------------------------------------stack-------------------------------------]
  40. 0000| 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:   push   r15)
  41. 0008| 0x7fffffffe258 --> 0x7ffff7a05b97 (<__libc_start_main+231>:       mov    edi,eax)
  42. 0016| 0x7fffffffe260 --> 0x1
  43. 0024| 0x7fffffffe268 --> 0x7fffffffe338 --> 0x7fffffffe5ce ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
  44. 0032| 0x7fffffffe270 --> 0x100008000
  45. 0040| 0x7fffffffe278 --> 0x4004e7 (<main>:      push   rbp)
  46. 0048| 0x7fffffffe280 --> 0x0
  47. 0056| 0x7fffffffe288 --> 0x4109919a95c7f178
  48. [------------------------------------------------------------------------------]
  49. Legend: code, data, rodata, value
  50.  
  51. Breakpoint 1, main () at helloworld.c:21
  52. 21          printf("Hello world!\n");
  53. 1: x/xg 0x601018  0x601018:     0x00000000004003f6
  54. gdb-peda$ set env LD_BIND_NOW=1
  55. gdb-peda$ r
  56. Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie
  57. [----------------------------------registers-----------------------------------]
  58. RAX: 0x4004e7 (<main>:  push   rbp)
  59. RBX: 0x0
  60. RCX: 0x400500 (<__libc_csu_init>:       push   r15)
  61. RDX: 0x7fffffffe348 --> 0x7fffffffe607 ("HOME=/home/ubuntu")
  62. RSI: 0x7fffffffe338 --> 0x7fffffffe5cd ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
  63. RDI: 0x1
  64. RBP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:    push   r15)
  65. RSP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:    push   r15)
  66. RIP: 0x4004eb (<main+4>:        lea    rdi,[rip+0x92]        # 0x400584)
  67. R8 : 0x7ffff7dd0d80 --> 0x0
  68. R9 : 0x7ffff7dd0d80 --> 0x0
  69. R10: 0x0
  70. R11: 0x1
  71. R12: 0x400400 (<_start>:        xor    ebp,ebp)
  72. R13: 0x7fffffffe330 --> 0x1
  73. R14: 0x0
  74. R15: 0x0
  75. EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
  76. [-------------------------------------code-------------------------------------]
  77.    0x4004e5 <frame_dummy+5>:    jmp    0x400470 <register_tm_clones>
  78.    0x4004e7 <main>:     push   rbp
  79.    0x4004e8 <main+1>:   mov    rbp,rsp
  80. => 0x4004eb <main+4>:   lea    rdi,[rip+0x92]        # 0x400584
  81.    0x4004f2 <main+11>:  call   0x4003f0 <puts@plt>
  82.    0x4004f7 <main+16>:  mov    eax,0x0
  83.    0x4004fc <main+21>:  pop    rbp
  84.    0x4004fd <main+22>:  ret
  85. [------------------------------------stack-------------------------------------]
  86. 0000| 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>:   push   r15)
  87. 0008| 0x7fffffffe258 --> 0x7ffff7a05b97 (<__libc_start_main+231>:       mov    edi,eax)
  88. 0016| 0x7fffffffe260 --> 0x1
  89. 0024| 0x7fffffffe268 --> 0x7fffffffe338 --> 0x7fffffffe5cd ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
  90. 0032| 0x7fffffffe270 --> 0x100008000
  91. 0040| 0x7fffffffe278 --> 0x4004e7 (<main>:      push   rbp)
  92. 0048| 0x7fffffffe280 --> 0x0
  93. 0056| 0x7fffffffe288 --> 0xbb586d33e5a0e758
  94. [------------------------------------------------------------------------------]
  95. Legend: code, data, rodata, value
  96.  
  97. Breakpoint 1, main () at helloworld.c:21
  98. 21          printf("Hello world!\n");
  99. 1: x/xg 0x601018  0x601018:     0x00007ffff7a649c0
  100. gdb-peda$ x/4i 0x00007ffff7a649c0
  101.    0x7ffff7a649c0 <_IO_puts>:   push   r13
  102.    0x7ffff7a649c2 <_IO_puts+2>: push   r12
  103.    0x7ffff7a649c4 <_IO_puts+4>: mov    r12,rdi
  104.    0x7ffff7a649c7 <_IO_puts+7>: push   rbp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement