Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (gdb) disas rot
- Dump of assembler code for function rot:
- 0x0000000000000832 <+0>: push rbp
- 0x0000000000000833 <+1>: mov rbp,rsp
- 0x0000000000000836 <+4>: push rbx
- 0x0000000000000837 <+5>: sub rsp,0x98
- 0x000000000000083e <+12>: mov QWORD PTR [rbp-0x98],rdi
- 0x0000000000000845 <+19>: mov DWORD PTR [rbp-0x9c],esi
- 0x000000000000084b <+25>: mov rax,QWORD PTR fs:0x28
- 0x0000000000000854 <+34>: mov QWORD PTR [rbp-0x18],rax
- 0x0000000000000858 <+38>: xor eax,eax
- 0x000000000000085a <+40>: mov DWORD PTR [rbp-0x8c],0x0
- 0x0000000000000864 <+50>: jmp 0x911 <rot+223>
- 0x0000000000000869 <+55>: mov eax,DWORD PTR [rbp-0x8c]
- 0x000000000000086f <+61>: movsxd rdx,eax
- 0x0000000000000872 <+64>: mov rax,QWORD PTR [rbp-0x98]
- 0x0000000000000879 <+71>: add rax,rdx
- 0x000000000000087c <+74>: movzx eax,BYTE PTR [rax]
- 0x000000000000087f <+77>: movsx eax,al
- 0x0000000000000882 <+80>: mov esi,eax
- 0x0000000000000884 <+82>: lea rdi,[rip+0x200785] # 0x201010 <alphabet>
- 0x000000000000088b <+89>: call 0x680 <strchr@plt>
- 0x0000000000000890 <+94>: mov QWORD PTR [rbp-0x88],rax
- 0x0000000000000897 <+101>: cmp QWORD PTR [rbp-0x88],0x0
- 0x000000000000089f <+109>: je 0x8e7 <rot+181>
- 0x00000000000008a1 <+111>: mov rdx,QWORD PTR [rbp-0x88]
- 0x00000000000008a8 <+118>: lea rax,[rip+0x200761] # 0x201010 <alphabet>
- 0x00000000000008af <+125>: sub rdx,rax
- 0x00000000000008b2 <+128>: mov eax,DWORD PTR [rbp-0x9c]
- 0x00000000000008b8 <+134>: cdqe
- 0x00000000000008ba <+136>: add rax,rdx
- 0x00000000000008bd <+139>: mov rbx,rax
- 0x00000000000008c0 <+142>: lea rdi,[rip+0x200749] # 0x201010 <alphabet>
- 0x00000000000008c7 <+149>: call 0x660 <strlen@plt>
- 0x00000000000008cc <+154>: mov rcx,rax
- 0x00000000000008cf <+157>: mov rax,rbx
- 0x00000000000008d2 <+160>: mov edx,0x0
- 0x00000000000008d7 <+165>: div rcx
- 0x00000000000008da <+168>: lea rax,[rip+0x20072f] # 0x201010 <alphabet>
- 0x00000000000008e1 <+175>: movzx eax,BYTE PTR [rdx+rax*1]
- 0x00000000000008e5 <+179>: jmp 0x8fd <rot+203>
- 0x00000000000008e7 <+181>: mov eax,DWORD PTR [rbp-0x8c]
- 0x00000000000008ed <+187>: movsxd rdx,eax
- 0x00000000000008f0 <+190>: mov rax,QWORD PTR [rbp-0x98]
- 0x00000000000008f7 <+197>: add rax,rdx
- 0x00000000000008fa <+200>: movzx eax,BYTE PTR [rax]
- 0x00000000000008fd <+203>: mov edx,DWORD PTR [rbp-0x8c]
- 0x0000000000000903 <+209>: movsxd rdx,edx
- 0x0000000000000906 <+212>: mov BYTE PTR [rbp+rdx*1-0x80],al
- 0x000000000000090a <+216>: add DWORD PTR [rbp-0x8c],0x1
- 0x0000000000000911 <+223>: mov eax,DWORD PTR [rbp-0x8c]
- 0x0000000000000917 <+229>: movsxd rbx,eax
- 0x000000000000091a <+232>: mov rax,QWORD PTR [rbp-0x98]
- 0x0000000000000921 <+239>: mov rdi,rax
- 0x0000000000000924 <+242>: call 0x660 <strlen@plt>
- 0x0000000000000929 <+247>: cmp rbx,rax
- 0x000000000000092c <+250>: jb 0x869 <rot+55>
- 0x0000000000000932 <+256>: lea rax,[rbp-0x80]
- 0x0000000000000936 <+260>: mov rdi,rax
- 0x0000000000000939 <+263>: call 0x650 <puts@plt>
- 0x000000000000093e <+268>: nop
- 0x000000000000093f <+269>: mov rax,QWORD PTR [rbp-0x18]
- 0x0000000000000943 <+273>: xor rax,QWORD PTR fs:0x28
- 0x000000000000094c <+282>: je 0x953 <rot+289>
- 0x000000000000094e <+284>: call 0x670 <__stack_chk_fail@plt>
- 0x0000000000000953 <+289>: add rsp,0x98
- 0x000000000000095a <+296>: pop rbx
- 0x000000000000095b <+297>: pop rbp
- 0x000000000000095c <+298>: ret
- End of assembler dump.
- (gdb) break *rot+260
- Breakpoint 1 at 0x936: file ../rot.c, line 25.
- (gdb) r rotations_are_cool 13
- Starting program: /home/michael/Desktop/rotation rotations_are_cool 13
- Breakpoint 1, 0x0000555555554936 in rot (
- t=0x7fffffffe2d2 "rotations_are_cool", r=13) at ../rot.c:25
- 25 printf("%s\n", result);
- (gdb) x/s $rbp-0x80
- 0x7fffffffdde0: "ebgngvbaf_ner_pbby\377\367\377\177" <- Here is the strange data
- (gdb) quit
- A debugging session is active.
- Inferior 1 [process 27971] will be killed.
- Quit anyway? (y or n) y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement