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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffd9c
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x260], ecx
mov dword [ebp - 0x264], ecx
mov dword [ebp - 4], edx
mov ebx, eax
xor eax, eax
push ebp
push 0x409d46
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x25c]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_FindFirstFileW
cmp eax, 0xffffffff
jne 0x409a04
mov dword [ebx + 0xc], 1
cmp byte [ebx + 0x10], 0
je 0x409d28
mov edx, 0x409d5c
mov eax, ebx
call fcn.004098a8
jmp 0x409d28
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_CreateFileW
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x409a4a
mov dword [ebx + 0xc], 2
cmp byte [ebx + 0x10], 0
je 0x409d28
mov edx, 0x409d78
mov eax, ebx
call fcn.004098a8
jmp 0x409d28
mov eax, 0x1000
call fcn.00402548
mov esi, eax
test esi, esi
jne 0x409a7c
mov dword [ebx + 0xc], 5
cmp byte [ebx + 0x10], 0
je 0x409d28
mov edx, 0x409d94
mov eax, ebx
call fcn.004098a8
jmp 0x409d28
push 0
lea eax, [ebp - 0xc]
push eax
push 0x1000
push esi
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_ReadFile
cmp dword [ebp - 0xc], 0x200
jb 0x409aa7
mov edx, esi
mov eax, ebx
call fcn.00409910
test al, al
jne 0x409ad5
mov dword [ebx + 0xc], 6
cmp byte [ebx + 0x10], 0
je 0x409ac0
mov edx, 0x409db4
mov eax, ebx
call fcn.004098a8
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
mov eax, esi
call fcn.00402568
jmp 0x409d28
mov eax, esi
mov dword [ebx + 4], eax
mov eax, dword [eax + 0x3c]
add eax, esi
mov dword [ebx + 8], eax
mov eax, dword [ebx + 0x11]
test eax, eax
je 0x409aee
call fcn.00402568
mov eax, dword [ebx + 0x1b]
test eax, eax
je 0x409afa
call fcn.00402568
mov eax, dword [ebx + 8]
mov eax, dword [eax + 0x50]
call fcn.00402548
mov edi, eax
mov dword [ebx + 0x11], edi
test edi, edi
jne 0x409b3c
mov dword [ebx + 0xc], 5
cmp byte [ebx + 0x10], 0
je 0x409b27
mov edx, 0x409d94
mov eax, ebx
call fcn.004098a8
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
mov eax, esi
call fcn.00402568
jmp 0x409d28
mov eax, dword [ebx + 8]
mov edx, dword [eax + 0x50]
mov eax, dword [ebx + 0x11]
xor ecx, ecx
call fcn.004027dc
mov eax, dword [ebx + 8]
mov ecx, dword [eax + 0x54]
mov edx, dword [ebx + 0x11]
mov eax, esi
call fcn.0040268c
mov eax, esi
call fcn.00402568
mov eax, dword [ebx + 0x11]
mov dword [ebx + 4], eax
mov eax, dword [eax + 0x3c]
add eax, dword [ebx + 0x11]
mov dword [ebx + 8], eax
mov eax, dword [ebx + 8]
add eax, 0xf8
mov dword [ebx + 0x23], eax
mov eax, dword [ebx + 8]
movzx esi, word [eax + 6]
test esi, esi
jbe 0x409ba0
mov eax, dword [ebx + 0x23]
mov eax, dword [eax + 0xc]
mov edx, dword [ebx + 8]
cmp eax, dword [edx + 0x54]
jae 0x409b99
mov dword [edx + 0x54], eax
add dword [ebx + 0x23], 0x28
dec esi
jne 0x409b88
mov eax, ebx
call fcn.00409944
push 0
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_GetFileSize
mov dword [ebx + 0x17], eax
cmp byte [ebx + 0x15], 1
jne 0x409c2b
mov eax, dword [ebx + 0x17]
cmp eax, dword [ebx + 0x27]
jbe 0x409c2b
mov esi, dword [ebx + 0x17]
sub esi, dword [ebx + 0x27]
mov dword [ebx + 0x1f], esi
mov eax, esi
call fcn.00402548
mov edi, eax
mov dword [ebx + 0x1b], edi
test edi, edi
jne 0x409c03
mov dword [ebx + 0xc], 5
cmp byte [ebx + 0x10], 0
je 0x409bf5
mov edx, 0x409d94
mov eax, ebx
call fcn.004098a8
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
jmp 0x409d28
push 0
push 0
mov eax, dword [ebx + 0x27]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_SetFilePointer
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebx + 0x1f]
push eax
mov eax, dword [ebx + 0x1b]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_ReadFile
mov eax, dword [ebx + 8]
cmp word [eax + 6], 0
jne 0x409c48
xor eax, eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
jmp 0x409d28
mov eax, dword [ebx + 8]
add eax, 0xf8
mov dword [ebx + 0x23], eax
mov eax, dword [ebx + 8]
movzx esi, word [eax + 6]
test esi, esi
jbe 0x409d1a
mov eax, dword [ebx + 0x23]
cmp dword [eax + 0x14], 0
jne 0x409c7c
cmp dword [eax + 0x10], 0
je 0x409c7c
mov edx, dword [eax + 0x10]
mov dword [eax + 8], edx
xor edx, edx
mov dword [eax + 0x10], edx
mov eax, dword [ebx + 0x23]
mov edx, dword [eax + 0x14]
test edx, edx
jbe 0x409d0f
cmp dword [eax + 0x10], 0
jbe 0x409d0f
push 0
push 0
push edx
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_SetFilePointer
push 0
lea edx, [ebp - 0xc]
push edx
mov eax, dword [ebx + 0x23]
mov edx, dword [eax + 0x10]
push edx
mov eax, dword [eax + 0xc]
add eax, dword [ebx + 0x11]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_ReadFile
mov eax, dword [ebx + 0x23]
mov eax, dword [eax + 0x10]
cmp eax, dword [ebp - 0xc]
je 0x409d0f
mov dword [ebx + 0xc], 3
cmp byte [ebx + 0x10], 0
je 0x409d04
lea eax, [ebp - 0x264]
mov edx, dword [ebp - 4]
call fcn.00403b24
mov ecx, dword [ebp - 0x264]
lea eax, [ebp - 0x260]
mov edx, 0x409dd0
call fcn.00403be4
mov edx, dword [ebp - 0x260]
mov eax, ebx
call fcn.004098a8
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
jmp 0x409d28
add dword [ebx + 0x23], 0x28
dec esi
jne 0x409c62
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
xor eax, eax
mov dword [ebx + 0xc], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x409d4d
lea eax, [ebp - 0x264]
mov edx, 2
call fcn.0040393c
ret