這裏後改變是一個彙編代碼片段:硬編碼地址組裝
jmp short getadd
shellcode:
pop esi
xor eax, eax
mov byte [esi+9], al
push dword esi
call 0x8048300
; adress found by deassmembling a c program for printf
xor eax,eax
mov al,0
xor ebx,ebx
int 0x80
getadd:
call shellcode
db "nice job!"
但後傾我找到的對象:
Disassembly of section .text:
00000000 <shellcode-0x2>:
0: eb 14 jmp 16 <getadd>
00000002 <shellcode>:
2: 5e pop %esi
3: 31 c0 xor %eax,%eax
5: 88 46 09 mov %al,0x9(%esi)
8: 56 push %esi
9: e8 fc 82 04 08 call 804830a <getadd+0x80482f4>
e: 31 c0 xor %eax,%eax
10: b0 00 mov $0x0,%al
12: 31 db xor %ebx,%ebx
14: cd 80 int $0x80
00000016 <mycall>:
16: e8 e7 ff ff ff call 2 <shellcode>
1b: 6e outsb %ds:(%esi),(%dx)
1c: 69 63 65 20 6a 6f 62 imul $0x626f6a20,0x65(%ebx),%esp
23: 21 .byte 0x21
爲什麼地址從改變0x8048300到804830a?
您可以享受,這是非常愉快的有[objdump的輸出Intel語法(http://stackoverflow.com/questions/10362630/how-can-objdump-emit-intel-syntax)。 –
真的,謝謝先生Jonathon – silentboy
另外,爲什麼你在運行時null結束字符串?只要做'db'很好的工作!「,0' –