On était sous Windows, tu repasses sous un code linux, en l'occurrence celui ci ne fonctionne pas, celui la parcontre fonctionne sur 32 et 64 bits :
et pitié mets nous une syntaxe intel quand tu désassembles :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 #include <stdint.h> char sysCall_exit[]= "\xB8\x01\x00\x00\x00" "\xBB\x05\x00\x00\x00" "\xCD\x80"; int main (void) { uintptr_t *ret = (uintptr_t *)(&ret + 2); *ret = (uintptr_t)sysCall_exit; return 0; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Dump of assembler code for function main: 0x08048354 <main+0>: lea ecx,[esp+0x4] 0x08048358 <main+4>: and esp,0xfffffff0 0x0804835b <main+7>: push DWORD PTR [ecx-0x4] 0x0804835e <main+10>: push ebp 0x0804835f <main+11>: mov ebp,esp 0x08048361 <main+13>: push ecx 0x08048362 <main+14>: sub esp,0x10 0x08048365 <main+17>: lea eax,[ebp-0x8] 0x08048368 <main+20>: add eax,0x8 0x0804836b <main+23>: mov DWORD PTR [ebp-0x8],eax 0x0804836e <main+26>: mov edx,DWORD PTR [ebp-0x8] 0x08048371 <main+29>: mov eax,0x8049550 0x08048376 <main+34>: mov DWORD PTR [edx],eax 0x08048378 <main+36>: mov eax,0x0 0x0804837d <main+41>: add esp,0x10 0x08048380 <main+44>: pop ecx 0x08048381 <main+45>: pop ebp 0x08048382 <main+46>: lea esp,[ecx-0x4] 0x08048385 <main+49>: ret End of assembler dump.![]()







Répondre avec citation

Partager