Function at 0x40c802
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
xor ebx, ebx
push edi
mov edi, dword [ebp + 0xc]
push ebx
push 1
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
mov byte [edi + 0x1c], bl
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x40ca4c
push esi
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x14], ebx
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 8]
push 4
push eax
push dword [ebp + 8]
mov dword [ebp - 8], ebx
mov dword [ebp - 4], ebx
mov dword [ebp + 0xc], ebx
call esi
test eax, eax
je 0x40ca31
cmp dword [ebp + 0xc], 4
jne 0x40ca31
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 4]
push 4
push eax
push dword [ebp + 8]
call esi
test eax, eax
je 0x40ca31
cmp dword [ebp + 0xc], 4
jne 0x40ca31
push dword [ebp - 4]
call fcn.0040c7d2
add dword [ebp - 0x14], eax
cmp dword [ebp - 8], 0x504f5250
pop ecx
mov dword [ebp - 4], eax
je 0x40c95e
cmp dword [ebp - 8], 0x544e4f43
jne 0x40ca1a
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x18]
push 2
push eax
push dword [ebp + 8]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
call esi
cmp word [ebp - 0x18], bx
jne 0x40ca1a
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0xc]
push 2
push eax
push dword [ebp + 8]
call esi
push dword [ebp - 0xc]
call fcn.0040c7f7
cmp ax, bx
pop ecx
mov dword [ebp - 0xc], eax
jbe 0x40c915
cmp ax, word [edi + 4]
jae 0x40c915
movzx eax, ax
lea ecx, [ebp + 0xc]
push ebx
push ecx
push eax
push dword [edi]
push dword [ebp + 8]
call esi
or byte [edi + 0x1c], 1
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x10]
push 2
push eax
push dword [ebp + 8]
call esi
push dword [ebp - 0x10]
call fcn.0040c7f7
cmp ax, bx
pop ecx
mov dword [ebp - 0x10], eax
jbe 0x40ca1a
cmp ax, word [edi + 0xc]
jae 0x40ca1a
movzx eax, ax
lea ecx, [ebp + 0xc]
push ebx
push ecx
push eax
push dword [edi + 8]
push dword [ebp + 8]
call esi
or byte [edi + 0x1c], 2
jmp 0x40ca1a
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x18]
push 2
push eax
push dword [ebp + 8]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0xc], ebx
call esi
cmp word [ebp - 0x18], bx
jne 0x40ca1a
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x20]
push 4
push eax
push dword [ebp + 8]
call esi
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x10]
push 4
push eax
push dword [ebp + 8]
call esi
push dword [ebp - 0x10]
call fcn.0040c7d2
pop ecx
mov dword [ebp - 0x10], eax
mov dword [edi + 0x18], eax
lea eax, [ebp + 0xc]
or byte [edi + 0x1c], 0x10
push ebx
push eax
lea eax, [ebp - 0x24]
push 4
push eax
push dword [ebp + 8]
call esi
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x28]
push 4
push eax
push dword [ebp + 8]
call esi
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x2c]
push 4
push eax
push dword [ebp + 8]
call esi
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0xc]
push 4
push eax
push dword [ebp + 8]
call esi
push dword [ebp - 0xc]
call fcn.0040c7d2
pop ecx
xor edx, edx
mov ecx, 0x3e8
div ecx
or byte [edi + 0x1c], 8
mov word [edi + 0x16], ax
push ebx
push ebx
push dword [ebp - 0x14]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40c841
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [edi + 0x1c], bl
pop esi
je 0x40ca47
mov dword [ebp - 0x1c], 1
mov eax, dword [ebp - 0x1c]
jmp 0x40ca4e
xor eax, eax
pop edi
pop ebx
leave
ret