Function at 0x4028c9
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x244
and dword [ebp - 8], 0
and dword [ebp - 4], 0
cmp byte [0x40ac72], 0
je 0x4028ee
call fcn.004032a5
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], edx
push ebx
push esi
or ebx, 0xffffffff
push edi
mov edi, dword [ebp + 8]
mov ecx, ebx
xor eax, eax
lea edx, [ebp - 0x12c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x40910c
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [ebp - 0x12c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x12c]
mov ecx, ebx
repne scasb al, byte es:[edi]
dec edi
mov esi, 0x4090f8
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, dword [ebp + 0xc]
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
mov ecx, ebx
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x12c]
mov ecx, ebx
repne scasb al, byte es:[edi]
dec edi
mov esi, 0x409100
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x12c]
push eax
movsb byte es:[edi], byte [esi]
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp + 8], eax
test eax, eax
pop ecx
jne 0x4029b0
cmp byte [ebp + 0x10], al
jne 0x4029a9
lea eax, [ebp - 0x12c]
push 1
push eax
push 0x409110
call fcn.0040334c
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, ebx
jmp 0x402c7e
push dword [ebp + 8]
lea eax, [ebp - 0x244]
push 0x118
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
je 0x402c3f
and dword [ebp + 0xc], 0
mov ebx, dword [sym.imp.MSVCRT.dll_fprintf]
or dword [ebp + 0x10], 0xffffffff
inc dword [ebp - 4]
cmp byte [ebp - 0x244], 0x23
je 0x402c1f
cmp byte [ebp - 0x244], 0x2d
je 0x402a14
lea eax, [ebp - 0x12c]
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push dword [ebp - 4]
add eax, 0x40
push 0x40912c
push eax
call ebx
add esp, 0x10
mov eax, dword [ebp - 8]
cmp eax, dword [0x40ac7c]
jl 0x402a26
push eax
call fcn.00402c83
pop ecx
lea edi, [ebp - 0x244]
or ecx, 0xffffffff
xor eax, eax
push dword [0x408068]
repne scasb al, byte es:[edi]
not ecx
dec ecx
and byte [ebp + ecx - 0x245], al
lea eax, [ebp - 0x244]
push eax
call dword [sym.imp.MSVCRT.dll_strcspn]
cmp byte [ebp + eax - 0x244], 0
lea esi, [ebp + eax - 0x244]
pop ecx
pop ecx
jne 0x402a77
lea eax, [ebp - 0x12c]
push eax
push dword [ebp - 4]
push 0x409158
jmp 0x402b0b
and byte [esi], 0
push dword [0x408068]
inc esi
push esi
call dword [sym.imp.MSVCRT.dll_strspn]
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
jne 0x402aa2
lea eax, [ebp - 0x12c]
push eax
push dword [ebp - 4]
push 0x409188
jmp 0x402b0b
mov edi, dword [sym.imp.MSVCRT.dll_strncmp]
push 5
push 0x4091b8
push esi
call edi
add esp, 0xc
test eax, eax
je 0x402b87
push 0xa
push 0x4091c0
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x402b36
push dword [0x408068]
mov edi, dword [sym.imp.MSVCRT.dll_strcspn]
push esi
call edi
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
je 0x402afc
push dword [0x408068]
push esi
call dword [sym.imp.MSVCRT.dll_strspn]
add esi, eax
pop ecx
pop ecx
cmp byte [esi], 0
jne 0x402b1b
lea eax, [ebp - 0x12c]
push eax
push dword [ebp - 4]
push 0x4091cc
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push eax
call ebx
add esp, 0x10
jmp 0x402b8b
push dword [0x408068]
mov dword [ebp - 0xc], esi
push esi
call edi
and byte [eax + esi], 0
pop ecx
pop ecx
mov dword [ebp + 0x10], 1
jmp 0x402b8b
push 4
push 0x4091fc
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x402b50
mov dword [ebp + 0x10], 2
jmp 0x402b8b
push 5
push 0x409204
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x402b6a
mov dword [ebp + 0x10], 3
jmp 0x402b8b
lea eax, [ebp - 0x12c]
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push dword [ebp - 4]
add eax, 0x40
push 0x40920c
push eax
call ebx
add esp, 0x10
and dword [ebp + 0x10], 0
cmp byte [0x40ac72], 0
je 0x402bac
lea eax, [ebp - 0x244]
push eax
push dword [ebp - 8]
push 0x40923c
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
cmp dword [ebp + 0x10], 0xffffffff
je 0x402c1f
mov edi, dword [sym.imp.MSVCRT.dll__strdup]
lea eax, [ebp - 0x244]
push eax
call edi
mov esi, dword [ebp + 0xc]
pop ecx
mov ecx, dword [0x40ac74]
mov dword [esi + ecx], eax
mov ecx, dword [0x40ac74]
mov eax, dword [ebp + 0x10]
mov dword [esi + ecx + 4], eax
dec eax
jne 0x402c16
push dword [ebp - 0xc]
call edi
pop ecx
mov ecx, dword [0x40ac74]
mov dword [esi + ecx + 8], eax
cmp byte [0x40ac72], 0
je 0x402c16
mov eax, dword [0x40ac74]
add eax, esi
push dword [eax + 8]
push 0x409254
push dword [eax]
push 0x409264
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0x10
inc dword [ebp - 8]
add esi, 0xc
mov dword [ebp + 0xc], esi
push dword [ebp + 8]
lea eax, [ebp - 0x244]
push 0x118
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
add esp, 0xc
test eax, eax
jne 0x4029da
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_fclose]
mov esi, dword [ebp - 8]
cmp byte [0x40ac72], 0
pop ecx
mov dword [0x40ac78], esi
je 0x402c7c
call fcn.004032a5
sub eax, dword [ebp - 0x14]
sbb edx, dword [ebp - 0x10]
push edx
push eax
call fcn.004032eb
push eax
push 0x40928c
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret