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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
or dword [ebp - 0xc], 0xffffffff
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
cmp esi, ebx
je 0x10065e9
mov edi, dword [ebp + 0xc]
cmp edi, ebx
je 0x10065e9
push 0x60c
push ebx
push esi
call sub.msvcrt.dll_memset
add esp, 0xc
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
jne 0x1006450
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push 2
push 0x68
mov dword [ebp - 4], eax
call fcn.01005bde
add esp, 0x10
jmp 0x1006606
lea ecx, [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp + 8], eax
mov ecx, 0x4000000
cmp dword [ebp - 8], ebx
ja 0x10065d2
cmp eax, ecx
ja 0x10065d2
lea edi, [eax + 0x1fff]
shr edi, 0xd
shl edi, 0xd
cmp edi, eax
jae 0x1006486
mov edi, eax
push edi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebx
mov dword [esi], eax
test eax, eax
jne 0x10064bb
push 0x18a
push 2
push 0x66
call fcn.01005bde
add esp, 0xc
mov dword [ebp - 4], 0xe
jmp 0x10065f0
push 0
lea ecx, [ebp - 8]
push ecx
push dword [ebp + 8]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10064f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 4], eax
push 2
push 0x6a
call fcn.01005bde
add esp, 0x10
jmp 0x10065f0
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 8]
mov dword [ebp - 0x10], 0x1000
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_IsTextUnicode]
test eax, eax
jne 0x10065cd
mov eax, dword [esi]
mov dword [ebp + 0xc], eax
push 2
mov eax, edi
pop ecx
mul ecx
mov edi, eax
mov eax, edx
sar eax, 0x1f
test edx, edx
jbe 0x1006541
and dword [esi], 0
push 0x1a0
push ecx
push 0x66
call fcn.01005bde
add esp, 0xc
mov dword [ebp - 4], 0x216
jmp 0x10065b9
push edi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov dword [esi], eax
test eax, eax
jne 0x100656d
push 0x1a6
push 2
push 0x66
call fcn.01005bde
add esp, 0xc
mov dword [ebp - 4], 0xe
jmp 0x10065b9
shr edi, 1
push edi
push eax
push dword [ebp - 8]
push dword [ebp + 0xc]
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 8], eax
cmp eax, 0x459
jne 0x1006594
mov dword [ebp - 4], 0xd
jmp 0x10065a5
test eax, eax
jne 0x10065b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
test eax, eax
je 0x10065b9
push dword [ebp - 4]
push 0x1b3
push 2
push 0x6b
call fcn.01005bde
add esp, 0x10
push dword [ebp + 0xc]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x10065f0
shr dword [ebp - 8], 1
jmp 0x10065f0
push ecx
push edi
push 1
push 0x69
call fcn.01005bde
add esp, 0x10
mov dword [ebp - 4], 0x216
jmp 0x10065f0
mov dword [ebp - 4], 0x57
xor ebx, ebx
cmp dword [ebp - 0xc], ebx
je 0x1006606
cmp dword [ebp - 0xc], 0xffffffff
je 0x1006606
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], ebx
jne 0x100661e
mov eax, dword [esi]
mov ecx, dword [ebp - 8]
lea ecx, [eax + ecx*2]
mov dword [esi + 4], ecx
mov dword [esi + 0xc], eax
mov dword [esi + 0x14], eax
jmp 0x1006624
push esi
call fcn.0100639c
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 8