Function at 0x401590
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 8], 0
cmp dword [edi + 0x140], 0xffffffff
jne 0x4015cb
mov eax, 6
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401dfc
mov esp, ebp
pop ebp
ret
push dword [edi + 0x154]
lea ebx, [edi + 0x144]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push ebx
lea eax, [ebp - 8]
mov dword [ebx + 8], 0
push eax
push 0x20
push edi
mov dword [ebx + 0xc], 0
push dword [edi + 0x140]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401619
mov eax, 0x1e
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401dfc
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 0x1c]
mov eax, dword [edi + 0x10]
add edx, 0x20
mov ecx, dword [edi + 0x18]
shl eax, 0xa
add ecx, edx
cdq
mov esi, eax
mov dword [ebp - 0xc], ecx
mov eax, edx
mov dword [ebp - 0x18], esi
push eax
push esi
push 0
push ecx
mov dword [ebp - 0x14], eax
call fcn.0040e400
mov ecx, eax
or ecx, edx
je 0x40165a
sub esi, eax
mov eax, dword [ebp - 0x14]
sbb eax, edx
add esi, dword [ebp - 0xc]
adc eax, 0
mov dword [ebp - 0xc], eax
jmp 0x401664
mov esi, dword [ebp - 0xc]
mov dword [ebp - 0xc], 0
push dword [ebx + 0x10]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0xc], eax
lea eax, [ebp - 8]
push ebx
push eax
push 0x18
lea eax, [edi + 0x20]
mov dword [ebx + 8], esi
push eax
push dword [edi + 0x140]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4016a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401dfc
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x30]
xor ecx, ecx
push dword [ebp - 0x14]
add eax, esi
mov esi, dword [ebp - 0x18]
push esi
adc ecx, dword [ebp - 0xc]
add eax, 0x18
mov dword [ebp - 0xc], eax
adc ecx, 0
push ecx
push eax
mov dword [ebp - 0x10], ecx
call fcn.0040e400
mov ecx, eax
or ecx, edx
je 0x4016e4
sub esi, eax
mov eax, dword [ebp - 0x14]
sbb eax, edx
add esi, dword [ebp - 0xc]
adc eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
jmp 0x4016ed
mov esi, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0xc], ecx
push dword [ebx + 0x10]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xc]
mov dword [ebx + 0xc], eax
lea eax, [ebp - 8]
push ebx
push eax
push 0xf8
lea eax, [edi + 0x38]
mov dword [ebx + 8], esi
push eax
push dword [edi + 0x140]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401691
mov eax, dword [ebp - 0xc]
add esi, 0xf8
adc eax, 0
push eax
push esi
push 0
push 0x10
call fcn.00401030
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0x114]
mov dword [ebp - 0xc], edx
cmp eax, 0xf4240
jae 0x40184e
cmp dword [edi + 0x10c], 0xf4240
jae 0x40184e
cmp dword [edi + 0x108], 0x10000000
jae 0x40184e
push eax
call fcn.00401e5f
add esp, 4
mov esi, eax
mov dword [edi + 0x130], esi
push dword [edi + 0x10c]
call fcn.00401e5f
add esp, 4
mov dword [edi + 0x134], eax
test esi, esi
je 0x401861
test eax, eax
je 0x401861
cmp dword [edi + 0x114], 0
mov esi, dword [ebp - 0x10]
jbe 0x4017f0
push dword [ebp - 0xc]
push esi
push ebx
call fcn.00401000
push ebx
lea eax, [ebp - 8]
push eax
push dword [edi + 0x114]
push dword [edi + 0x130]
push dword [edi + 0x140]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401691
add esi, dword [edi + 0x114]
mov eax, dword [ebp - 0xc]
adc eax, 0
mov dword [ebp - 0xc], eax
jmp 0x4017f3
mov eax, dword [ebp - 0xc]
cmp dword [edi + 0x10c], 0
jbe 0x401835
push eax
push esi
push ebx
call fcn.00401000
push ebx
lea eax, [ebp - 8]
push eax
push dword [edi + 0x10c]
push dword [edi + 0x134]
push dword [edi + 0x140]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401691
add esi, dword [edi + 0x10c]
mov eax, dword [ebp - 0xc]
adc eax, 0
push eax
push esi
push dword [ebp - 0x14]
push dword [ebp - 0x18]
call fcn.00401030
mov dword [edi + 0x138], eax
mov dword [edi + 0x13c], edx
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401dfc
mov esp, ebp
pop ebp
ret
push str.Failed_to_allocated_memory_for_headers_n
call fcn.00401ef1
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 0xe
pop edi
pop esi
pop ebx
call fcn.00401dfc
mov esp, ebp
pop ebp
ret