Function at 0x406770
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x18
mov ecx, dword [esp + 0x34]
push ebx
push ebp
push esi
push edi
lea ebp, [eax + 0xccc]
mov eax, dword [eax]
push ecx
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4067af
push 0x4c5ea0
mov eax, 0x4c5ea0
call fcn.00409ce0
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov ecx, dword [esp + 0x2c]
xor eax, eax
add ecx, 8
xor edi, edi
xor ebx, ebx
cmp eax, dword [esp + 0x30]
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], ecx
jne 0x4067d7
mov edx, dword [esp + 0x44]
mov esi, dword [edx]
mov eax, edx
mov eax, dword [eax + 4]
jmp 0x4067dd
mov esi, dword [ecx - 8]
mov eax, dword [ecx - 4]
sub esi, edi
sbb eax, ebx
mov edx, esi
shrd edx, eax, 0xf
shr eax, 0xf
and esi, 0x7fff
mov dword [esp + 0x18], edx
jne 0x4067fd
mov esi, 0x8000
jmp 0x406802
inc edx
mov dword [esp + 0x18], edx
test edx, edx
jbe 0x406894
mov ecx, dword [esp + 0x1c]
push 0
push 0
push ebx
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x406793
mov eax, dword [esp + 0x1c]
push 0
lea edx, [esp + 0x28]
push edx
push esi
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406793
cmp esi, dword [esp + 0x24]
jne 0x40696c
mov eax, dword [esp + 0x34]
test eax, eax
je 0x406862
mov ecx, dword [esp + 0x38]
push esi
push ebp
push ecx
call eax
test eax, eax
je 0x4069a4
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x40687b
mov edx, dword [esp + 0x40]
push esi
push ebp
push edx
call eax
test eax, eax
je 0x4069a4
add edi, esi
adc ebx, 0
sub dword [esp + 0x18], 1
mov esi, 0x8000
jne 0x40680a
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x30]
jae 0x406949
mov esi, dword [ecx]
test esi, esi
je 0x40695f
cmp dword [ecx + 8], 0
jne 0x4068ff
push 0
push 0
push ebx
push edi
mov edi, dword [esp + 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x406793
mov ecx, ebp
mov edx, edi
call fcn.004057c0
test eax, eax
je 0x4069b6
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x4068fb
mov ecx, dword [esp + 0x14]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x40]
push edx
push ebp
push ecx
call eax
test eax, eax
je 0x4069a4
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x34]
test esi, esi
je 0x406939
cmp dword [ecx + 4], 0
je 0x406939
mov eax, dword [ecx]
cmp eax, 0x8000
ja 0x406988
push eax
push 0
push ebp
call fcn.00450680
mov edx, dword [esp + 0x20]
mov eax, dword [edx]
mov ecx, dword [esp + 0x44]
add esp, 0xc
push eax
push ebp
push ecx
call esi
test eax, eax
je 0x4069a4
mov ecx, dword [esp + 0x14]
mov edi, dword [ecx]
mov ebx, dword [ecx - 4]
mov eax, dword [esp + 0x20]
xor edx, edx
add edi, dword [ecx - 8]
adc ebx, edx
inc eax
add ecx, 0x18
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], ecx
cmp eax, dword [esp + 0x30]
jbe 0x4067c8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov eax, 1
push 0x4c5ea0
call fcn.00409f90
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov eax, 8
push 0x4c5ea0
call fcn.00409f90
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
mov eax, 0x11
push 0x4c5ea0
call fcn.00409f90
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret