.text:08048497 ; int __cdecl main(int argc, const char **argv, const char **envp) .text:08048497 public main .text:08048497 main proc near ; DATA XREF: _start+17o .text:08048497 .text:08048497 var_8 = dword ptr -8 .text:08048497 argc = dword ptr 8 .text:08048497 argv = dword ptr 0Ch .text:08048497 envp = dword ptr 10h .text:08048497 .text:08048497 push ebp .text:08048498 mov ebp, esp .text:0804849A push edi .text:0804849B sub esp, 8 .text:0804849E mov eax, [ebp+argv] .text:080484A1 add eax, 4 .text:080484A4 mov eax, [eax] .text:080484A6 mov [ebp+var_8], 0FFFFFFFFh .text:080484AD mov edx, eax .text:080484AF mov eax, 0 .text:080484B4 mov ecx, [ebp+var_8] .text:080484B7 mov edi, edx .text:080484B9 repne scasb .text:080484BB mov eax, ecx .text:080484BD not eax .text:080484BF sub eax, 1 .text:080484C2 cmp eax, 100h .text:080484C7 jbe short loc_80484EA .text:080484C9 mov eax, offset format ; "attepted buffer overflow" .text:080484CE mov [esp], eax ; format .text:080484D1 call _printf .text:080484D6 mov eax, ds:stdout@@GLIBC_2_0 .text:080484DB mov [esp], eax ; stream .text:080484DE call _fflush .text:080484E3 mov eax, 0FFFFFFFFh .text:080484E8 jmp short loc_80484FF .text:080484EA ; --------------------------------------------------------------------------- .text:080484EA .text:080484EA loc_80484EA: ; CODE XREF: main+30j .text:080484EA mov eax, [ebp+argv] .text:080484ED add eax, 4 .text:080484F0 mov eax, [eax] .text:080484F2 mov [esp], eax ; src .text:080484F5 call foo .text:080484FA mov eax, 0 .text:080484FF .text:080484FF loc_80484FF: ; CODE XREF: main+51j .text:080484FF add esp, 8 .text:08048502 pop edi .text:08048503 pop ebp .text:08048504 retn .text:08048504 main endp |