Function at 0x140058160
Capabilities:
Get common file path
Set environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
push r14
push r15
sub rsp, 0x1a0
mov rax, qword [0x140191010]
xor rax, rsp
mov qword [rsp + 0x190], rax
mov rsi, rcx
mov qword [rsp + 0x40], rcx
lea rax, str.san_path_env_7D9669CE_347E_435A_BDF7_DBDBA31FEA91
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x30], rax
xor r15d, r15d
mov qword [rsp + 0x30], r15
mov qword [rsp + 0x38], r15
lea r8, str.PATH
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x30]
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wdupenv_s]
test eax, eax
jne 0x140058250
mov rdx, qword [rsp + 0x30]
test rdx, rdx
je 0x140058250
mov qword [rsp + 0x110], r15
mov qword [rsp + 0x120], r15
mov qword [rsp + 0x128], 7
mov r8, 0xffffffffffffffff
nop
inc r8
cmp word [rdx + r8*2], r15w
jne 0x140058200
lea rcx, [rsp + 0x110]
call fcn.140002ed0
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
movups xmm0, xmmword [rsp + 0x110]
movups xmmword [rsp + 0x130], xmm0
movups xmm1, xmmword [rsp + 0x120]
movups xmmword [rsp + 0x140], xmm1
mov qword [rsp + 0x128], 7
jmp 0x140058275
mov qword [rsp + 0x130], r15
mov qword [rsp + 0x140], r15
mov qword [rsp + 0x148], 7
mov word [rsp + 0x130], r15w
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x80], r15
mov qword [rsp + 0x88], 7
mov word [rsp + 0x70], r15w
mov qword [rsp + 0x178], r15
lea rcx, [rsp + 0x48]
call fcn.140058090
mov qword [rsp + 0x170], r15
movdqa xmm1, xmmword [0x140166c80]
cmp byte [rax + 0x20], 0
je 0x1400582fd
mov qword [rsp + 0xb0], r15
mov qword [rsp + 0xc0], r15
mov qword [rsp + 0xc8], r15
movups xmm0, xmmword [rax]
movups xmmword [rsp + 0xb0], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rsp + 0xc0], xmm1
mov qword [rax + 0x10], r15
mov qword [rax + 0x18], 7
mov word [rax], r15w
jmp 0x140058315
movups xmm0, xmmword [rsp + 0x170]
movups xmmword [rsp + 0xb0], xmm0
movups xmmword [rsp + 0xc0], xmm1
cmp byte [rsp + 0x68], 0
je 0x140058326
lea rcx, [rsp + 0x48]
call fcn.140002de0
cmp qword [rsp + 0xc0], 0
je 0x14005856a
mov qword [rsp + 0xd0], r15
mov qword [rsp + 0xe0], r15
mov qword [rsp + 0xe8], 7
mov word [rsp + 0xd0], r15w
xor r8d, r8d
lea rdx, [0x140162244]
lea rcx, [rsp + 0xd0]
call fcn.140002ed0
nop
lea rdx, [rsp + 0xd0]
lea rcx, [rsp + 0xb0]
call fcn.1400046e0
nop
mov rdx, qword [rsp + 0xe8]
cmp rdx, 8
jb 0x1400583d3
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0xd0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400583ce
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400583ce
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140071e50
lea rbx, [rsp + 0xb0]
cmp qword [rsp + 0xc8], 8
cmovae rbx, qword [rsp + 0xb0]
mov rax, qword [rsp + 0xc0]
lea rdi, [rbx + rax*2]
mov rdx, rdi
mov rcx, rbx
call fcn.1400045e0
cmp rax, rdi
je 0x14005845d
movzx ecx, word [rax]
cmp cx, 0x5c
je 0x140058418
cmp cx, 0x2f
jne 0x140058420
add rax, 2
jmp 0x140058404
lea rdx, [rdi - 2]
movzx ecx, word [rdx]
cmp cx, 0x5c
je 0x14005843d
cmp cx, 0x2f
je 0x14005843d
mov rdi, rdx
cmp rax, rdx
je 0x14005845d
jmp 0x140058420
cmp rax, rdi
je 0x14005845d
lea rdx, [rdi - 2]
movzx ecx, word [rdx]
cmp cx, 0x5c
je 0x140058455
cmp cx, 0x2f
jne 0x14005845d
mov rdi, rdx
cmp rax, rdx
jne 0x140058442
sub rdi, rbx
sar rdi, 1
mov qword [rsp + 0xf0], r15
mov qword [rsp + 0x100], r15
mov qword [rsp + 0x108], 7
mov word [rsp + 0xf0], r15w
mov r8, rdi
mov rdx, rbx
lea rcx, [rsp + 0xf0]
call fcn.140002ed0
nop
lea rdx, [rsp + 0xf0]
lea rcx, [rsp + 0x150]
call fcn.140002b70
mov rdx, qword [rsp + 0x88]
cmp rdx, 8
jb 0x1400584f9
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x70]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400584f4
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400584f4
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140071e50
movups xmm0, xmmword [rsp + 0x150]
movups xmmword [rsp + 0x70], xmm0
movups xmm1, xmmword [rsp + 0x160]
movups xmmword [rsp + 0x80], xmm1
mov qword [rsp + 0x168], 7
mov rdx, qword [rsp + 0x108]
cmp rdx, 8
jb 0x14005856a
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0xf0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140058565
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14005877c
call fcn.140071e50
mov qword [rsp + 0x90], r15
mov qword [rsp + 0xa0], r15
mov qword [rsp + 0xa8], 7
mov word [rsp + 0x90], r15w
lfence
mov ecx, 0x210
call fcn.140002760
mov rdx, rax
mov qword [rsp + 0xa0], operator
mov qword [rsp + 0xa8], operator
movzx eax, r15w
mov rdi, rdx
mov ecx, 0x104
rep stosw word [rdi], ax
mov word [rdx + 0x208], r15w
mov qword [rsp + 0x90], rdx
lea rcx, [rsp + 0x90]
cmp qword [rsp + 0xa8], 8
cmovae rcx, rdx
mov edx, 0x104
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
cmp eax, 0x104
jae 0x140058701
mov rbx, qword [rsp + 0x80]
test rbx, rbx
je 0x140058679
mov rdx, qword [rsp + 0x88]
mov rax, rdx
sub rax, rbx
cmp rax, 1
jb 0x14005864d
lea rcx, [rbx + 1]
mov qword [rsp + 0x80], rcx
lea rax, [rsp + 0x70]
cmp rdx, 8
cmovae rax, qword [rsp + 0x70]
mov edx, 0x3b
mov word [rax + rbx*2], dx
mov word [rax + rcx*2], r15w
jmp 0x140058671
lfence
mov qword [rsp + 0x20], 1
lea r9, [0x1401661d0]
xor r8d, r8d
lea edx, [r8 + 1]
lea rcx, [rsp + 0x70]
call fcn.1400039f0
mov rbx, qword [rsp + 0x80]
mov r14, qword [rsp + 0xa0]
lea r9, [rsp + 0x90]
cmp qword [rsp + 0xa8], 8
cmovae r9, qword [rsp + 0x90]
mov rcx, qword [rsp + 0x88]
mov rax, rcx
sub rax, rbx
cmp r14, rax
ja 0x1400586e4
lea rax, [rbx + r14]
mov qword [rsp + 0x80], rax
lea rdi, [rsp + 0x70]
cmp rcx, 8
cmovae rdi, qword [rsp + 0x70]
lea rcx, [rdi + rbx*2]
lea r8, [r14 + r14]
mov rdx, r9
call sub.VCRUNTIME140.dll_memmove
lea rax, [r14 + rbx]
mov word [rdi + rax*2], r15w
jmp 0x140058701
lfence
mov rdx, qword [rsp + 0xa0]
mov qword [rsp + 0x20], rdx
xor r8d, r8d
lea rcx, [rsp + 0x70]
call fcn.1400039f0
lea rdx, [rsp + 0x70]
cmp qword [rsp + 0x88], 8
cmovae rdx, qword [rsp + 0x70]
lea rcx, str.PATH
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
movups xmm0, xmmword [rsp + 0x130]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rsp + 0x140]
movups xmmword [rsi + 0x10], xmm1
mov byte [rsi + 0x20], 1
mov rdx, qword [rsp + 0xa8]
cmp rdx, 8
jb 0x140058788
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x90]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140058783
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140058783
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140071e50
mov qword [rsp + 0xa0], r15
mov qword [rsp + 0xa8], 7
mov word [rsp + 0x90], r15w
mov rdx, qword [rsp + 0xc8]
cmp rdx, 8
jb 0x1400587f0
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0xb0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400587eb
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400587eb
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140071e50
mov qword [rsp + 0xc0], r15
mov qword [rsp + 0xc8], 7
mov word [rsp + 0xb0], r15w
mov rdx, qword [rsp + 0x88]
cmp rdx, 8
jb 0x140058856
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x70]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140058850
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140058850
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140071e50
nop
mov rax, rsi
jmp 0x140058860
mov rcx, qword [rsp + 0x190]
xor rcx, rsp
call fcn.140071e30
lea r11, [rsp + 0x1a0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r15
pop r14
pop rdi
ret