Function at 0x409bd0
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x38
mov ebx, edx
mov esi, ecx
mov eax, dword [esp + 0x50]
mov dword [esp + 0xc], 0
lea ecx, [esp + 0xc]
push ecx
push 1
push eax
push esi
call fcn.0042a5a0
add esp, 0x10
test eax, eax
jne 0x409deb
mov dword [esp + 8], esi
push 0x10000
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
add esp, 4
mov ebp, eax
mov esi, 0x7f2bb746
xor edi, edi
test eax, eax
je 0x409dc8
mov eax, dword [esp + 8]
push dword [eax + 0x14]
push 1
call sub.api_ms_win_crt_heap_l1_1_0.dll_calloc
add esp, 8
test eax, eax
je 0x409dc8
mov ecx, dword [esp + 0x4c]
mov edi, eax
mov eax, dword [esp + 0xc]
mov dword [esp + 0x20], eax
mov eax, dword [ecx + 0x18]
mov ecx, dword [ecx + 0x1c]
mov dword [esp + 0x24], 0
mov dword [esp + 0x2c], eax
cmp eax, 1
mov dword [esp + 0x28], ecx
mov eax, ecx
sbb eax, 0
jl 0x409db4
mov dword [esp], edi
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x10], ebx
jmp 0x409c9f
mov ecx, dword [esp + 0x18]
add ecx, 0x10000
mov edx, dword [esp + 0x14]
adc edx, 0
cmp ecx, dword [esp + 0x2c]
mov eax, edx
sbb eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x10]
jge 0x409df3
push 0
mov dword [esp + 0x18], edx
push edx
mov dword [esp + 0x20], ecx
push ecx
push ebx
call fcn.0042b3a0
add esp, 0x10
test edx, edx
js 0x409c7a
push 0x10000
push ebp
push dword [esp + 0x18]
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
test eax, eax
js 0x409df7
je 0x409c7a
mov ecx, dword [esp + 8]
mov esi, dword [ecx + 0x14]
xor edx, edx
mov edi, ebp
xor ebx, ebx
mov dword [esp + 4], ebp
mov dword [esp + 0x30], eax
jmp 0x409d16
add edi, ebp
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 8]
mov esi, dword [eax + 0x14]
mov edx, dword [esp + 0x34]
add edx, esi
adc ebx, 0
mov eax, dword [esp + 0x30]
cmp edx, eax
mov ecx, ebx
sbb ecx, 0
mov ebp, dword [esp + 4]
jae 0x409c7a
mov ecx, esi
sar ecx, 0x1f
mov ebp, eax
sub ebp, edx
mov eax, ebx
mov ebx, edx
mov edx, 0
mov dword [esp + 0x1c], eax
sbb edx, eax
cmp ebp, esi
sbb edx, ecx
cmovge ebp, esi
push ebp
push dword [esp + 4]
push edi
call sub.api_ms_win_crt_private_l1_1_0.dll_memcmp
add esp, 0xc
test eax, eax
mov dword [esp + 0x34], ebx
je 0x409ceb
mov eax, ebx
add eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
mov ecx, ebx
adc ecx, dword [esp + 0x14]
push 0
push 0
push ecx
push eax
push dword [esp + 0x30]
call fcn.0042b240
add esp, 0x14
test eax, eax
jne 0x409db8
nop word cs:[eax + eax]
nop dword [eax + eax]
test ebp, ebp
jle 0x409cf1
lea eax, [esp + 0x24]
push eax
push ebp
push edi
push dword [esp + 0x2c]
call fcn.0042aaa0
add esp, 0x10
test eax, eax
jne 0x409db8
mov eax, dword [esp + 0x24]
test eax, eax
je 0x409dbc
sub ebp, eax
add edi, eax
test ebp, ebp
jg 0x409d88
jmp 0x409cf1
xor esi, esi
jmp 0x409dc8
mov esi, eax
jmp 0x409dc1
mov esi, 5
mov ebp, dword [esp + 4]
mov edi, dword [esp]
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
push dword [esp + 0xc]
call fcn.0042a790
add esp, 4
test esi, esi
cmovne eax, esi
add esp, 0x38
pop esi
pop edi
pop ebx
pop ebp
ret
xor esi, esi
jmp 0x409dc5
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov esi, dword [eax]
jmp 0x409dc5