Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://pastebin.com/PUEP0Rmv
- $ gcc -g -no-pie -o helloworld-no-pie helloworld.c
- $ readelf -r helloworld-no-pie | grep puts
- 000000601018 000100000007 R_X86_64_JUMP_SLO 0000000000000000 puts@GLIBC_2.2.5 + 0
- $ LD_BIND_NOW=1 gdb -q helloworld-no-pie
- Reading symbols from helloworld-no-pie...done.
- gdb-peda$ disp/gx 0x601018
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ b main
- Breakpoint 1 at 0x4004eb: file helloworld.c, line 21.
- gdb-peda$ r
- Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe348 --> 0x7fffffffe607 ("HOME=/home/ubuntu")
- RSI: 0x7fffffffe338 --> 0x7fffffffe5cd ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
- RDI: 0x1
- RBP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- RIP: 0x4004eb (<main+4>: lea rdi,[rip+0x92] # 0x400584)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe330 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4004e5 <frame_dummy+5>: jmp 0x400470 <register_tm_clones>
- 0x4004e7 <main>: push rbp
- 0x4004e8 <main+1>: mov rbp,rsp
- => 0x4004eb <main+4>: lea rdi,[rip+0x92] # 0x400584
- 0x4004f2 <main+11>: call 0x4003f0 <puts@plt>
- 0x4004f7 <main+16>: mov eax,0x0
- 0x4004fc <main+21>: pop rbp
- 0x4004fd <main+22>: ret
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe258 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe260 --> 0x1
- 0024| 0x7fffffffe268 --> 0x7fffffffe338 --> 0x7fffffffe5cd ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
- 0032| 0x7fffffffe270 --> 0x100008000
- 0040| 0x7fffffffe278 --> 0x4004e7 (<main>: push rbp)
- 0048| 0x7fffffffe280 --> 0x0
- 0056| 0x7fffffffe288 --> 0x987654d3638367ad
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, main () at helloworld.c:21
- 21 printf("Hello world!\n");
- 1: x/xg 0x601018 0x601018: 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
- Setting environment variable "LD_BIND_NOW" to null value.
- gdb-peda$ r
- Starting program: /home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe348 --> 0x7fffffffe608 ("HOME=/home/ubuntu")
- RSI: 0x7fffffffe338 --> 0x7fffffffe5ce ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
- RDI: 0x1
- RBP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- RIP: 0x4004eb (<main+4>: lea rdi,[rip+0x92] # 0x400584)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe330 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4004e5 <frame_dummy+5>: jmp 0x400470 <register_tm_clones>
- 0x4004e7 <main>: push rbp
- 0x4004e8 <main+1>: mov rbp,rsp
- => 0x4004eb <main+4>: lea rdi,[rip+0x92] # 0x400584
- 0x4004f2 <main+11>: call 0x4003f0 <puts@plt>
- 0x4004f7 <main+16>: mov eax,0x0
- 0x4004fc <main+21>: pop rbp
- 0x4004fd <main+22>: ret
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe250 --> 0x400500 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe258 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe260 --> 0x1
- 0024| 0x7fffffffe268 --> 0x7fffffffe338 --> 0x7fffffffe5ce ("/home/ubuntu/Dropbox/Workspace/c/doodle/helloworld-no-pie")
- 0032| 0x7fffffffe270 --> 0x100008000
- 0040| 0x7fffffffe278 --> 0x4004e7 (<main>: push rbp)
- 0048| 0x7fffffffe280 --> 0x0
- 0056| 0x7fffffffe288 --> 0xc4b72acf028116a5
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, main () at helloworld.c:21
- 21 printf("Hello world!\n");
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- ➜ gdb -q helloworld-no-pie
- Reading symbols from helloworld-no-pie...done.
- gdb-peda$ disas main
- Dump of assembler code for function main:
- 0x00000000004004e7 <+0>: push rbp
- 0x00000000004004e8 <+1>: mov rbp,rsp
- 0x00000000004004eb <+4>: lea rdi,[rip+0x92] # 0x400584
- 0x00000000004004f2 <+11>: call 0x4003f0 <puts@plt>
- 0x00000000004004f7 <+16>: mov eax,0x0
- 0x00000000004004fc <+21>: pop rbp
- 0x00000000004004fd <+22>: ret
- End of assembler dump.
- gdb-peda$ b *(main+11)
- Breakpoint 1 at 0x4004f2: file helloworld.c, line 21.
- gdb-peda$ disp/gx 0x601018
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ r
- Starting program: /home/ubuntu/c/helloworld-no-pie
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RIP: 0x4004f2 (<main+11>: call 0x4003f0 <puts@plt>)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4004e7 <main>: push rbp
- 0x4004e8 <main+1>: mov rbp,rsp
- 0x4004eb <main+4>: lea rdi,[rip+0x92] # 0x400584
- => 0x4004f2 <main+11>: call 0x4003f0 <puts@plt>
- 0x4004f7 <main+16>: mov eax,0x0
- 0x4004fc <main+21>: pop rbp
- 0x4004fd <main+22>: ret
- 0x4004fe: xchg ax,ax
- Guessed arguments:
- arg[0]: 0x400584 ("Hello world!")
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe2c0 --> 0x1
- 0024| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0032| 0x7fffffffe2d0 --> 0x100008000
- 0040| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- 0048| 0x7fffffffe2e0 --> 0x0
- 0056| 0x7fffffffe2e8 --> 0xb8a1e122917df5b0
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, 0x00000000004004f2 in main () at helloworld.c:21
- 21 printf("Hello world!\n");
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ si
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- RIP: 0x4003f0 (<puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4003e1: xor eax,0x200c22
- 0x4003e6: jmp QWORD PTR [rip+0x200c24] # 0x601010
- 0x4003ec: nop DWORD PTR [rax+0x0]
- => 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- | 0x4003f6 <puts@plt+6>: push 0x0
- | 0x4003fb <puts@plt+11>: jmp 0x4003e0
- | 0x400400 <_start>: xor ebp,ebp
- | 0x400402 <_start+2>: mov r9,rdx
- |-> 0x4003f6 <puts@plt+6>: push 0x0
- 0x4003fb <puts@plt+11>: jmp 0x4003e0
- 0x400400 <_start>: xor ebp,ebp
- 0x400402 <_start+2>: mov r9,rdx
- JUMP is taken
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0008| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0016| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0024| 0x7fffffffe2c0 --> 0x1
- 0032| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0040| 0x7fffffffe2d0 --> 0x100008000
- 0048| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- 0056| 0x7fffffffe2e0 --> 0x0
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004003f0 in puts@plt ()
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ si
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- RIP: 0x4003f6 (<puts@plt+6>: push 0x0)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4003e6: jmp QWORD PTR [rip+0x200c24] # 0x601010
- 0x4003ec: nop DWORD PTR [rax+0x0]
- 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- => 0x4003f6 <puts@plt+6>: push 0x0
- 0x4003fb <puts@plt+11>: jmp 0x4003e0
- 0x400400 <_start>: xor ebp,ebp
- 0x400402 <_start+2>: mov r9,rdx
- 0x400405 <_start+5>: pop rsi
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0008| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0016| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0024| 0x7fffffffe2c0 --> 0x1
- 0032| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0040| 0x7fffffffe2d0 --> 0x100008000
- 0048| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- 0056| 0x7fffffffe2e0 --> 0x0
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004003f6 in puts@plt ()
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ ni
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2a0 --> 0x0
- RIP: 0x4003fb (<puts@plt+11>: jmp 0x4003e0)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4003ec: nop DWORD PTR [rax+0x0]
- 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- 0x4003f6 <puts@plt+6>: push 0x0
- => 0x4003fb <puts@plt+11>: jmp 0x4003e0
- | 0x400400 <_start>: xor ebp,ebp
- | 0x400402 <_start+2>: mov r9,rdx
- | 0x400405 <_start+5>: pop rsi
- | 0x400406 <_start+6>: mov rdx,rsp
- |-> 0x4003e0: push QWORD PTR [rip+0x200c22] # 0x601008
- 0x4003e6: jmp QWORD PTR [rip+0x200c24] # 0x601010
- 0x4003ec: nop DWORD PTR [rax+0x0]
- 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- JUMP is taken
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2a0 --> 0x0
- 0008| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0016| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0024| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0032| 0x7fffffffe2c0 --> 0x1
- 0040| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0048| 0x7fffffffe2d0 --> 0x100008000
- 0056| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004003fb in puts@plt ()
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ ni
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2a0 --> 0x0
- RIP: 0x4003e0 (push QWORD PTR [rip+0x200c22] # 0x601008)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- => 0x4003e0: push QWORD PTR [rip+0x200c22] # 0x601008
- 0x4003e6: jmp QWORD PTR [rip+0x200c24] # 0x601010
- 0x4003ec: nop DWORD PTR [rax+0x0]
- 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2a0 --> 0x0
- 0008| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0016| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0024| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0032| 0x7fffffffe2c0 --> 0x1
- 0040| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0048| 0x7fffffffe2d0 --> 0x100008000
- 0056| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004003e0 in ?? ()
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ ni
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe298 --> 0x7ffff7ffe170 --> 0x0
- RIP: 0x4003e6 (jmp QWORD PTR [rip+0x200c24] # 0x601010)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4003de <_init+22>: ret
- 0x4003df: add bh,bh
- 0x4003e1: xor eax,0x200c22
- => 0x4003e6: jmp QWORD PTR [rip+0x200c24] # 0x601010
- | 0x4003ec: nop DWORD PTR [rax+0x0]
- | 0x4003f0 <puts@plt>: jmp QWORD PTR [rip+0x200c22] # 0x601018
- | 0x4003f6 <puts@plt+6>: push 0x0
- | 0x4003fb <puts@plt+11>: jmp 0x4003e0
- |-> 0x7ffff7dec680 <_dl_runtime_resolve_xsave>: push rbx
- 0x7ffff7dec681 <_dl_runtime_resolve_xsave+1>: mov rbx,rsp
- 0x7ffff7dec684 <_dl_runtime_resolve_xsave+4>: and rsp,0xffffffffffffffc0
- 0x7ffff7dec688 <_dl_runtime_resolve_xsave+8>: sub rsp,QWORD PTR [rip+0x210179] # 0x7ffff7ffc808 <_rtld_global_ro+168>
- JUMP is taken
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe298 --> 0x7ffff7ffe170 --> 0x0
- 0008| 0x7fffffffe2a0 --> 0x0
- 0016| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0024| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0032| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0040| 0x7fffffffe2c0 --> 0x1
- 0048| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0056| 0x7fffffffe2d0 --> 0x100008000
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004003e6 in ?? ()
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ ni
- [----------------------------------registers-----------------------------------]
- RAX: 0x4004e7 (<main>: push rbp)
- RBX: 0x0
- RCX: 0x400500 (<__libc_csu_init>: push r15)
- RDX: 0x7fffffffe3a8 --> 0x7fffffffe63e ("LANG=en_US.UTF-8")
- RSI: 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- RDI: 0x400584 ("Hello world!")
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe298 --> 0x7ffff7ffe170 --> 0x0
- RIP: 0x7ffff7dec680 (<_dl_runtime_resolve_xsave>: push rbx)
- R8 : 0x7ffff7dd0d80 --> 0x0
- R9 : 0x7ffff7dd0d80 --> 0x0
- R10: 0x0
- R11: 0x1
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x7ffff7dec674 <_dl_runtime_resolve_fxsave+116>: add rsp,0x18
- 0x7ffff7dec678 <_dl_runtime_resolve_fxsave+120>: bnd jmp r11
- 0x7ffff7dec67c: nop DWORD PTR [rax+0x0]
- => 0x7ffff7dec680 <_dl_runtime_resolve_xsave>: push rbx
- 0x7ffff7dec681 <_dl_runtime_resolve_xsave+1>: mov rbx,rsp
- 0x7ffff7dec684 <_dl_runtime_resolve_xsave+4>: and rsp,0xffffffffffffffc0
- 0x7ffff7dec688 <_dl_runtime_resolve_xsave+8>: sub rsp,QWORD PTR [rip+0x210179] # 0x7ffff7ffc808 <_rtld_global_ro+168>
- 0x7ffff7dec68f <_dl_runtime_resolve_xsave+15>: mov QWORD PTR [rsp],rax
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe298 --> 0x7ffff7ffe170 --> 0x0
- 0008| 0x7fffffffe2a0 --> 0x0
- 0016| 0x7fffffffe2a8 --> 0x4004f7 (<main+16>: mov eax,0x0)
- 0024| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0032| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0040| 0x7fffffffe2c0 --> 0x1
- 0048| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0056| 0x7fffffffe2d0 --> 0x100008000
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- _dl_runtime_resolve_xsave () at ../sysdeps/x86_64/dl-trampoline.h:71
- 71 ../sysdeps/x86_64/dl-trampoline.h: No such file or directory.
- 1: x/xg 0x601018 0x601018: 0x00000000004003f6
- gdb-peda$ finish
- Run till exit from #0 _dl_runtime_resolve_xsave () at ../sysdeps/x86_64/dl-trampoline.h:71
- Hello world!
- [----------------------------------registers-----------------------------------]
- RAX: 0xd ('\r')
- RBX: 0x0
- RCX: 0x7ffff7af4154 (<__GI___libc_write+20>: cmp rax,0xfffffffffffff000)
- RDX: 0x7ffff7dd18c0 --> 0x0
- RSI: 0x602260 ("Hello world!\n")
- RDI: 0x1
- RBP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RSP: 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- RIP: 0x4004f7 (<main+16>: mov eax,0x0)
- R8 : 0x0
- R9 : 0x0
- R10: 0x602010 --> 0x0
- R11: 0x246
- R12: 0x400400 (<_start>: xor ebp,ebp)
- R13: 0x7fffffffe390 --> 0x1
- R14: 0x0
- R15: 0x0
- EFLAGS: 0x206 (carry PARITY adjust zero sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x4004e8 <main+1>: mov rbp,rsp
- 0x4004eb <main+4>: lea rdi,[rip+0x92] # 0x400584
- 0x4004f2 <main+11>: call 0x4003f0 <puts@plt>
- => 0x4004f7 <main+16>: mov eax,0x0
- 0x4004fc <main+21>: pop rbp
- 0x4004fd <main+22>: ret
- 0x4004fe: xchg ax,ax
- 0x400500 <__libc_csu_init>: push r15
- [------------------------------------stack-------------------------------------]
- 0000| 0x7fffffffe2b0 --> 0x400500 (<__libc_csu_init>: push r15)
- 0008| 0x7fffffffe2b8 --> 0x7ffff7a05b97 (<__libc_start_main+231>: mov edi,eax)
- 0016| 0x7fffffffe2c0 --> 0x1
- 0024| 0x7fffffffe2c8 --> 0x7fffffffe398 --> 0x7fffffffe604 ("/home/ubuntu/c/helloworld-no-pie")
- 0032| 0x7fffffffe2d0 --> 0x100008000
- 0040| 0x7fffffffe2d8 --> 0x4004e7 (<main>: push rbp)
- 0048| 0x7fffffffe2e0 --> 0x0
- 0056| 0x7fffffffe2e8 --> 0xb8a1e122917df5b0
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- 0x00000000004004f7 in main () at helloworld.c:21
- 21 printf("Hello world!\n");
- 1: x/xg 0x601018 0x601018: 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