Function at 0x40f570
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
mov eax, dword [0x5cf000]
xor eax, esp
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
push 0x40
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 0x10]
push dword [esi]
lea ecx, [esi + 4]
mov dword [esp + 0x28], eax
call fcn.0040dfa0
mov eax, dword [esi + 0x20]
lea edx, [esp + 0x10]
imul edi, edi, 0x68
push 0
push edx
mov dword [esp + 0x14], edi
mov ecx, dword [edi + eax + 0x30]
mov eax, dword [edi + eax + 0x34]
push eax
push ecx
push dword [esi + 8]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [esi + 0x20]
add eax, edi
mov ecx, dword [eax + 0x10]
test ecx, ecx
jne 0x40f65a
mov eax, dword [eax + 8]
add eax, 0x100
push 1
push eax
call fcn.005562b1
mov ecx, dword [esi + 0x20]
add esp, 8
mov ebx, eax
cmp dword [ecx + edi + 0xc], 0
mov edx, dword [ecx + edi + 8]
ja 0x40f605
test edx, edx
je 0x40f623
mov dword [esp + 0xc], 0
test edx, edx
je 0x40f623
push 0
lea eax, [esp + 0x10]
push eax
push edx
push ebx
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi + 8]
test eax, eax
je 0x40f638
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
mov eax, dword [esi + 0x20]
push dword [eax + edi + 8]
push ebx
push dword [esp + 0x28]
call fcn.0054f810
add esp, 0xc
push ebx
call fcn.005529f3
add esp, 4
jmp 0x40f847
cmp ecx, 1
jne 0x40f713
mov eax, dword [eax]
add eax, 0x100
push ecx
push eax
call fcn.005562b1
mov ecx, dword [esi + 0x20]
add esp, 8
mov ebx, eax
cmp dword [edi + ecx + 4], 0
mov eax, dword [edi + ecx]
ja 0x40f687
test eax, eax
je 0x40f6a5
mov dword [esp + 0xc], 0
test eax, eax
je 0x40f6a5
push 0
lea ecx, [esp + 0x10]
push ecx
push eax
push ebx
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi + 8]
test eax, eax
je 0x40f6ba
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
mov eax, dword [esi + 0x20]
mov ecx, ebx
mov eax, dword [eax + edi + 0x14]
xor dword [ebx], eax
lea eax, [esp + 0xc]
mov esi, dword [esi + 0x20]
add esi, edi
push eax
mov edi, dword [esi]
mov edx, edi
call fcn.00410b70
add esp, 4
test al, al
je 0x40f705
mov eax, dword [esi + 8]
cmp eax, dword [esp + 0xc]
jb 0x40f705
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], vtable.snappy::ByteArraySource.0
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], edi
call fcn.00410e50
push ebx
call fcn.005529f3
add esp, 4
jmp 0x40f847
cmp dword [eax + 0xc], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x10], xmm0
jb 0x40f832
ja 0x40f732
cmp dword [eax + 8], 0
jbe 0x40f832
mov eax, dword [esp + 0x14]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x28], eax
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 4
lea eax, [esp + 0x28]
push eax
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x1c]
add eax, 0x100
push 1
push eax
call fcn.005562b1
mov ebx, eax
mov dword [esp + 0x18], 0
mov eax, dword [esp + 0x24]
add esp, 8
test eax, eax
je 0x40f799
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
push ebx
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi + 0x20]
mov ecx, dword [esp + 0xc]
mov edi, dword [eax + edi + 8]
mov eax, dword [eax + ecx + 0x14]
mov ecx, ebx
xor dword [ebx], eax
lea eax, [esp + 0x24]
mov edx, dword [esp + 0x1c]
push eax
call fcn.00410b70
add esp, 4
test al, al
je 0x40f7f7
cmp edi, dword [esp + 0x24]
jb 0x40f7f7
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x30]
mov edx, dword [esp + 0x20]
mov dword [esp + 0x30], vtable.snappy::ByteArraySource.0
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], eax
call fcn.00410e50
test al, al
mov dword [esp + 0x30], vtable.snappy::Source.0
cmovne edi, dword [esp + 0x24]
push ebx
call fcn.005529f3
mov ecx, dword [esp + 0x2c]
add esp, 4
mov edx, dword [esp + 0x2c]
add ecx, edi
mov eax, dword [esi + 0x20]
mov edi, dword [esp + 0xc]
adc edx, 0
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
cmp edx, dword [eax + edi + 0xc]
jb 0x40f742
ja 0x40f832
cmp ecx, dword [eax + edi + 8]
jb 0x40f742
mov eax, dword [esi + 8]
test eax, eax
je 0x40f847
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
mov ecx, dword [esp + 0x3c]
mov eax, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0054d63f
mov esp, ebp
pop ebp
ret 0xc