Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strncpy@plt = 0x8048390
- PLT strcpy prosedurunun relative offsetini vererek aktual kodun icrasi ucun GOT table offsetine *jmp* edir.
- Dump of assembler code for function strncpy@plt:
- 0x08048390 <+0>: jmp DWORD PTR ds:0x804a01c
- GOT offseti 0x804a01c bu adresdedir getdim. aktual kodu icra etmeye baslayiram.
- 0xf7e92ec3: mov edi,DWORD PTR [esp+0x10]
- 0xf7e92ec7: mov esi,DWORD PTR [esp+0x14]
- 0xf7e92ecb: mov ebx,DWORD PTR [esp+0x18]
- 0xf7e92ed1: je 0xf7e93ee0
- 0xf7e92ed7: mov ecx,esi
- => 0xf7e92ed9: mov eax,edi
- gdb-peda$ x/s $ecx
- 0xffffcf01: "Qumar"
- 0xf7e92edb: and ecx,0xf
- 0xf7e92ede: je 0xf7e9312e
- 0xf7e92ee4: and esi,0xfffffff0
- gdb-peda$ x/x $esi
- 0xffffcf00: 0x00
- => 0xf7e93352: jne 0xf7e932d0
- | 0xf7e93358: sub ebx,ecx
- | 0xf7e9335a: add esi,ecx
- | 0xf7e9335c: call 0xf7f2d94f
- | 0xf7e93361: add ecx,0xcfe9f
- |-> 0xf7e932d0: sub ebx,ecx
- 0xf7e932d2: add esi,ecx
- 0xf7e932d4: bsf edx,edx
- 0xf7e932d7: cmp edx,ebx
- EBX: 0x3
- ECX: 0x1
- EDX: 0xfe0
- EBX-ECX = 2
- ESI+ECX=
- ||
- ^^
- $esi contenti Qumar memory adresine mapped edildiyine gore and (bitwise) emeliyyati ile `SHARED OBJECT` artiq `merging` emeliyyatina baslayir.
- gdb-peda$ x/s $esi+1
- 0xffffcf01: "Qumar"
- => 0xf7e932d2: add esi,ecx
- x/x $ecx == 1
- bu halda $ecx == "Qumar"
- 0xf7e938a9: lea esi,[esi+eiz*1+0x0]
- 0xf7e938b0: mov dx,WORD PTR [esi] most significant byte 0x5171 (QU) move edilir dx registerine (16 bit registere)
- 0xf7e938b3: mov WORD PTR [edi],dx == "Qu" verilen bayt
- ^^^^^^^^^^^ Register indirect addressing modunda WORD specific size verilerek (4 byte) memory uzerinde "tabxana" slice-nin pointerine move edilir bu pointer refer edir bu addresi '0xffffcef7' hemcinin EAX registeride bu adresi refer etdiyine gore.
- neticede
- EAX: 0xffffcef7 ("Qutabxana")
- EBX: 0x2
- ECX: 0xf7e938b0 (mov dx,WORD PTR [esi])
- EDX: 0x7551 ('Qu')
- ESI: 0xffffcf01 ("Qumar")
- EDI: 0xffffcef7 ("Qutabxana")
- ;)
- point to ===> 0xffffcef7 $EDI: 0xffffcef7
- EDX: 0x7551 ('Qu')
Add Comment
Please, Sign In to add comment