Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ gcc -g -o helloworld helloworld.c
- $ gdb -q helloworld
- Reading symbols from helloworld...done.
- gdb-peda$ set env LD_BIND_NOW
- Setting environment variable "LD_BIND_NOW" to null value.
- gdb-peda$ b main
- Breakpoint 1 at 0x63e: file helloworld.c, line 21.
- gdb-peda$ r
- Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld
- [----------------------------------registers-----------------------------------]
- RAX: 0x55555555463a (<main>: push rbp)
- RBX: 0x0
- RCX: 0x555555554660 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe368 --> 0x7fffffffe616 ("HOME=/home/ubuntu")
- RSI: 0x7fffffffe358 --> 0x7fffffffe5e3 ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld")
- RDI: 0x1
- RBP: 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- RIP: 0x55555555463e (<main+4>: lea rdi,[rip+0x9f] # 0x5555555546e4)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x555555554530 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe350 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x555555554635 <frame_dummy+5>: jmp 0x5555555545a0 <register_tm_clones>
- 0x55555555463a <main>: push rbp
- 0x55555555463b <main+1>: mov rbp,rsp
- => 0x55555555463e <main+4>: lea rdi,[rip+0x9f] # 0x5555555546e4
- 0x555555554645 <main+11>: call 0x555555554510 <puts@plt>
- 0x55555555464a <main+16>: mov eax,0x0
- 0x55555555464f <main+21>: pop rbp
- 0x555555554650 <main+22>: ret
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe278 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe280 --> 0x1
- 0024| 0x7fffffffe288 --> 0x7fffffffe358 --> 0x7fffffffe5e3 ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld")
- 0032| 0x7fffffffe290 --> 0x100008000
- 0040| 0x7fffffffe298 --> 0x55555555463a (<main>: push rbp)
- 0048| 0x7fffffffe2a0 --> 0x0
- 0056| 0x7fffffffe2a8 --> 0xb753b8891c71e1e2
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, main () at helloworld.c:21
- 21 printf("Hello world!\n");
- gdb-peda$ x/i 0x555555554510
- 0x555555554510 <puts@plt>: jmp QWORD PTR [rip+0x200aba] # 0x555555754fd0
- gdb-peda$ x/gx 0x555555754fd0
- 0x555555754fd0: 0x00007ffff7a649c0
- gdb-peda$ x/4i 0x00007ffff7a649c0
- 0x7ffff7a649c0 <_IO_puts>: push r13
- 0x7ffff7a649c2 <_IO_puts+2>: push r12
- 0x7ffff7a649c4 <_IO_puts+4>: mov r12,rdi
- 0x7ffff7a649c7 <_IO_puts+7>: push rbp
- gdb-peda$ set env LD_BIND_NOW=1
- gdb-peda$ show env LD_BIND_NOW
- LD_BIND_NOW = 1
- gdb-peda$ r
- Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld
- [----------------------------------registers-----------------------------------]
- RAX: 0x55555555463a (<main>: push rbp)
- RBX: 0x0
- RCX: 0x555555554660 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe368 --> 0x7fffffffe615 ("HOME=/home/ubuntu")
- RSI: 0x7fffffffe358 --> 0x7fffffffe5e2 ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld")
- RDI: 0x1
- RBP: 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- RIP: 0x55555555463e (<main+4>: lea rdi,[rip+0x9f] # 0x5555555546e4)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x555555554530 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe350 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x555555554635 <frame_dummy+5>: jmp 0x5555555545a0 <register_tm_clones>
- 0x55555555463a <main>: push rbp
- 0x55555555463b <main+1>: mov rbp,rsp
- => 0x55555555463e <main+4>: lea rdi,[rip+0x9f] # 0x5555555546e4
- 0x555555554645 <main+11>: call 0x555555554510 <puts@plt>
- 0x55555555464a <main+16>: mov eax,0x0
- 0x55555555464f <main+21>: pop rbp
- 0x555555554650 <main+22>: ret
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe270 --> 0x555555554660 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe278 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe280 --> 0x1
- 0024| 0x7fffffffe288 --> 0x7fffffffe358 --> 0x7fffffffe5e2 ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld")
- 0032| 0x7fffffffe290 --> 0x100008000
- 0040| 0x7fffffffe298 --> 0x55555555463a (<main>: push rbp)
- 0048| 0x7fffffffe2a0 --> 0x0
- 0056| 0x7fffffffe2a8 --> 0xd117bf73fe78886d
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, main () at helloworld.c:21
- 21 printf("Hello world!\n");
- gdb-peda$ x/i 0x555555554510
- 0x555555554510 <puts@plt>: jmp QWORD PTR [rip+0x200aba] # 0x555555754fd0
- gdb-peda$ x/gx 0x555555754fd0
- 0x555555754fd0: 0x00007ffff7a649c0
- gdb-peda$ x/4i 0x00007ffff7a649c0
- 0x7ffff7a649c0 <_IO_puts>: push r13
- 0x7ffff7a649c2 <_IO_puts+2>: push r12
- 0x7ffff7a649c4 <_IO_puts+4>: mov r12,rdi
- 0x7ffff7a649c7 <_IO_puts+7>: push rbp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement