Function at 0x140040000
Capabilities:
Get common file path
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x3a0]
sub rsp, 0x4a0
mov rax, qword [0x1400cc0b8]
xor rax, rsp
mov qword [rbp + 0x390], rax
mov rdi, rdx
mov r13, rcx
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp - 0x70]
call fcn.14006f000
xor ebx, ebx
mov dword [rsp + 0x78], ebx
mov qword [rsp + 0x40], 0x38
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x50], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x60], xmm1
mov qword [rsp + 0x70], rbx
lea rsi, [r13 + 0x50]
mov r8, rsi
lea rdx, [rsp + 0x78]
mov rcx, r13
call fcn.1400403a0
mov r14, rax
test rax, rax
je 0x140040312
test rdi, rdi
jne 0x14004034f
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp + 0x190]
call fcn.14006f000
lea rdx, [rbp + 0x190]
mov ecx, 0x100
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
lea r9, [rbp - 0x70]
xor r8d, r8d
lea rdx, str.ImageManifest
lea rcx, [rbp + 0x190]
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x1400400e5
mov eax, 0xc0150002
jmp 0x140040314
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
mov edx, 0x120116
lea rcx, [rbp - 0x70]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
test rax, rax
setg sil
test rax, rax
jle 0x14004033e
mov dword [rbp - 0x80], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rbp - 0x80]
mov r8d, dword [rsp + 0x78]
mov rdx, r14
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
test sil, sil
je 0x140040149
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x78], rbx
lea rax, [rbp - 0x70]
mov qword [rsp + 0x48], rax
lea r14, [r13 + 0x118]
lea rax, [rbp - 0x70]
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp word [rax + rdi*2], 0
jne 0x140040170
mov r12, qword [r14 + 0x18]
cmp rdi, r12
ja 0x1400401ae
mov rsi, r14
cmp r12, 8
jb 0x14004018f
mov rsi, qword [r14]
mov qword [r14 + 0x10], rdi
add rdi, rdi
mov r8, rdi
lea rdx, [rbp - 0x70]
mov rcx, rsi
call fcn.14006e930
mov word [rdi + rsi], bx
jmp 0x1400402c9
movabs r15, 0x7ffffffffffffffe
cmp rdi, r15
ja 0x140040393
mov rcx, rdi
or rcx, 7
cmp rcx, r15
jbe 0x1400401dd
movabs rax, 0x7fffffffffffffff
lea rcx, [rax + rax]
jmp 0x14004022f
mov rdx, r12
shr rdx, 1
mov rax, r15
sub rax, rdx
cmp r12, rax
jbe 0x1400401fe
movabs rax, 0x7fffffffffffffff
lea rcx, [rax + rax]
jmp 0x14004022f
lea rax, [rdx + r12]
mov r15, rcx
cmp rcx, rax
cmovb r15, rax
lea rcx, [r15 + 1]
movabs rax, 0x7fffffffffffffff
cmp rcx, rax
ja 0x14004038d
add rcx, rcx
cmp rcx, 0x1000
jb 0x14004025b
lea rax, [rcx + 0x27]
cmp rax, rcx
jbe 0x14004038d
mov rcx, rax
call fcn.14006c558
test rax, rax
je 0x140040399
lea rsi, [rax + 0x27]
and rsi, 0xffffffffffffffe0
mov qword [rsi - 8], rax
jmp 0x14004026d
test rcx, rcx
je 0x14004026a
call fcn.14006c558
mov rsi, rax
jmp 0x14004026d
mov rsi, rbx
mov qword [r14 + 0x10], rdi
mov qword [r14 + 0x18], r15
add rdi, rdi
mov r8, rdi
lea rdx, [rbp - 0x70]
mov rcx, rsi
call fcn.14006e930
mov word [rdi + rsi], bx
cmp r12, 8
jb 0x1400402c6
mov rcx, qword [r14]
lea rdx, [r12*2 + 2]
cmp rdx, 0x1000
jb 0x1400402c1
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140040399
mov rcx, r8
call fcn.14006c550
mov qword [r14], rsi
lea rsi, [r13 + 0x50]
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CreateActCtxW]
mov rdi, rax
mov rcx, qword [r13 + 0x48]
cmp rax, rcx
je 0x1400402f6
test rcx, rcx
jle 0x1400402ef
call qword [sym.imp.KERNEL32.dll_ReleaseActCtx]
mov qword [r13 + 0x48], rdi
mov rcx, rdi
test rcx, rcx
jg 0x140040312
mov rax, qword gs:[0x30]
cmp dword [rax + 0x1250], 0xc0000022
jne 0x14004037c
mov dword [rsi], ebx
xor eax, eax
mov rcx, qword [rbp + 0x390]
xor rcx, rsp
call fcn.14006c530
mov rbx, qword [rsp + 0x4f0]
add rsp, 0x4a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rax, qword gs:[0x30]
mov eax, dword [rax + 0x1250]
jmp 0x140040314
mov dword [rsp + 0x44], 8
movzx eax, word [rsi]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x48], rdi
lea rdx, [r13 + 0xf8]
lea rcx, [r13 + 0x118]
call fcn.140018d78
jmp 0x1400402cd
mov rax, qword gs:[0x30]
mov eax, dword [rax + 0x1250]
jmp 0x140040314
call fcn.140001150
nop
call fcn.1400012b0
int3
call fcn.14007d788
int3