Function at 0x10040e70
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x1007ff50]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
mov dword [ebp - 8], edi
jne 0x10040eaa
mov esi, 6
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov dword [ecx + 4], eax
or eax, 0xffffffff
mov dword [ecx], esi
or edx, eax
jmp 0x100410ee
cmp dword [0x1008034c], 0
jne 0x10040ebd
call fcn.100380f0
mov dword [0x1008034c], eax
xor ebx, ebx
test byte [edi + 0x24], 4
jne 0x10040f54
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push ebx
lea edx, [ebp - 0x14]
push edx
push ecx
push eax
mov dword [ebp - 0x14], eax
mov eax, dword [edi + 4]
push eax
mov dword [ebp - 0x10], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x10040f09
call fcn.1004b610
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 0x100410ee
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
lea eax, [esi + ecx*8]
cmp esi, eax
mov dword [ebp - 0xc], eax
jae 0x10040f4d
lea esp, [esp]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push 0
lea edx, [ebp - 8]
push edx
mov edx, dword [edi + 4]
push eax
push ecx
push edx
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10040eea
add ebx, dword [ebp - 8]
add esi, 8
cmp esi, dword [ebp - 0xc]
jb 0x10040f20
mov eax, ebx
jmp 0x100410ec
mov ebx, dword [ebp + 0x14]
mov edi, dword [ebp + 0x10]
push ebx
push edi
call fcn.10021ec0
mov ecx, dword [0x1008034c]
mov dword [ebp - 0xc], eax
lea eax, [ecx + eax - 1]
cdq
idiv ecx
add esp, 8
mov dword [ebp - 0x2c], eax
lea eax, [eax*8 + 8]
call fcn.1004a7f0
lea ebx, [edi + ebx*8]
cmp edi, ebx
mov esi, esp
mov dword [ebp - 0x10], esi
jae 0x10040fb6
nop
xor ecx, ecx
cmp dword [edi + 4], ecx
jle 0x10040faf
mov eax, dword [edi]
add eax, ecx
cdq
mov dword [esi], eax
mov dword [esi + 4], edx
add ecx, dword [0x1008034c]
add esi, 8
cmp ecx, dword [edi + 4]
jl 0x10040f97
add edi, 8
cmp edi, ebx
jb 0x10040f90
xor ecx, ecx
xor eax, eax
mov dword [esi], ecx
mov dword [esi + 4], ecx
push ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0xc]
push ecx
mov edx, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
push 1
push ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
sar edx, 0x1f
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
test eax, eax
mov dword [ebp - 0x18], eax
je 0x10040eea
mov eax, dword [0x1008034c]
imul eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x10]
mov edi, dword [ebp - 0xc]
lea ecx, [ebp - 0x28]
push ecx
push 0
push eax
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 4]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFileScatter]
test eax, eax
jne 0x100410e0
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov esi, eax
cmp esi, 0x3e5
je 0x10041062
cmp esi, 0x22a
je 0x10041062
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov edx, dword [ebp - 0x18]
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 0x100410ee
mov eax, dword [ebp - 0x18]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x10041095
call fcn.1004b610
mov esi, eax
call ebx
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
mov dword [ecx + 4], esi
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x100410ee
mov ecx, dword [ebp - 8]
push 0
lea edx, [ebp - 0x10]
push edx
mov edx, dword [ecx + 4]
lea eax, [ebp - 0x28]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x100410d7
call ebx
mov esi, eax
cmp esi, 0x26
je 0x100410d7
call fcn.1004b610
mov ecx, dword [ebp + 0x18]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x18]
push eax
mov dword [ecx], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
or edx, eax
jmp 0x100410ee
mov eax, dword [ebp - 0x10]
cmp eax, edi
jae 0x100410e0
mov edi, eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
xor edx, edx
lea esp, [ebp - 0x38]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1004a1cc
mov esp, ebp
pop ebp
ret 0x14