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

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x270
mov rax, qword [0x004bf230]
xor rax, rsp
mov qword [rsp + 0x260], rax
cmp qword [rcx + 0x20], 8
mov rsi, rdx
jb 0x40e72d
mov rcx, qword [rcx + 8]
jmp 0x40e731
add rcx, 8
xor ebx, ebx
xor r9d, r9d
mov edx, 0x80000000
mov qword [rsp + 0x30], rbx
lea r8d, [rbx + 1]
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
cmp rax, 0xffffffffffffffff
jne 0x40e76a
xor eax, eax
jmp 0x40e9d2
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
add eax, 2
mov ecx, eax
mov r13d, eax
call fcn.004444b0
mov rbp, rax
cmp rax, rbx
jne 0x40e797
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40e763
mov r8, r13
xor edx, edx
mov rcx, rax
call fcn.00449860
lea r9, [rsp + 0x44]
mov r8d, edi
mov rdx, rbp
mov rcx, r12
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp eax, ebx
jne 0x40e7d4
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbp
call fcn.00444544
jmp 0x40e763
mov eax, 0xfeff
cmp word [rbp], ax
jne 0x40e9ba
mov r14d, dword [rsp + 0x44]
shr r14d, 1
call fcn.0040e684
cmp eax, 1
jne 0x40e9ba
lea rcx, [rsp + 0x52]
xor edx, edx
mov r8d, 0x20a
mov word [rsp + 0x50], bx
call fcn.00449860
lea rdx, str.guih_globdata.ini
mov r8d, 0x11
mov rcx, rsi
call fcn.00404e54
lea rdx, [rsp + 0x50]
mov ecx, 0x105
call fcn.0040ddbc
cmp eax, ebx
je 0x40e8cf
lea rcx, [rsp + 0x50]
mov edx, 0x106
call fcn.0040dd64
xor eax, eax
or r13, 0xffffffffffffffff
lea rdi, [rsp + 0x50]
mov rcx, r13
repne scasw ax, word [rdi]
mov eax, 0x104
not rcx
dec rcx
cmp rax, rcx
je 0x40e88e
cmp qword [rsi + 0x20], 8
jb 0x40e879
mov r8, qword [rsi + 8]
jmp 0x40e87d
lea r8, [rsi + 8]
lea rcx, [rsp + 0x50]
mov edx, 0x106
call fcn.00444f54
jmp 0x40e8ae
cmp qword [rsi + 0x20], 8
jb 0x40e89b
mov r8, qword [rsi + 8]
jmp 0x40e89f
lea r8, [rsi + 8]
lea rcx, [rsp + 0x50]
mov edx, 0x106
call fcn.004444bc
xor eax, eax
lea rdi, [rsp + 0x50]
mov rcx, r13
repne scasw ax, word [rdi]
lea rdx, [rsp + 0x50]
not rcx
lea r8, [rcx - 1]
mov rcx, rsi
call fcn.00404e54
cmp qword [rsi + 0x20], 8
jb 0x40e8dc
mov rcx, qword [rsi + 8]
jmp 0x40e8e0
lea rcx, [rsi + 8]
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov edx, 0xc0000000
lea r8d, [r9 + 3]
mov dword [rsp + 0x28], 0x80000080
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r13, rax
cmp rax, 0xffffffffffffffff
je 0x40e7ca
lea eax, [r14 + r14]
movsxd rdi, eax
mov rcx, rdi
call fcn.004444b0
mov r8, rdi
xor edx, edx
mov rcx, rax
mov rsi, rax
call fcn.00449860
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], edi
or rdi, 0xffffffffffffffff
lea r8, [rbp + 2]
xor edx, edx
xor ecx, ecx
mov r9d, edi
mov qword [rsp + 0x20], rsi
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rcx, rdi
xor eax, eax
mov rdi, rsi
repne scasb al, byte [rdi]
not rcx
dec rcx
cmp ecx, ebx
jne 0x40e97e
cmp rsi, rbx
je 0x40e9c8
mov rcx, rsi
call fcn.00444544
jmp 0x40e9c8
mov r8d, ecx
lea r9, [rsp + 0x40]
mov rdx, rsi
mov rcx, r13
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp rsi, rbx
je 0x40e9ba
mov rcx, rsi
call fcn.00444544
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, 1
mov rcx, rbp
call fcn.00444544
mov eax, ebx
mov rcx, qword [rsp + 0x260]
xor rcx, rsp
call fcn.00443d60
mov rbx, qword [rsp + 0x2c0]
add rsp, 0x270
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret