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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.004098cc
xor eax, eax
push ebp
push 0x6471dd
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x18]
call fcn.004097e8
push 0
push 0x8000080
push 3
push 0
push 3
push 0x80000000
mov eax, dword [ebp - 4]
call fcn.0040a5d8
push eax
call sub.kernel32.dll_CreateFileW_1
mov ebx, eax
cmp ebx, 0xffffffff
je 0x6471b2
push 0
push ebx
call sub.kernel32.dll_GetFileSize_1
mov edi, eax
cmp edi, 0xffffffff
jne 0x647048
push ebx
call sub.kernel32.dll_CloseHandle_1
jmp 0x6471b2
xor eax, eax
mov dword [ebp - 0x1c], eax
mov eax, ebx
call fcn.00646efc
mov esi, eax
cmp esi, 1
je 0x647060
cmp esi, 2
jne 0x647069
mov dword [ebp - 0x1c], 2
jmp 0x647075
cmp esi, 3
jne 0x647075
mov dword [ebp - 0x1c], 3
mov eax, edi
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
push 0
push 0
mov eax, dword [ebp - 0x1c]
push eax
push ebx
call sub.kernel32.dll_SetFilePointer_1
cmp edi, 0xffffffff
je 0x6471ac
cmp dword [ebp - 0x24], 0
jle 0x6471ac
cmp esi, 1
je 0x6470a8
cmp esi, 2
jne 0x647108
mov edx, dword [ebp - 0x24]
sar edx, 1
jns 0x6470b2
adc edx, 0
lea eax, [ebp - 8]
call fcn.0040a76c
mov eax, dword [ebp - 8]
test eax, eax
je 0x6470c6
sub eax, 4
mov eax, dword [eax]
push 0
lea edx, [ebp - 0x20]
push edx
add eax, eax
push eax
mov eax, dword [ebp - 8]
push eax
push ebx
call sub.kernel32.dll_ReadFile_1
mov edx, dword [ebp - 0x20]
shr edx, 1
lea eax, [ebp - 8]
call fcn.0040a76c
cmp esi, 2
jne 0x6470f8
mov eax, dword [ebp - 8]
call fcn.0040a5d8
call fcn.00644c34
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 8]
call fcn.00409bc8
jmp 0x6471ac
cmp esi, 3
jne 0x647153
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0x24]
call fcn.0040a2f4
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 0xc]
push eax
push ebx
call sub.kernel32.dll_ReadFile_1
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0x20]
call fcn.0040a2f4
lea edx, [ebp - 0x10]
mov eax, dword [ebp - 0xc]
call fcn.0040d764
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x10]
call fcn.00409bc8
jmp 0x6471ac
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0x24]
call fcn.0040a2f4
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 0xc]
push eax
push ebx
call sub.kernel32.dll_ReadFile_1
lea eax, [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0x20]
call fcn.0040a2f4
cmp dword [ebp - 0x14], 0
je 0x6471a1
cmp dword [ebp - 0x14], 0x4b0
je 0x6471a1
mov ecx, dword [ebp - 0x18]
movzx edx, word [ebp - 0x14]
mov eax, dword [ebp - 0xc]
call fcn.00649a10
jmp 0x6471ac
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0xc]
call fcn.0040a6b0
push ebx
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x6471e4
lea eax, [ebp - 0x10]
call fcn.004097e8
lea eax, [ebp - 0xc]
call fcn.0040980c
lea eax, [ebp - 8]
mov edx, 2
call fcn.00409848
ret