Function at 0x4022c4
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24c
push ebx
push esi
push edi
call fcn.0040278a
and dword [ebp - 8], 0
and dword [ebp - 4], 0
cmp byte [0x4062e2], 0
mov ebx, eax
je 0x4022f3
call fcn.00402cab
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
mov edi, dword [ebp + 8]
or edx, 0xffffffff
mov ecx, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea esi, [ebp - 0x134]
mov eax, ecx
mov dword [ebp + 8], esi
mov esi, edi
mov edi, dword [ebp + 8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
push 0x405cf4
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x134]
mov ecx, edx
repne scasb al, byte es:[edi]
dec edi
mov esi, 0x405ce0
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, ebx
mov ecx, edx
repne scasb al, byte es:[edi]
lea esi, [ebp - 0x134]
not ecx
mov eax, esi
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, eax
mov ecx, edx
xor eax, eax
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x134]
mov ecx, edx
repne scasb al, byte es:[edi]
dec edi
mov esi, 0x405ce8
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x134]
push eax
movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0xc], eax
test eax, eax
pop ecx
jne 0x4023ad
lea eax, [ebp - 0x134]
push 1
push eax
push 0x405cf8
call fcn.00402d4a
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push dword [ebp - 0xc]
lea eax, [ebp - 0x24c]
push 0x118
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
je 0x402616
and dword [ebp - 0x10], 0
mov ebx, dword [sym.imp.MSVCRT.dll_fprintf]
or dword [ebp + 8], 0xffffffff
inc dword [ebp - 4]
cmp byte [ebp - 0x24c], 0x23
je 0x4025f6
cmp byte [ebp - 0x24c], 0x2d
je 0x402411
lea eax, [ebp - 0x134]
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push dword [ebp - 4]
add eax, 0x40
push 0x405d14
push eax
call ebx
add esp, 0x10
mov eax, dword [ebp - 8]
cmp eax, dword [0x4062ec]
jl 0x402423
push eax
call fcn.0040265a
pop ecx
lea edi, [ebp - 0x24c]
or ecx, 0xffffffff
xor eax, eax
push dword [0x405e60]
repne scasb al, byte es:[edi]
not ecx
dec ecx
and byte [ebp + ecx - 0x24d], al
lea eax, [ebp - 0x24c]
push eax
call dword [sym.imp.MSVCRT.dll_strcspn]
cmp byte [ebp + eax - 0x24c], 0
lea esi, [ebp + eax - 0x24c]
pop ecx
pop ecx
jne 0x402474
lea eax, [ebp - 0x134]
push eax
push dword [ebp - 4]
push 0x405d40
jmp 0x402508
and byte [esi], 0
push dword [0x405e60]
inc esi
push esi
call dword [sym.imp.MSVCRT.dll_strspn]
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
jne 0x40249f
lea eax, [ebp - 0x134]
push eax
push dword [ebp - 4]
push 0x405d70
jmp 0x402508
mov edi, dword [sym.imp.MSVCRT.dll_strncmp]
push 5
push 0x405da0
push esi
call edi
add esp, 0xc
test eax, eax
je 0x402584
push 0xa
push 0x405da8
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x402533
push dword [0x405e60]
mov edi, dword [sym.imp.MSVCRT.dll_strcspn]
push esi
call edi
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
je 0x4024f9
push dword [0x405e60]
push esi
call dword [sym.imp.MSVCRT.dll_strspn]
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
jne 0x402518
lea eax, [ebp - 0x134]
push eax
push dword [ebp - 4]
push 0x405db4
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push eax
call ebx
add esp, 0x10
jmp 0x402588
push dword [0x405e60]
mov dword [ebp - 0x1c], esi
push esi
call edi
and byte [eax + esi], 0
pop ecx
pop ecx
mov dword [ebp + 8], 1
jmp 0x402588
push 4
push 0x405de4
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x40254d
mov dword [ebp + 8], 2
jmp 0x402588
push 5
push 0x405dec
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x402567
mov dword [ebp + 8], 3
jmp 0x402588
lea eax, [ebp - 0x134]
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push dword [ebp - 4]
add eax, 0x40
push 0x405df4
push eax
call ebx
add esp, 0x10
and dword [ebp + 8], 0
cmp byte [0x4062e2], 0
je 0x4025a9
lea eax, [ebp - 0x24c]
push eax
push dword [ebp - 8]
push 0x405e24
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
cmp dword [ebp + 8], 0xffffffff
je 0x4025f6
mov edi, dword [sym.imp.MSVCRT.dll__strdup]
lea eax, [ebp - 0x24c]
push eax
call edi
mov esi, dword [ebp - 0x10]
pop ecx
mov ecx, dword [0x4062e4]
mov dword [esi + ecx], eax
mov ecx, dword [0x4062e4]
mov eax, dword [ebp + 8]
cmp eax, 1
mov dword [esi + ecx + 4], eax
jne 0x4025ed
push dword [ebp - 0x1c]
call edi
pop ecx
mov ecx, dword [0x4062e4]
mov dword [esi + ecx + 8], eax
inc dword [ebp - 8]
add esi, 0xc
mov dword [ebp - 0x10], esi
push dword [ebp - 0xc]
lea eax, [ebp - 0x24c]
push 0x118
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x4023d7
push dword [ebp - 0xc]
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [ebp - 8]
cmp byte [0x4062e2], 0
pop ecx
mov dword [0x4062e8], esi
je 0x402653
call fcn.00402cab
sub eax, dword [ebp - 0x18]
sbb edx, dword [ebp - 0x14]
push edx
push eax
call fcn.00402cf1
push eax
push 0x405e3c
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret