Function at 0x100654c0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push esi
xor eax, eax
mov dword [ebp - 0x10], edx
push eax
push 0x80
push 3
push eax
push 1
push SysReAllocString
push ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x10065768
push ebx
push edi
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push ebx
push 0
mov dword [ebp - 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x1006552c
push 0
lea eax, [ebp - 0x20]
push eax
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x10065766
mov eax, dword [edi + 0x14]
test al, 4
je 0x10065552
test al, 8
je 0x10065552
test al, 0x20
je 0x10065552
test al, 0x40
jne 0x10065754
mov ecx, dword [ebp - 0x10]
lea edx, [ecx + 2]
jmp 0x10065560
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10065560
sub ecx, edx
lea eax, [ebx + 8]
sar ecx, 1
mov dword [ebp - 0x14], ecx
lea eax, [eax + ecx*2]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x10065754
mov ecx, dword [edi + 0x14]
lea ebx, [edi + 0x4c]
test cl, 1
je 0x100655a9
movzx eax, word [ebx]
add eax, 2
add ebx, eax
mov eax, dword [ebp - 0xc]
test cl, 2
je 0x100655b0
add ebx, dword [ebx]
mov esi, ebx
sub esi, edi
push esi
push edi
push eax
call fcn.10086400
mov eax, dword [ebp - 8]
add esp, 0xc
mov edi, dword [ebp - 0xc]
add edi, esi
test byte [eax + 0x14], 4
je 0x100655f5
movzx eax, word [ebx]
add ebx, 2
mov word [edi], ax
add edi, 2
lea esi, [eax + eax]
push esi
push ebx
push edi
call fcn.10086400
mov eax, dword [ebp - 8]
add esp, 0xc
add ebx, esi
mov dword [ebp - 4], 4
add edi, esi
test byte [eax + 0x14], 8
jne 0x10065616
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x10065638
mov word [edi], si
add esi, esi
push esi
push dword [ebp - 0x10]
add edi, 2
push edi
call fcn.10086400
jmp 0x1006562f
movzx eax, word [ebx]
add ebx, 2
mov word [edi], ax
add edi, 2
lea esi, [eax + eax]
push esi
push ebx
push edi
call fcn.10086400
add ebx, esi
add esp, 0xc
add edi, esi
or dword [ebp - 4], 8
mov esi, dword [ebp - 8]
test byte [esi + 0x14], 0x10
je 0x10065662
movzx eax, word [ebx]
add ebx, 2
mov word [edi], ax
add edi, 2
lea esi, [eax + eax]
push esi
push ebx
push edi
call fcn.10086400
add ebx, esi
add esp, 0xc
add edi, esi
mov esi, dword [ebp - 8]
test byte [esi + 0x14], 0x20
je 0x10065694
movzx eax, word [ebx]
add ebx, 2
mov word [edi], ax
add edi, 2
lea esi, [eax + eax]
push esi
push ebx
push edi
call fcn.10086400
mov eax, dword [ebp - 4]
add ebx, esi
add edi, esi
add esp, 0xc
mov esi, dword [ebp - 8]
or eax, 0x20
mov dword [ebp - 4], eax
jmp 0x10065697
mov eax, dword [ebp - 4]
test byte [esi + 0x14], 0x40
je 0x100656c7
movzx eax, word [ebx]
add ebx, 2
mov word [edi], ax
add edi, 2
lea esi, [eax + eax]
push esi
push ebx
push edi
call fcn.10086400
mov eax, dword [ebp - 4]
add ebx, esi
add edi, esi
add esp, 0xc
mov esi, dword [ebp - 8]
or eax, 0x40
mov dword [ebp - 4], eax
mov ecx, ebx
sub ecx, esi
mov esi, dword [ebp - 0x18]
mov dword [ebp - 0x14], ecx
cmp esi, ecx
jbe 0x100656ec
mov eax, esi
sub eax, ecx
push eax
push ebx
push edi
call fcn.10086400
sub esi, dword [ebp - 0x14]
add esp, 0xc
mov eax, dword [ebp - 4]
add edi, esi
mov ebx, dword [ebp - 0xc]
push 0
push 0x80
push 2
or dword [ebx + 0x14], eax
push 0
push 0
push 0x40000000
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x1006572c
push 0
lea eax, [ebp - 0x20]
sub edi, ebx
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call esi
mov edi, dword [ebp - 8]
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret