Function at 0x406780
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1c
push ebx
push esi
push edi
xor esi, esi
mov dword [esp + 0x14], esi
push ebp
mov dword [esp + 0x14], esi
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x1c], eax
cmp dword [ebx + 0x450], esi
jne 0x4067d1
lea eax, [esp + 0x14]
push esi
mov ebp, dword [esp + 0x3c]
push eax
mov ecx, dword [esp + 0x3c]
push ebp
push ecx
mov eax, dword [ebx + 0x3b0]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x18], ecx
jmp 0x4069b1
mov ebp, dword [esp + 0x38]
mov eax, dword [ebx + 0x460]
test eax, eax
je 0x4068a1
mov esi, dword [ebx + 0x458]
mov ecx, dword [ebx + 0x454]
sub ecx, esi
mov dword [esp + 0x10], ecx
cmp ebp, ecx
jae 0x4067fd
mov dword [esp + 0x10], ebp
mov ecx, dword [esp + 0x10]
cmp eax, ecx
jae 0x406809
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x34]
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebx + 0x460]
mov eax, dword [esp + 0x10]
sub edx, eax
mov ecx, dword [ebx + 0x468]
add ecx, eax
mov esi, dword [esp + 0x10]
mov eax, dword [ebx + 0x458]
mov edi, dword [ebx + 0x454]
add eax, esi
mov dword [ebx + 0x460], edx
mov dword [ebx + 0x468], ecx
mov dword [ebx + 0x458], eax
cmp edi, eax
ja 0x40687f
mov eax, dword [ebx + 0x450]
mov ecx, dword [ebx + 0x464]
add ecx, eax
mov dword [ebx + 0x458], eax
mov dword [ebx + 0x454], ecx
test edx, edx
jne 0x40687f
mov dword [ebx + 0x45c], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
add ecx, eax
sub ebp, eax
mov edx, dword [esp + 0x34]
mov dword [esp + 0x18], ecx
add edx, eax
test ebp, ebp
mov dword [esp + 0x34], edx
jne 0x4067d5
mov eax, dword [0x4179f0]
test eax, eax
je 0x4068b0
call dword [0x418bc8]
xor edi, edi
cmp ebp, 0x1000
jbe 0x406943
mov esi, 0x4000
cmp ebp, esi
ja 0x4068cf
mov esi, ebp
and esi, 0xfffff000
lea eax, [esp + 0x10]
push edi
mov ecx, dword [esp + 0x38]
push eax
push esi
mov edx, dword [ebx + 0x3b0]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x34]
sub ebp, eax
add ecx, eax
mov edx, dword [esp + 0x18]
mov dword [esp + 0x34], ecx
add edx, eax
mov ecx, dword [esp + 0x14]
add ecx, eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ecx
mov ecx, dword [ebx + 0x468]
add ecx, eax
mov dword [ebx + 0x468], ecx
mov eax, dword [0x4179f0]
test eax, eax
je 0x406929
call dword [0x418bc8]
mov eax, dword [esp + 0x10]
cmp esi, eax
je 0x4068b2
test ebp, ebp
je 0x4068b2
mov dword [ebx + 0x3a8], 1
test ebp, ebp
je 0x4069b1
lea esi, [ebp + 0xfff]
push 0
and esi, 0xfffff000
lea eax, [esp + 0x14]
push eax
mov ecx, dword [ebx + 0x450]
push esi
mov edx, dword [ebx + 0x3b0]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
add eax, ecx
mov dword [ebx + 0x460], ecx
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x450]
mov dword [ebx + 0x458], eax
add eax, ecx
mov dword [ebx + 0x45c], eax
cmp esi, ecx
je 0x4067d5
cmp ebp, ecx
jbe 0x4067d5
mov dword [ebx + 0x3a8], 1
mov eax, dword [esp + 0x14]
mov ecx, dword [ebx + 0x46c]
add ecx, eax
mov eax, dword [ebx + 0x4c4]
mov dword [ebx + 0x46c], ecx
test eax, eax
je 0x406a09
mov dword [esp + 0x24], 0x3e8
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mul ecx
mov ecx, dword [esp + 0x20]
div ecx
mov ecx, dword [esp + 0x1c]
add ecx, eax
mov dword [esp + 0x14], ecx
call dword [sym.imp.WINMM.dll_timeGetTime]
cmp dword [esp + 0x14], eax
ja 0x4069fb
jmp 0x406a0f
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebx + 0x470]
sub eax, ecx
add edx, eax
mov eax, dword [esp + 0x18]
pop ebp
mov dword [ebx + 0x470], edx
pop edi
pop esi
pop ebx
add esp, 0x1c
ret