Function at 0x401820
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
cmp byte [0x4762f8], 0
mov ebx, edx
mov esi, ecx
jne 0x40184b
call fcn.00401650
cmp byte [0x4762f8], 1
mov edi, 1
jne 0x401b2f
mov ebp, dword [esp + 0x4c]
mov edi, dword [esp + 0x48]
mov eax, dword [esp + 0x50]
mov ecx, ebp
sar ecx, 0x1f
shr ecx, 0x14
add ecx, edi
adc ebp, 0
test eax, eax
je 0x401afb
shrd ecx, ebp, 0xc
sar ebp, 0xc
mov dword [esp + 0x18], esi
mov edx, ebp
mov esi, ecx
shld edx, ecx, 0xc
mov dword [esp + 0x10], edx
mov edx, ecx
shl edx, 0xc
sub edi, edx
mov dword [esp + 0xc], edx
jmp 0x4018e9
add dword [0x476318], 1
mov ebp, dword [esp]
adc dword [0x47631c], 0
shl edi, 0xc
mov esi, edi
add esi, dword [0x476304]
add esi, dword [esp + 0x14]
push dword [esp + 8]
push esi
push ebx
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov esi, dword [esp + 4]
mov ecx, dword [esp + 8]
add esi, 1
mov eax, dword [esp + 0x1c]
adc ebp, 0
add ebx, ecx
add dword [esp + 0xc], 0x1000
adc dword [esp + 0x10], 0
xor edi, edi
sub eax, ecx
je 0x401b2f
mov ecx, 0x1000
mov dword [esp + 0x20], ebx
mov ebx, dword [0x476008]
mov dword [esp + 0x1c], eax
sub ecx, edi
cmp eax, ecx
cmovb ecx, eax
mov dword [esp + 8], ecx
mov ecx, dword [0x476004]
mov eax, ecx
sar eax, 0x1f
push eax
mov dword [esp + 0x30], ecx
push ecx
push ebp
push esi
call fcn.0040a5d0
add esp, 0x10
mov ecx, eax
test ebx, ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], edi
mov dword [esp], ebp
mov dword [esp + 4], esi
je 0x4019c0
mov edx, dword [0x4762fc]
mov eax, dword [0x476308]
mov ebp, dword [0x476300]
xor esi, esi
mov edi, ecx
mov dword [esp + 0x24], edx
mov edx, ecx
mov dword [esp + 0x30], eax
nop word [eax + eax]
mov eax, dword [esp + 0x30]
cmp byte [eax + edx], 0
je 0x4019b0
mov ebx, ecx
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx + edx*8]
mov ecx, dword [ecx + edx*8 + 4]
xor eax, dword [esp + 4]
xor ecx, dword [esp]
or ecx, eax
je 0x4019b0
mov eax, dword [ebp + edx*8]
mov ecx, ebx
cmp eax, dword [ebp + edi*8]
mov eax, dword [ebp + edx*8 + 4]
sbb eax, dword [ebp + edi*8 + 4]
mov eax, dword [esi*4 + 0x476338]
cmovb edi, edx
add eax, ebx
inc esi
cdq
idiv dword [esp + 0x2c]
cmp dword [esp + 0x28], esi
jne 0x401960
jmp 0x4019c2
mov edi, edx
jmp 0x4019c2
mov edi, ecx
cmp byte [esp + 0x54], 0
mov ebx, dword [esp + 0x20]
je 0x401a20
mov eax, dword [0x476308]
mov ebp, dword [esp]
mov esi, dword [esp + 4]
cmp byte [eax + edi], 0
je 0x4018c2
mov eax, dword [0x4762fc]
mov ecx, dword [eax + edi*8]
mov eax, dword [eax + edi*8 + 4]
xor ecx, esi
xor eax, ebp
or eax, ecx
jne 0x4018c2
shl edi, 0xc
add edi, dword [0x476304]
add edi, dword [esp + 0x14]
push dword [esp + 8]
push ebx
push edi
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
jmp 0x4018c2
add dword [0x476310], 1
mov eax, dword [0x476308]
mov ebp, dword [esp + 0x18]
mov esi, dword [esp + 4]
adc dword [0x476314], 0
cmp byte [eax + edi], 0
je 0x401a6f
mov eax, dword [0x4762fc]
mov ecx, dword [eax + edi*8]
mov eax, dword [eax + edi*8 + 4]
xor eax, dword [esp]
xor ecx, esi
or eax, ecx
je 0x401890
add dword [0x476320], 1
mov eax, 0x476328
adc dword [0x476324], 0
jmp 0x401a74
mov eax, 0x476320
add dword [eax], 1
adc dword [eax + 4], 0
push 0
push dword [esp + 0x14]
push dword [esp + 0x14]
push ebp
call fcn.0040b5f0
add esp, 0x10
test edx, edx
js 0x401aff
mov eax, dword [0x476304]
mov esi, edi
shl esi, 0xc
add eax, esi
push 0x1000
push eax
push ebp
call sub.api_ms_win_crt_stdio_l1_1_0.dll__read
add esp, 0xc
test eax, eax
js 0x401b14
mov ecx, dword [0x476378]
mov eax, dword [0x47637c]
mov edx, dword [0x476300]
mov ebp, dword [esp]
add ecx, 1
adc eax, 0
mov dword [0x476378], ecx
mov dword [0x47637c], eax
mov dword [edx + edi*8], ecx
mov dword [edx + edi*8 + 4], eax
mov ecx, dword [esp + 4]
mov eax, dword [0x476308]
mov byte [eax + edi], 1
mov eax, dword [0x4762fc]
mov dword [eax + edi*8 + 4], ebp
mov dword [eax + edi*8], ecx
jmp 0x4018a6
xor edi, edi
jmp 0x401b2f
cmp dword [0x476938], 0
mov edi, 0xffffffff
js 0x401b2f
push str._n_lseek64_fail.
jmp 0x401b27
cmp dword [0x476938], 0
mov edi, 0xffffffff
js 0x401b2f
push str._n_read___fail.
call sub.api_ms_win_crt_stdio_l1_1_0.dll_puts
add esp, 4
mov eax, edi
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret