Function at 0x406be0
Capabilities:
Read file on windows
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 4], edi
mov edi, eax
lea eax, [ebp - 0x10]
mov dword [esp], eax
mov eax, edi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], esi
mov esi, edx
call fcn.00404810
mov ebx, eax
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x406ce4
cmp ebx, 2
jbe 0x406d40
cmp ebx, 3
jne 0x406e7e
mov dword [ebp - 0x1c], 0
mov edx, esi
mov eax, edi
mov dword [esp], 0
call fcn.00404810
mov ebx, eax
xor eax, eax
cmp ebx, 0xffffffff
je 0x406d2b
mov dword [esp], 0
mov edx, esi
mov eax, edi
call fcn.00404810
mov esi, eax
xor eax, eax
cmp esi, 0xffffffff
je 0x406d2b
mov dword [esp], ebx
call fcn.0040fee0
mov dword [ebp - 0x18], eax
test eax, eax
je 0x406e0b
mov dword [esp + 4], esi
mov dword [esp], 0
call fcn.0040f5f0
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x406e0b
mov dword [esp + 0xc], edi
mov eax, 1
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.cygwin1.dll_fread
test eax, eax
je 0x406e0b
mov dword [esp + 0xc], esi
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call fcn.00410470
test eax, eax
je 0x406e0b
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call fcn.0040ffb0
mov edx, dword [ebp - 0x1c]
jmp 0x406d24
xor eax, eax
cmp ebx, 0xffffffff
je 0x406d30
mov dword [esp + 4], ebx
mov dword [esp], 0
call fcn.0040f5f0
test ebx, ebx
mov esi, eax
je 0x406d22
mov dword [esp + 0xc], edi
mov edi, 1
mov dword [esp + 8], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.cygwin1.dll_fread
test eax, eax
je 0x406e2d
mov edx, esi
xor eax, eax
call fcn.00403a20
call fcn.00406ae0
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x406ddc
cmp ebx, 1
je 0x406e3c
cmp ebx, 2
jne 0x406e7e
mov dword [esp + 0xc], edi
mov ecx, 4
lea eax, [ebp - 0x14]
mov dword [esp + 4], ecx
mov ebx, 1
mov dword [esp + 8], ebx
mov dword [esp], eax
call sub.cygwin1.dll_fread
xor edx, edx
test eax, eax
je 0x406dd0
movzx eax, byte [ebp - 0x13]
movzx edx, byte [ebp - 0x14]
shl eax, 8
or edx, eax
movzx eax, byte [ebp - 0x12]
shl eax, 0x10
or edx, eax
movzx eax, byte [ebp - 0x11]
shl eax, 0x18
or edx, eax
mov ebx, edx
mov esi, edx
call fcn.0040f6d0
mov dword [esp], eax
mov edx, str._lld
sar esi, 0x1f
mov dword [esp + 4], edx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], esi
call fcn.0040f9a0
mov edx, eax
xor eax, eax
call fcn.00403a20
mov edx, eax
mov eax, edx
call fcn.00406ae0
jmp 0x406d30
mov dword [esp + 0xc], edi
mov eax, 1
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
lea eax, [ebp - 0x14]
mov dword [esp], eax
call sub.cygwin1.dll_fread
xor edx, edx
test eax, eax
je 0x406dd0
movsx ebx, byte [ebp - 0x14]
mov esi, ebx
jmp 0x406da4
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call fcn.0040ffb0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call fcn.0040f760
xor eax, eax
call fcn.00406ae0
jmp 0x406d30
mov dword [esp], esi
call fcn.0040f760
xor eax, eax
jmp 0x406d30
mov dword [esp + 0xc], edi
lea eax, [ebp - 0x14]
mov edi, 1
mov dword [esp + 8], edi
mov esi, 2
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.cygwin1.dll_fread
xor edx, edx
test eax, eax
je 0x406dd0
movzx eax, byte [ebp - 0x13]
movzx edx, byte [ebp - 0x14]
shl eax, 8
or edx, eax
movsx ebx, dx
mov esi, ebx
jmp 0x406da4
mov eax, str.0_0
call fcn.004039e0
mov dword [esp], 1
call sub.cygwin1.dll_exit
lea esi, [esi]
lea edi, [edi]