Function at 0x40c900
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x46b880]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ecx, ecx
mov dword [ebp - 8], ecx
test edi, edi
je 0x40cb9b
cmp dword [edi + 0x214], ecx
je 0x40cb9b
mov eax, dword [edi + 0xa04]
mov ebx, dword [edi + 0xa00]
sub eax, ebx
mov esi, dword [ebp + 0xc]
sar eax, 2
cmp esi, eax
jae 0x40cb9b
mov ebx, dword [ebx + esi*4]
test ebx, ebx
je 0x40cb9b
push 0xffffffffffffffff
mov dword [ebp - 0x1c], ecx
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor ecx, ecx
cmp eax, 0xffffffff
mov eax, dword [ebx]
setne cl
mov dword [ebp - 0xc], ecx
test eax, eax
jns 0x40c9c4
and eax, 0x7fffffff
cmp dword [edi + 0xa0c], 0
mov dword [ebp - 0x18], eax
je 0x40c9a9
test ecx, ecx
je 0x40c993
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push edi
call fcn.0040c52d
and dword [edi + 0xa0c], 0
and dword [ebp - 0xc], 0
pop ecx
pop ecx
jmp 0x40c9ba
push esi
push edi
call fcn.0040c65e
push esi
push edi
call fcn.0040cdea
add esp, 0x10
push 3
push dword [ebp - 0x18]
jmp 0x40cb7b
mov eax, dword [ebx + 0x38]
test al, 1
je 0x40cab3
xor eax, eax
push eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebx + 0x10]
push eax
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov edx, dword [ebp - 0x18]
cmp edx, 0xc
jae 0x40c9fa
xor eax, eax
mov dword [ebp - 0x10], 1
test eax, eax
je 0x40ca67
add edx, 0xfffffff4
lea esi, [ebx + 0x254]
mov ecx, edx
mov dword [ebp - 0x14], edx
neg ecx
lea eax, [esi + 0xc]
sbb ecx, ecx
and ecx, eax
cmp dword [esi], 0x8000
mov dword [ebp - 0x10], ecx
jne 0x40ca3c
test byte [edi + 0x210], 1
jne 0x40ca3c
push edi
push edx
push ecx
push esi
push ebx
call fcn.0040c5de
mov ecx, dword [ebp - 0x10]
add esp, 0x14
mov edx, dword [ebp - 0x14]
push dword [edi + 0x218]
push edx
push ecx
push esi
mov esi, dword [edi + 0x214]
mov ecx, esi
push ebx
call dword [0x44d42c]
call esi
add esp, 0x14
test eax, eax
jne 0x40cadc
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x10], 2
cmp dword [edi + 0xa0c], 0
mov eax, dword [ebx]
mov dword [ebp - 0x14], eax
je 0x40ca9a
cmp dword [ebp - 0xc], 0
je 0x40ca84
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
push edi
call fcn.0040c52d
and dword [edi + 0xa0c], 0
and dword [ebp - 0xc], 0
pop ecx
pop ecx
jmp 0x40caab
push esi
push edi
call fcn.0040c65e
push esi
push edi
call fcn.0040cdea
add esp, 0x10
push dword [ebp - 0x10]
jmp 0x40cb78
push 0x218
or eax, 1
lea esi, [ebx + 0x3c]
push 0
push esi
mov dword [ebx + 0x38], eax
call fcn.00425c30
push esi
push dword [ebx + 4]
call fcn.0040c812
push ebx
push edi
call fcn.0040cf65
add esp, 0x1c
mov eax, dword [ebx + 0x38]
lea ecx, [ebx + 0x254]
test al, 2
je 0x40caef
xor eax, 2
mov dword [ebx + 0x38], eax
lea eax, [ebx + 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0xa000
push ecx
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40cb1b
cmp dword [ebp - 0x1c], 0xc
jb 0x40cb2c
push dword [ebx + 0x20]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x40cb87
or dword [ebx + 0x38], 2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x40cb87
cmp dword [edi + 0xa0c], 0
mov eax, dword [ebx]
mov dword [ebp - 0x14], eax
je 0x40cb62
cmp dword [ebp - 0xc], 0
je 0x40cb49
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [ebp + 0xc]
push esi
push edi
call fcn.0040c52d
and dword [edi + 0xa0c], 0
and dword [ebp - 0xc], 0
pop ecx
pop ecx
jmp 0x40cb76
mov esi, dword [ebp + 0xc]
push esi
push edi
call fcn.0040c65e
push esi
push edi
call fcn.0040cdea
add esp, 0x10
push 1
push dword [ebp - 0x14]
push edi
mov dword [ebp - 8], eax
call fcn.0040cfc0
add esp, 0xc
cmp dword [ebp - 0xc], 0
je 0x40cb96
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 8]
jmp 0x40cb9e
or eax, 0xffffffff
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00423dc5
mov esp, ebp
pop ebp
ret