Function at 0x4a2120
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x64c874]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, ecx
cmp dword [ebx + 4], 0xffffffff
push esi
push edi
mov dword [ebp - 0x10], ebx
jne 0x4a215a
mov esi, 6
call fcn.005d95d0
mov ecx, dword [ebp + 0x18]
mov dword [ecx + 4], eax
or eax, 0xffffffff
mov dword [ecx], esi
or edx, eax
jmp 0x4a23a3
call fcn.004a20e0
xor edi, edi
test byte [ebx + 0x24], 4
jne 0x4a21f2
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push edi
lea edx, [ebp - 0x1c]
push edx
push ecx
push eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebx + 4]
push eax
mov dword [ebp - 0x18], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x4a21ab
call fcn.005d95d0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
or eax, 0xffffffff
mov dword [ecx + 4], esi
or edx, eax
jmp 0x4a23a3
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
lea eax, [esi + ecx*8]
cmp esi, eax
mov dword [ebp - 0x10], eax
jae 0x4a239f
nop
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push 0
lea edx, [ebp - 0xc]
push edx
mov edx, dword [ebx + 4]
push eax
push ecx
push edx
mov dword [ebp - 0xc], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4a218c
add edi, dword [ebp - 0xc]
add esi, 8
cmp esi, dword [ebp - 0x10]
jb 0x4a21c0
jmp 0x4a239f
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
lea ecx, [esi + ecx*8]
xor edi, edi
cmp esi, ecx
mov dword [ebp - 0x34], edi
mov eax, esi
mov dword [ebp - 0xc], ecx
jae 0x4a221d
lea esp, [esp]
add edi, dword [eax + 4]
add eax, 8
cmp eax, ecx
jb 0x4a2210
mov dword [ebp - 0x34], edi
mov ebx, dword [0x65a7f8]
lea eax, [edi + ebx - 1]
cdq
idiv ebx
mov dword [ebp - 0x38], eax
lea eax, [eax*8 + 8]
call fcn.005c1e30
cmp esi, dword [ebp - 0xc]
mov ecx, esp
mov dword [ebp - 0x18], ecx
jae 0x4a226f
xor edi, edi
cmp dword [esi + 4], edi
jle 0x4a2264
lea ebx, [ebx]
mov eax, dword [esi]
add eax, edi
cdq
mov dword [ecx], eax
mov dword [ecx + 4], edx
add edi, ebx
add ecx, 8
cmp edi, dword [esi + 4]
jl 0x4a2250
add esi, 8
cmp esi, dword [ebp - 0xc]
jb 0x4a2243
mov edi, dword [ebp - 0x34]
xor esi, esi
xor eax, eax
mov dword [ecx], esi
mov dword [ecx + 4], esi
push esi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0xc]
push esi
mov edx, eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 8]
push 1
push esi
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x2c], esi
sar edx, 0x1f
mov dword [ebp - 0x28], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
cmp eax, esi
mov dword [ebp - 0x20], eax
je 0x4a218c
mov eax, dword [0x65a7f8]
imul eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x18]
lea ecx, [ebp - 0x30]
push ecx
push esi
push eax
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 4]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFileScatter]
test eax, eax
jne 0x4a2395
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov esi, eax
cmp esi, 0x3e5
je 0x4a2317
cmp esi, 0x22a
je 0x4a2317
call fcn.005d95d0
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x20]
push edx
mov dword [ecx], esi
mov dword [ecx + 4], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x4a23a3
mov eax, dword [ebp - 0x20]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x4a234a
call fcn.005d95d0
mov esi, eax
call ebx
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
mov dword [ecx + 4], esi
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x4a23a3
mov ecx, dword [ebp - 0x10]
push 0
lea edx, [ebp - 0x18]
push edx
mov edx, dword [ecx + 4]
lea eax, [ebp - 0x30]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x4a238c
call ebx
mov esi, eax
cmp esi, 0x26
je 0x4a238c
call fcn.005d95d0
mov ecx, dword [ebp + 0x18]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x20]
push eax
mov dword [ecx], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x4a23a3
mov eax, dword [ebp - 0x18]
cmp eax, edi
jae 0x4a2395
mov edi, eax
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
mov eax, edi
lea esp, [ebp - 0x44]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.005b88a9
mov esp, ebp
pop ebp
ret 0x14