Function at 0x40c210
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x19c
mov al, byte [0x415e14]
push ebx
push ebp
push esi
push edi
mov byte [esp + 0x80], al
mov ecx, 0x4a
xor eax, eax
lea edi, [esp + 0x81]
mov edx, dword [0x413bf4]
rep stosd dword es:[edi], eax
mov ecx, dword [0x413bf0]
mov ebp, dword [esp + 0x1b0]
mov dword [esp + 0x10], ecx
mov ecx, dword [0x413bec]
stosw word es:[edi], ax
mov ebx, dword [sym.imp.MSVCRT.dll__lseek]
mov dword [esp + 0x1f], ecx
xor ecx, ecx
mov dword [esp + 0x15], edx
mov edx, dword [0x413be8]
mov word [esp + 0x2b], cx
stosb byte es:[edi], al
mov eax, dword [0x413be4]
push ecx
mov dword [esp + 0x1e], eax
mov ax, word [0x415d4c]
push ecx
push ebp
mov byte [esp + 0x20], 0
mov byte [esp + 0x25], 0
mov byte [esp + 0x2a], 0
mov byte [esp + 0x2f], 0
mov dword [esp + 0x30], edx
mov byte [esp + 0x34], 0
mov word [esp + 0x35], ax
mov byte [esp + 0x39], cl
call ebx
add esp, 0xc
cmp eax, 0xffffffff
je 0x40c4a9
lea edx, [esp + 0x30]
push 0x1e
push edx
push ebp
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, 0x1e
jne 0x40c4a9
cmp byte [esp + 0x30], 0x50
jne 0x40c4a9
cmp byte [esp + 0x31], 0x4b
jne 0x40c4a9
mov ecx, 7
lea esi, [esp + 0x30]
mov edi, 0x4181c8
mov al, byte [esp + 0x36]
rep movsd dword es:[edi], dword [esi]
test al, 1
movsw word es:[edi], word [esi]
je 0x40c4a9
mov ecx, dword [esp + 0x42]
mov eax, dword [esp + 0x46]
sub ecx, eax
cmp ecx, 0xc
jne 0x40c4a9
cmp eax, 0x4c00
jb 0x40c4a9
cmp eax, 0x6400
ja 0x40c4a9
cmp word [esp + 0x38], 0
jne 0x40c4a9
cmp word [esp + 0x4a], 0x12c
jae 0x40c3f4
push 0
push 0x1e
push ebp
call ebx
add esp, 0xc
cmp eax, 0xffffffff
je 0x40c4a9
mov ecx, 0x4b
xor eax, eax
lea edi, [esp + 0x80]
xor edx, edx
mov dx, word [0x4181e2]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x80]
push edx
push eax
push ebp
call dword [sym.imp.MSVCRT.dll__read]
xor ecx, ecx
add esp, 0xc
mov cx, word [0x4181e2]
cmp eax, ecx
jne 0x40c4a9
lea edx, [esp + 0x80]
push 0x2e
push edx
call dword [sym.imp.MSVCRT.dll_strrchr]
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40c3ee
mov al, byte [esp + 0x10]
inc ebx
xor edi, edi
test al, al
je 0x40c3df
lea eax, [esp + 0x10]
lea esi, [esp + 0x10]
push ebx
push eax
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
je 0x40c3df
mov cl, byte [esi + 5]
add esi, 5
inc edi
mov eax, esi
test cl, cl
jne 0x40c3c3
lea eax, [esp + edi + 0x10]
lea ecx, [eax + edi*4]
test ecx, ecx
je 0x40c4a9
mov ebx, dword [sym.imp.MSVCRT.dll__lseek]
mov edx, dword [0x4181e4]
mov ecx, dword [0x4181da]
and edx, 0xffff
xor eax, eax
mov ax, word [0x4181e2]
add ecx, edx
push 0
lea esi, [eax + ecx + 0x1e]
push esi
push ebp
call ebx
add esp, 0xc
cmp eax, 0xffffffff
je 0x40c499
mov edi, dword [sym.imp.MSVCRT.dll__read]
push 0x2e
push 0x418198
push ebp
call edi
add esp, 0xc
cmp eax, 0x2e
jb 0x40c499
mov edx, dword [0x4181b8]
mov ecx, dword [0x4181b4]
xor eax, eax
and edx, 0xffff
mov ax, word [0x4181b6]
and ecx, 0xffff
add eax, esi
push 0
add eax, edx
lea eax, [ecx + eax + 0x2e]
push eax
push ebp
call ebx
add esp, 0xc
cmp eax, 0xffffffff
je 0x40c4a9
push 0x16
push 0x418180
push ebp
call edi
add esp, 0xc
cmp eax, 0x16
jne 0x40c4a9
mov eax, 1
cmp word [0x418188], ax
jne 0x40c4a9
cmp word [0x41818a], ax
jne 0x40c4a9
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x19c
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x19c
ret