Function at 0x10003930
Capabilities:
Get file size
Read file via mapping
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 4], 0
cmp dword [ebp + 0x20], 0
jne 0x10003967
mov eax, dword [ebp + 0x14]
and eax, 4
je 0x10003970
mov dword [ebp + 0x10], 0xffffffff
jmp 0x100039a3
push 0
push 0
push 0
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x10003993
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x100039a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
xor eax, eax
jmp 0x10003b9d
cmp dword [ebp + 8], 0xffffffff
jne 0x100039b8
push 6
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x10003b9d
xorps xmm0, xmm0
movlpd qword [ebp - 0x2c], xmm0
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x100039ea
cmp dword [ebp + 0xc], 0xffffffff
je 0x100039f1
lea edx, [ebp - 0x2c]
push edx
mov eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x100039f1
xor eax, eax
jmp 0x10003b9d
push 0
push 0
push 0
push 2
push 0
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x10003a15
xor eax, eax
jmp 0x10003b9d
cmp dword [ebp + 0xc], 0xffffffff
je 0x10003a46
push 0
push 0
push 0
push 2
push 0
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x10003a46
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x10003b86
mov eax, dword [ebp - 0x3c]
push eax
push 0
push 0
push 4
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x10003a71
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x10003b76
mov edx, dword [ebp - 0x2c]
or edx, dword [ebp - 0x28]
je 0x10003aa4
mov eax, dword [ebp - 0x2c]
push eax
push 0
push 0
push 4
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x10003aa4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x10003b6c
mov edx, dword [ebp + 0x20]
push edx
mov eax, dword [ebp + 0x1c]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp + 0x14]
push edx
lea eax, [ebp - 0x34]
push eax
lea ecx, [ebp - 0x24]
push ecx
push 0
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.100035c0
add esp, 0x30
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x10003ae5
jmp 0x10003b45
mov dword [ebp - 0x14], 1
cmp dword [ebp + 0x10], 0xffffffff
je 0x10003b45
mov dword [ebp - 0x20], 0
push 0
lea ecx, [ebp - 0x20]
push ecx
mov edx, dword [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x10003b25
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x10003b45
cmp dword [ebp - 0x34], 0
jne 0x10003b31
cmp dword [ebp - 0x30], 0
je 0x10003b45
lea edx, [ebp - 0x34]
push edx
push 0
lea eax, [ebp - 0x34]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp - 0x10], 0
je 0x10003b5c
push 0x8000
push 0
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [ebp - 8], 0
je 0x10003b6c
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0xc], 0
je 0x10003b86
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp - 0x14]
mov esp, ebp
pop ebp
ret