Function at 0x401890
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
mov esi, edx
mov edi, ecx
cmp byte [0x4712f8], 0
jne 0x4018bb
call fcn.004016c0
mov ebx, 1
cmp byte [0x4712f8], 1
jne 0x401bcb
mov ebp, dword [esp + 0x50]
test ebp, ebp
je 0x401b6d
mov eax, dword [esp + 0x4c]
mov ebx, dword [esp + 0x48]
mov ecx, eax
sar ecx, 0x1f
shr ecx, 0x14
add ecx, ebx
adc eax, 0
mov edx, eax
shld edx, ecx, 0x14
mov dword [esp + 0x18], edi
mov edi, eax
sar edi, 0xc
shl eax, 0x14
shrd eax, edi, 0x14
mov dword [esp + 0x10], eax
and ecx, 0xfffff000
mov dword [esp + 0xc], ecx
sub ebx, ecx
jmp 0x401961
add dword [0x471318], 1
adc dword [0x47131c], 0
shl ebp, 0xc
mov edi, ebp
mov eax, dword [esp + 8]
add edi, dword [0x471304]
add edi, eax
mov ebp, esi
push dword [esp + 0x14]
push edi
push ebp
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov edx, dword [esp + 4]
mov edi, dword [esp]
add edx, 1
adc edi, 0
mov eax, dword [esp + 0x14]
add esi, eax
add dword [esp + 0xc], 0x1000
adc dword [esp + 0x10], 0
xor ebx, ebx
mov ebp, dword [esp + 0x1c]
sub ebp, eax
je 0x401bcb
mov dword [esp + 0x20], esi
mov dword [esp], edi
mov eax, 0x1000
sub eax, ebx
cmp ebp, eax
cmovb eax, ebp
mov dword [esp + 0x14], eax
mov ecx, dword [0x471004]
mov eax, ecx
sar eax, 0x1f
mov esi, dword [0x471008]
push eax
mov dword [esp + 0x30], ecx
push ecx
push edi
mov dword [esp + 0x10], edx
push edx
call fcn.0040bc70
add esp, 0x10
mov ecx, eax
mov dword [esp + 0x28], esi
test esi, esi
mov dword [esp + 8], ebx
mov dword [esp + 0x1c], ebp
je 0x401a40
mov eax, dword [0x471308]
mov dword [esp + 0x30], eax
mov eax, dword [0x4712fc]
mov dword [esp + 0x24], eax
xor edi, edi
mov esi, dword [0x471300]
mov edx, ecx
mov ebp, ecx
nop word cs:[eax + eax]
mov eax, dword [esp + 0x30]
cmp byte [eax + edx], 0
je 0x401a30
mov ebx, ecx
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx + edx*8]
xor eax, dword [esp + 4]
mov ecx, dword [ecx + edx*8 + 4]
xor ecx, dword [esp]
or ecx, eax
je 0x401a30
mov eax, dword [esi + edx*8]
cmp eax, dword [esi + ebp*8]
mov eax, dword [esi + edx*8 + 4]
sbb eax, dword [esi + ebp*8 + 4]
cmovb ebp, edx
mov eax, dword [edi*4 + 0x471338]
mov ecx, ebx
add eax, ebx
cdq
idiv dword [esp + 0x2c]
inc edi
cmp dword [esp + 0x28], edi
jne 0x4019e0
jmp 0x401a42
mov ebp, edx
jmp 0x401a42
mov ebp, ecx
cmp byte [esp + 0x54], 0
mov esi, dword [esp + 0x20]
je 0x401a90
mov eax, dword [0x471308]
cmp byte [eax + ebp], 0
mov edx, dword [esp + 4]
mov edi, dword [esp]
je 0x40193a
mov eax, dword [0x4712fc]
mov ecx, dword [eax + ebp*8]
xor ecx, edx
mov eax, dword [eax + ebp*8 + 4]
xor eax, edi
or eax, ecx
jne 0x40193a
shl ebp, 0xc
add ebp, dword [0x471304]
add ebp, dword [esp + 8]
mov edi, esi
jmp 0x401925
add dword [0x471310], 1
adc dword [0x471314], 0
mov eax, dword [0x471308]
cmp byte [eax + ebp], 0
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 4]
mov edi, dword [esp]
je 0x401ae1
mov eax, dword [0x4712fc]
mov ecx, dword [eax + ebp*8]
xor ecx, edx
mov eax, dword [eax + ebp*8 + 4]
xor eax, edi
or eax, ecx
je 0x401904
add dword [0x471320], 1
adc dword [0x471324], 0
mov eax, 0x471328
jmp 0x401ae6
mov eax, 0x471320
add dword [eax], 1
adc dword [eax + 4], 0
push 0
push dword [esp + 0x14]
push dword [esp + 0x14]
push ebx
call fcn.0040cc90
add esp, 0x10
test edx, edx
js 0x401b71
mov edi, ebp
shl edi, 0xc
mov eax, dword [0x471304]
add eax, edi
push 0x1000
push eax
push ebx
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
test eax, eax
js 0x401b98
mov eax, dword [0x47137c]
mov ecx, dword [0x471378]
add ecx, 1
adc eax, 0
mov dword [0x471378], ecx
mov dword [0x47137c], eax
mov edx, dword [0x471300]
mov dword [edx + ebp*8], ecx
mov dword [edx + ebp*8 + 4], eax
mov eax, dword [0x471308]
mov byte [eax + ebp], 1
mov eax, dword [0x4712fc]
mov ecx, dword [esp]
mov dword [eax + ebp*8 + 4], ecx
mov ecx, dword [esp + 4]
mov dword [eax + ebp*8], ecx
jmp 0x401917
xor ebx, ebx
jmp 0x401bcb
cmp dword [0x4719b8], 0
mov ebx, 0xffffffff
js 0x401bcb
cmp dword [0x471a04], 0
jne 0x401bcb
mov eax, str._n_lseek64_fail.
cmp dword [0x471a08], 0
je 0x401bbd
jmp 0x401bcb
cmp dword [0x4719b8], 0
mov ebx, 0xffffffff
js 0x401bcb
cmp dword [0x471a04], 0
jne 0x401bcb
mov eax, str._n_read___fail.
cmp dword [0x471a08], 0
jne 0x401bcb
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_puts
add esp, 4
mov ebx, 0xffffffff
mov eax, ebx
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret