Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.
— |
pwnium2k14_reverse1 [2017/04/09 15:33] (Version actuelle) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | L'épreuve consiste en un ELF qui répète « Baby Crackme » si on le lance. | ||
+ | En l'ouvrant avec IDA, on remarque qu'il compare argc avec 1, et saute ailleurs si c'est strictement plus grand. | ||
+ | Le code vers le quel il saute est le suivant : | ||
+ | <code> | ||
+ | .text:08048471 loc_8048471: ; CODE XREF: main+Dj | ||
+ | .text:08048471 mov dword ptr [esp], 'G' ; c | ||
+ | .text:08048478 call _putchar | ||
+ | .text:0804847D mov dword ptr [esp], '0' ; c | ||
+ | .text:08048484 call _putchar | ||
+ | .text:08048489 mov dword ptr [esp], '0' ; c | ||
+ | .text:08048490 call _putchar | ||
+ | .text:08048495 mov dword ptr [esp], 'd' ; c | ||
+ | .text:0804849C call _putchar | ||
+ | .text:080484A1 mov dword ptr [esp], '_' ; c | ||
+ | .text:080484A8 call _putchar | ||
+ | .text:080484AD mov dword ptr [esp], 'B' ; c | ||
+ | .text:080484B4 call _putchar | ||
+ | .text:080484B9 mov dword ptr [esp], '0' ; c | ||
+ | .text:080484C0 call _putchar | ||
+ | .text:080484C5 mov eax, offset format ; "%c\n" | ||
+ | .text:080484CA mov dword ptr [esp+4], 'y' | ||
+ | .text:080484D2 mov [esp], eax ; format | ||
+ | .text:080484D5 call _printf | ||
+ | .text:080484DA mov eax, 0 | ||
+ | .text:080484DF leave | ||
+ | .text:080484E0 retn | ||
+ | .text:080484E0 main endp | ||
+ | </code> | ||
+ | |||
+ | Le code appelle plusieurs putchar(), puis un printf() pour afficher le flag, « **G00d_B0y** » |