ret2shellcode.c 用题目提供的执行文件可以,自己编译不能溢出成功!
(https://github.com/ctf-wiki/ctf-challenges/tree/master/pwn/stackoverflow/ret2shellcode/ret2shellcode-example)/ret2shellcode.c 用这个文件编译之后,用给出的方法不行,用题目中提供的执行文件可以。通过gdb发现: 题目给的目标文件: ──────[ DISASM ]──── ► 0x8048536 <main+9> mov eax, dword ptr [0x804a060] 0x804853b <main+14> mov dword ptr [esp + 0xc], 0 mov操作 0x8048543 <main+22> mov dword ptr [esp + 8], 2 0x804854b <main+30> mov dword ptr [esp + 4], 0 0x8048553 <main+38> mov dword ptr [esp], eax 0x8048556 <main+41> call setvbuf@plt setvbuf@plt 而自己编译之后这样: ────────────[ DISASM ]───── ► 0x80484f9 <main+14> sub esp, 0x74 0x80484fc <main+17> mov eax, dword ptr [stdout@@GLIBC_2.0] <0x804a044> 0x8048501 <main+22> push 0 push操作 0x8048503 <main+24> push 2 0x8048505 <main+26> push 0 0x8048507 <main+28> push eax 0x8048508 <main+29> call setvbuf@plt setvbuf@plt 造成不能溢出成功 请问题目中的执行文件如何编译的?