Function at 0x40c290
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x60
call fcn.00405380
mov dword [esp + 4], 0x40e652
mov dword [esp], 2
call sub.msvcrt.dll_setlocale
lea eax, [ebp + 0xc]
mov dword [esp + 4], eax
lea eax, [ebp + 8]
mov dword [esp], eax
call fcn.00403a70
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x40d000
mov dword [esp + 8], 0x40e653
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00404c30
cmp eax, 0xffffffff
je 0x40c47a
sub eax, 0x68
cmp eax, 0x33
ja case.0x40c306.105
jmp dword [eax*4 + 0x40e6f8]
mov eax, dword [0x413144]
call fcn.00401410
test eax, eax
mov dword [0x40d098], eax
jns 0x40c2c7
mov eax, 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x413144]
call fcn.00401410
test eax, eax
mov dword [0x40d09c], eax
jns 0x40c2c7
jmp 0x40c320
mov eax, dword [0x413144]
call fcn.00401610
test eax, eax
mov dword [0x40d0a0], eax
jns 0x40c2c7
jmp 0x40c320
mov eax, dword [0x413144]
call fcn.00401610
test eax, eax
mov dword [0x40d0a4], eax
jns 0x40c2c7
jmp 0x40c320
mov eax, dword [0x413144]
call fcn.00401530
test eax, eax
mov dword [0x40d0a8], eax
js 0x40c320
cmp eax, 6
je 0x40c473
jle 0x40c46a
cmp eax, 0x3e
je 0x40c43c
jl 0x40c43c
sub eax, 0xb4
cmp eax, 1
ja 0x40c43c
mov eax, 2
jmp 0x40c441
mov eax, dword [0x413144]
call fcn.00401530
test eax, eax
mov dword [0x40d0ac], eax
js 0x40c320
cmp eax, 6
je 0x40c463
jle 0x40c45a
cmp eax, 0x3e
je 0x40c44b
jl 0x40c44b
sub eax, 0xb4
cmp eax, 1
ja 0x40c44b
mov eax, 2
jmp 0x40c450
mov eax, dword [str.elfedit]
mov dword [esp], eax
call fcn.00402250
jmp 0x40c2c7
mov eax, dword [sym.imp.msvcrt.dll__iob]
xor edx, edx
add eax, 0x20
call fcn.004014a0
cmp dword [0x40d0a0], 0xffffffff
jne 0x40c48f
cmp dword [0x40d098], 0xffffffff
jne 0x40c48f
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, 1
add eax, 0x40
call fcn.004014a0
mov eax, 3
mov dword [0x40d090], eax
jmp 0x40c2c7
mov eax, 3
mov dword [0x40d094], eax
jmp 0x40c2c7
test eax, eax
je 0x40c44b
cmp eax, 3
jne 0x40c44b
mov eax, 1
jmp 0x40c450
test eax, eax
je 0x40c43c
cmp eax, 3
jne 0x40c43c
mov eax, 1
jmp 0x40c441
mov eax, dword [0x40d0c8]
mov edx, dword [ebp + 8]
cmp eax, edx
je case.0x40c306.105
cmp dword [0x40d0a8], 0xffffffff
je 0x40c418
xor ebx, ebx
cmp eax, edx
lea edi, [esp + 0x3c]
jl 0x40c4c3
jmp 0x40c5f5
mov dword [esp + 4], esi
mov dword [esp], str._s_is_not_an_ordinary_file_n
call fcn.004022f0
mov esi, 1
or ebx, esi
mov eax, dword [0x40d0c8]
cmp eax, dword [ebp + 8]
jge 0x40c5f5
lea edx, [eax + 1]
mov dword [0x40d0c8], edx
mov edx, dword [ebp + 0xc]
mov esi, dword [edx + eax*4]
mov dword [esp + 4], edi
mov dword [esp], esi
call sub.msvcrt.dll__stat
test eax, eax
js 0x40c5bf
movzx eax, word [esp + 0x42]
and ax, 0xf000
cmp ax, 0x8000
jne 0x40c49e
mov dword [esp + 4], 0x40e604
mov dword [esp], esi
call sub.msvcrt.dll_fopen
test eax, eax
mov dword [esp + 0x2c], eax
je 0x40c642
mov eax, dword [esp + 0x2c]
mov dword [esp + 8], 1
mov dword [esp + 4], 8
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fread
sub eax, 1
jne 0x40c599
mov dword [esp + 8], 8
mov dword [esp + 4], str.__arch__n
mov dword [esp], edi
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x40c62e
mov dword [esp + 8], 8
mov dword [esp + 4], str.__thin__n
mov dword [esp], edi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x40c5fc
mov edx, dword [esp + 0x2c]
mov eax, esi
mov ecx, 1
call fcn.00401e70
mov esi, eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
jmp 0x40c4b3
mov dword [esp + 4], esi
mov dword [esp], str._s:_Failed_to_read_files_magic_number_n
mov esi, 1
call fcn.004022f0
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
jmp 0x40c4b3
call sub.msvcrt.dll__errno
cmp dword [eax], 2
je 0x40c65c
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_strerror
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], str.Could_not_locate__s.__System_error_message:__s_n
call fcn.004022f0
jmp 0x40c4ae
mov eax, ebx
jmp 0x40c325
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_rewind
mov edx, dword [esp + 0x2c]
mov eax, esi
mov dword [0x413114], 0
mov dword [0x413110], 0
call fcn.004016a0
mov esi, eax
jmp 0x40c588
mov edx, dword [esp + 0x2c]
mov eax, esi
xor ecx, ecx
call fcn.00401e70
mov esi, eax
jmp 0x40c588
mov dword [esp + 4], esi
mov dword [esp], str.Input_file__s_is_not_readable_n
mov esi, 1
call fcn.004022f0
jmp 0x40c4b3
mov dword [esp + 4], esi
mov dword [esp], str._s:_No_such_file_n
call fcn.004022f0
jmp 0x40c4ae