Function at 0x1400038f0
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get program files directory
Query environment variable
Set current directory

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
push rbp
lea rbp, [rax - 0x358]
sub rsp, 0x450
mov rax, qword [0x1403eab08]
xor rax, rsp
mov qword [rbp + 0x340], rax
mov rcx, qword [0x1403f32b0]
mov edx, 1
lea r8d, [rdx + 9]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
xor esi, esi
test rax, rax
je 0x140003b48
mov rcx, qword [0x1403f32b0]
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_LoadResource]
test rax, rax
je 0x140003b48
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LockResource]
mov r8d, 0x1474
lea rcx, [0x1403f34d0]
mov rdx, rax
call fcn.140259ee0
lea rbx, [0x1403f37d8]
mov rcx, rbx
call fcn.1402823bc
test rax, rax
jne 0x14000399d
mov edi, 0x104
mov rcx, rbx
mov edx, edi
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x1400039d9
mov rdx, rbx
lea rcx, [rsp + 0x20]
call fcn.140281940
mov edi, 0x104
lea rcx, [rsp + 0x20]
mov r8d, edi
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x1400039d1
lea rdx, [rsp + 0x20]
mov rcx, rbx
call fcn.140281940
mov rcx, rbx
call fcn.140002a48
mov ecx, dword [0x1403f3bf8]
test ecx, ecx
je 0x140003ac0
lea rbx, [0x1403f35d0]
sub ecx, 1
je 0x1400039fd
cmp ecx, 1
je 0x140003a47
jmp 0x140003b29
mov rdx, rbx
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
xor r9d, r9d
mov dword [0x1403e9104], 1
lea rdx, [rbp + 0x130]
xor ecx, ecx
lea r8d, [r9 + 0x26]
call qword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea rdx, [rbp + 0x130]
mov rcx, rbx
call fcn.14025a5a8
test rax, rax
je 0x140003b29
mov word [0x1403f35d0], si
mov rcx, rbx
call fcn.1402823bc
lea rcx, [rsp + 0x20]
test rax, rax
jne 0x140003a79
mov edx, edi
call qword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
lea rdx, str.:Temp
mov word [rsp + 0x22], si
lea rcx, [rsp + 0x20]
call fcn.1402818dc
jmp 0x140003aea
mov rdx, rbx
call fcn.140281940
mov r8d, edi
lea rcx, [rsp + 0x20]
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x140003aa3
lea rdx, [rsp + 0x20]
mov rcx, rbx
call fcn.140281940
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x140003b1f
mov rcx, rbx
call fcn.140002a48
mov dword [0x1403e9104], esi
jmp 0x140003b29
mov edx, edi
lea rcx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
lea rdx, str.:Temp
mov word [rsp + 0x22], si
lea rcx, [rsp + 0x20]
call fcn.1402818dc
lea rbx, [0x1403f35d0]
lea rdx, [rsp + 0x20]
mov rcx, rbx
call fcn.140281940
mov rcx, rbx
call fcn.140002a48
test eax, eax
jne 0x140003b1f
lea rcx, [0x1403f3bfc]
call fcn.1402823bc
test rax, rax
jne 0x140003b3c
mov rdx, rbx
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov dword [0x1403e9104], 1
lea rcx, [0x1403f3c7c]
call fcn.140002b54
mov eax, 1
jmp 0x140003b4a
lea rcx, str.Cannot_create_temporary_folder__please_repackage_with_a_specific_folder._n
call fcn.140268420
xor eax, eax
mov rcx, qword [rbp + 0x340]
xor rcx, rsp
call fcn.140257b10
lea r11, [rsp + 0x450]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov rsp, r11
pop rbp
ret