Function at 0x140039800
Capabilities:
Check mutex on windows
Get common file path
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0x2e0
mov qword [rsp + 0x98], 0xfffffffffffffffe
mov rax, qword [0x1401f3f10]
xor rax, rsp
mov qword [rsp + 0x2d0], rax
mov eax, 1
mov rcx, qword [rsp + 0x2f0]
mov word [rcx + 0x38], ax
lea rdx, [0x140141888]
lea rcx, [rsp + 0x68]
call fcn.140030130
nop
mov rax, qword [rsp + 0x2f0]
add rax, 0x20
mov rdx, rax
lea rcx, [rsp + 0x68]
call fcn.1400305f0
mov dword [rsp + 0x5c], Ordinal_265
xor eax, eax
mov word [rsp + 0xc0], ax
lea rax, [rsp + 0xc2]
mov rdi, rax
xor eax, eax
mov ecx, Ordinal_521
rep stosb byte [rdi], al
lea rdx, [rsp + 0xc0]
mov ecx, dword [rsp + 0x5c]
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x1400398c3
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
lea rdx, [rsp + 0xc0]
mov rcx, rax
call fcn.140030410
jmp 0x1400398e0
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
lea rdx, [0x140141898]
mov rcx, rax
call fcn.140030410
lea rdx, str._TMP
lea rcx, [rsp + 0xa0]
call fcn.140030130
nop
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
lea rdx, [rsp + 0xa0]
mov rcx, rax
call fcn.1400305f0
nop
lea rcx, [rsp + 0xa0]
call fcn.140030070
mov rax, qword [rsp + 0x2f0]
add rax, 0x20
mov rcx, qword [rsp + 0x2f0]
add rcx, 0x88
mov rdx, rax
call fcn.1400305f0
lea rdx, str.MUTEX_
lea rcx, [rsp + 0x80]
call fcn.140030130
nop
mov rax, qword [rsp + 0x2f0]
add rax, 0x20
mov rdx, rax
lea rcx, [rsp + 0x80]
call fcn.1400305f0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x40], 0xffffffffffffffff
lea rcx, [rsp + 0x68]
call fcn.140030730
mov r8, rax
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [rsp + 0x50], rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x4c], eax
cmp dword [rsp + 0x4c], 0xb7
jne 0x1400399ca
mov edx, 0x7d0
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea rcx, [rsp + 0x80]
call fcn.140030730
mov r8, rax
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov rcx, qword [rsp + 0x2f0]
mov qword [rcx + 0xa0], rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x4c], eax
cmp dword [rsp + 0x4c], 0xb7
jne 0x140039b62
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
mov rcx, rax
call fcn.140030730
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x80000000
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x40], rax
cmp qword [rsp + 0x40], 0xffffffffffffffff
je 0x140039aa8
mov dword [rsp + 0x58], 0
mov rax, qword [rsp + 0x2f0]
add rax, 0x38
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x58]
mov r8d, 2
mov rdx, rax
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
mov rax, qword [rsp + 0x2f0]
movzx eax, word [rax + 0x38]
inc ax
mov rcx, qword [rsp + 0x2f0]
mov word [rcx + 0x38], ax
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
mov rcx, rax
call fcn.140030730
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x40], rax
cmp qword [rsp + 0x40], 0xffffffffffffffff
je 0x140039b5d
mov dword [rsp + 0x64], 0
mov rax, qword [rsp + 0x2f0]
add rax, 0x38
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x64]
mov r8d, 2
mov rdx, rax
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
jmp 0x140039bfc
mov rax, qword [rsp + 0x2f0]
add rax, 0x88
mov rcx, rax
call fcn.140030730
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x40], rax
cmp qword [rsp + 0x40], 0xffffffffffffffff
je 0x140039bfc
mov dword [rsp + 0x60], 0
mov rax, qword [rsp + 0x2f0]
add rax, 0x38
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x60]
mov r8d, 2
mov rdx, rax
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
jmp 0x140039bfe
cmp qword [rsp + 0x50], 0
je 0x140039c1c
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rsp + 0x40], 0xffffffffffffffff
je 0x140039c38
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
mov rax, qword [rsp + 0x2f0]
movzx eax, word [rax + 0x38]
mov word [rsp + 0x48], ax
lea rcx, [rsp + 0x80]
call fcn.140030070
nop
lea rcx, [rsp + 0x68]
call fcn.140030070
movzx eax, word [rsp + 0x48]
mov rcx, qword [rsp + 0x2d0]
xor rcx, rsp
call fcn.14010f170
add rsp, 0x2e0
pop rdi
ret