Function at 0x401820
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 [0x470300], 0
jne 0x40184b
call fcn.00401650
mov eax, 1
cmp byte [0x470300], 1
jne 0x401bbb
mov ebx, dword [esp + 0x50]
test ebx, ebx
je 0x401b5d
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x48]
mov edx, ecx
sar edx, 0x1f
shr edx, 0x14
add edx, eax
adc ecx, 0
mov ebp, ecx
shld ebp, edx, 0x14
mov dword [esp + 0x28], edi
mov edi, ecx
sar edi, 0xc
shl ecx, 0x14
shrd ecx, edi, 0x14
mov dword [esp + 0x20], ecx
and edx, 0xfffff000
mov dword [esp + 0x1c], edx
sub eax, edx
mov edx, edi
mov ecx, dword [0x470004]
mov dword [esp + 0x14], ecx
mov ecx, dword [0x470008]
mov dword [esp + 0x18], ecx
jmp 0x4018d4
mov ebx, dword [esp + 8]
mov edx, dword [esp]
mov edi, dword [esp + 4]
add ebp, 1
adc edx, 0
add esi, edi
add dword [esp + 0x1c], 0x1000
adc dword [esp + 0x20], 0
xor eax, eax
sub ebx, edi
je 0x401bbb
mov dword [esp + 0xc], ebp
mov ecx, 0x1000
mov dword [esp + 0x10], eax
sub ecx, eax
cmp ebx, ecx
cmovb ecx, ebx
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x14]
mov eax, ecx
sar eax, 0x1f
push eax
push ecx
mov dword [esp + 8], edx
push edx
push ebp
call fcn.0040b870
add esp, 0x10
mov ecx, eax
cmp dword [esp + 0x18], 0
mov dword [esp + 0x24], esi
mov dword [esp + 8], ebx
je 0x4019f0
mov eax, dword [0x470310]
mov dword [esp + 0x30], eax
mov eax, dword [0x470304]
mov dword [esp + 0x2c], eax
xor esi, esi
mov ebp, dword [0x470308]
mov edx, ecx
mov edi, ecx
nop dword [eax + eax]
mov eax, dword [esp + 0x30]
cmp byte [eax + edx], 0
je 0x401a50
mov ebx, ecx
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx + edx*8]
xor eax, dword [esp + 0xc]
mov ecx, dword [ecx + edx*8 + 4]
xor ecx, dword [esp]
or ecx, eax
je 0x401a60
mov eax, dword [ebp + edx*8]
cmp eax, dword [ebp + edi*8]
mov eax, dword [ebp + edx*8 + 4]
sbb eax, dword [ebp + edi*8 + 4]
cmovb edi, edx
mov eax, dword [esi*4 + 0x470340]
mov ecx, ebx
add eax, ebx
cdq
idiv dword [esp + 0x14]
inc esi
cmp dword [esp + 0x18], esi
jne 0x401940
cmp byte [esp + 0x54], 0
je 0x4019f9
mov eax, dword [0x470310]
cmp byte [eax + edi], 0
mov esi, dword [esp + 0x24]
mov ebp, dword [esp + 0xc]
je 0x4018aa
mov eax, dword [0x470304]
mov ecx, dword [eax + edi*8]
xor ecx, ebp
mov eax, dword [eax + edi*8 + 4]
mov edx, dword [esp]
xor eax, edx
or eax, ecx
jne 0x401a76
shl edi, 0xc
add edi, dword [0x47030c]
add edi, dword [esp + 0x10]
mov ebp, esi
mov ebx, dword [esp + 8]
mov ecx, dword [esp + 4]
jmp 0x401b44
mov edi, ecx
cmp byte [esp + 0x54], 0
jne 0x40199b
add dword [0x470318], 1
adc dword [0x47031c], 0
mov eax, dword [0x470310]
cmp byte [eax + edi], 0
mov esi, dword [esp + 0x24]
mov ebx, dword [esp + 0x28]
mov edx, dword [esp + 0xc]
je 0x401a6f
mov eax, dword [0x470304]
mov ecx, dword [eax + edi*8]
xor ecx, edx
mov eax, dword [eax + edi*8 + 4]
xor eax, dword [esp]
or eax, ecx
jne 0x401a7f
add dword [0x470320], 1
adc dword [0x470324], 0
shl edi, 0xc
mov ebp, edi
jmp 0x401b2e
mov edi, edx
cmp byte [esp + 0x54], 0
je 0x4019f9
jmp 0x40199b
mov edi, edx
cmp byte [esp + 0x54], 0
jne 0x40199b
jmp 0x4019f9
mov eax, 0x470328
jmp 0x401a92
mov ebx, dword [esp + 8]
jmp 0x4018b1
add dword [0x470328], 1
adc dword [0x47032c], 0
mov eax, 0x470330
add dword [eax], 1
adc dword [eax + 4], 0
push 0
push dword [esp + 0x24]
push dword [esp + 0x24]
push ebx
call fcn.0040c890
add esp, 0x10
test edx, edx
js 0x401b61
mov ebp, edi
shl ebp, 0xc
mov eax, dword [0x47030c]
add eax, ebp
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 0x401b88
mov eax, dword [0x470008]
mov dword [esp + 0x18], eax
mov eax, dword [0x470004]
mov dword [esp + 0x14], eax
mov eax, dword [0x470384]
mov ecx, dword [0x470380]
add ecx, 1
adc eax, 0
mov dword [0x470380], ecx
mov dword [0x470384], eax
mov edx, dword [0x470308]
mov dword [edx + edi*8], ecx
mov dword [edx + edi*8 + 4], eax
mov eax, dword [0x470310]
mov byte [eax + edi], 1
mov eax, dword [0x470304]
mov ecx, dword [esp]
mov dword [eax + edi*8 + 4], ecx
mov ecx, dword [esp + 0xc]
mov dword [eax + edi*8], ecx
mov ebx, dword [esp + 8]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 4]
add ebp, dword [0x47030c]
add ebp, eax
mov edi, esi
push ecx
push ebp
push edi
mov edi, ecx
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov ebp, dword [esp + 0xc]
mov edx, dword [esp]
jmp 0x4018b5
xor eax, eax
jmp 0x401bbb
cmp dword [0x4709d8], 0
mov eax, 0xffffffff
js 0x401bbb
cmp dword [0x470a24], 0
jne 0x401bbb
mov ecx, str._n_lseek64_fail.
cmp dword [0x470a28], 0
je 0x401bad
jmp 0x401bbb
cmp dword [0x4709d8], 0
mov eax, 0xffffffff
js 0x401bbb
cmp dword [0x470a24], 0
jne 0x401bbb
mov ecx, str._n_read___fail.
cmp dword [0x470a28], 0
jne 0x401bbb
push ecx
call sub.api_ms_win_crt_stdio_l1_1_0.dll_puts
add esp, 4
mov eax, 0xffffffff
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret