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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x28]
test edi, edi
jne 0x10013209
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push edi
call fcn.10016bc0
add esp, 4
test eax, eax
jne 0x1001321e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebx, dword [esp + 0x34]
test ebx, ebx
jg 0x10013230
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [edi]
mov dword [esp + 0x10], 0
cmp eax, 1
jne 0x1001330e
mov edi, dword [edi + 4]
push eax
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x28], ebp
jne 0x10013267
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push edi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
sub esi, ebx
sub esi, ebp
test esi, esi
jle 0x100132fb
push esi
call fcn.10017949
add esp, 4
mov ebp, eax
push 1
push 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call ebx
lea eax, [esp + 0x18]
push 0
push eax
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100132c2
push ebp
call fcn.10017caf
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x28]
push 0
push 0
push ecx
push edi
call ebx
lea edx, [esp + 0x18]
push 0
push edx
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100132e6
mov dword [esp + 0x10], eax
push ebp
call fcn.10017caf
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x100134b9
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 2
jne 0x1001338f
mov esi, dword [edi + 4]
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0x14]
mov ecx, esi
mov ebp, eax
call fcn.10016bb0
mov edi, eax
mov dword [esp + 0x10], 1
sub edi, ebx
sub edi, ebp
test edi, edi
jle 0x1001337b
mov edx, dword [esi]
push 1
push ebx
mov ecx, esi
call dword [edx + 0x18]
push edi
call fcn.10017949
add esp, 4
mov ebx, eax
mov eax, dword [esi]
mov ecx, esi
push edi
push ebx
call dword [eax + 0x20]
mov edx, dword [esi]
push 0
push ebp
mov ecx, esi
call dword [edx + 0x18]
mov eax, dword [esi]
push edi
push ebx
mov ecx, esi
call dword [eax + 0x24]
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0x14]
push ebx
mov ebp, eax
call fcn.10017caf
add esp, 4
mov eax, dword [esi]
push ebp
mov ecx, esi
call dword [eax + 0x1c]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 3
jne 0x100134b9
mov esi, dword [edi + 4]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x100133bb
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push esi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esp + 0x14]
mov ebp, eax
sub ebp, ebx
sub ebp, ecx
test ebp, ebp
jle 0x100134b2
push ebp
call fcn.10017949
mov ecx, dword [esp + 0x38]
add esp, 4
mov ebx, eax
push 1
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea edx, [esp + 0x18]
push 0
push edx
push ebp
push ebx
push esi
mov dword [esp + 0x3c], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x10013431
push ebx
call fcn.10017caf
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebp, dword [esp + 0x18]
lea eax, [edi + 0x10]
push eax
mov eax, dword [edi + 0xc]
lea ecx, [edi + 0x34]
push eax
mov dword [esp + 0x24], ecx
push ecx
mov ecx, dword [esp + 0x34]
push ebp
push ebx
push ecx
call fcn.10016390
mov edx, dword [esp + 0x2c]
add esp, 0x18
push 0
push 0
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x1c]
lea ecx, [edi + 0x10]
push ecx
mov ecx, dword [edi + 0xc]
push ecx
push edx
push ebp
push ebx
push eax
call fcn.10016390
add esp, 0x18
lea eax, [esp + 0x18]
push 0
push eax
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100134a1
mov dword [esp + 0x10], eax
push ebx
call fcn.10017caf
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x100134b9
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret