Function at 0x1400016bc
Capabilities:
Resolve path using msvcrt
Set environment variable

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x2a0
mov rax, qword [0x14005b018]
xor rax, rsp
mov qword [rsp + 0x290], rax
xor r14d, r14d
mov qword [rsp + 0x58], rdx
mov r13, rcx
mov qword [rsp + 0x38], r14
mov ecx, 0x800
mov qword [rsp + 0x40], r14
mov r15d, r14d
call fcn.140007930
mov edx, 0x400
mov qword [rsp + 0x60], rax
mov rcx, rax
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__wgetcwd]
or rbp, 0xffffffffffffffff
test rax, rax
je 0x140001753
mov rbx, rbp
inc rbx
cmp word [rdi + rbx*2], r14w
jne 0x140001729
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007930
mov r8, rdi
mov qword [rsp + 0x38], rax
mov rdx, rbx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x30], r14
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__get_wpgmptr]
mov rdi, qword [rsp + 0x30]
mov rbx, rbp
inc rbx
cmp word [rdi + rbx*2], r14w
jne 0x14000176b
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007930
mov r8, rdi
mov qword [rsp + 0x50], rax
mov rdx, rbx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
mov r8, qword [r13 + 0x38]
lea rcx, [0x14002fa74]
mov rdx, r13
call fcn.140007c00
inc eax
movsxd rbx, eax
lea rcx, [rbx + rbx]
call fcn.140007930
mov rcx, qword [r13 + 0x38]
lea r8, [0x14002fa74]
mov qword [rsp + 0x20], rcx
mov r9, r13
mov rcx, rax
mov qword [rsp + 0x48], rax
mov rdx, rbx
call fcn.1400080d0
mov rdx, qword [0x14005e320]
test rdx, rdx
je 0x1400018bc
lea r12, [0x14005eb40]
mov word [0x14005eb40], r14w
mov rcx, r12
call fcn.140001610
movzx eax, word [0x14002fe34]
lea rsi, [0x14002fa58]
lea rdi, [0x14002fe34]
mov rbx, r14
movzx edx, ax
mov rcx, r12
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
jne 0x140001ccf
add rdi, 2
movzx eax, word [rdi]
test ax, ax
jne 0x140001818
mov edi, 0x2e
test rbx, rbx
jne 0x140001cab
mov rbx, r12
mov edx, edi
mov rcx, rbx
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x140001c95
lea rax, [rsp + 0x70]
mov word [rax], di
mov ecx, 0x70
add rax, 2
cmp cx, 0x2c
je 0x140001888
add rsi, 2
mov word [rax], cx
add rax, 2
movzx ecx, word [rsi]
test cx, cx
jne 0x14000186f
mov word [rax], r14w
mov rbx, rbp
inc rbx
cmp word [r12 + rbx*2], r14w
jne 0x14000188f
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007930
mov r8, r12
mov qword [rsp + 0x40], rax
mov rdx, rbx
mov rcx, rax
mov r15, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
mov rdi, qword [r13 + 8]
mov rbx, r14
mov esi, 0x400
jmp 0x1400018ec
test byte [rdi], 0x20
jne 0x14001ec80
call fcn.140007eb0
movsxd rcx, eax
add rbx, rcx
inc rcx
cmp rsi, rcx
cmovb rsi, rcx
mov rdi, qword [rdi + 8]
test rdi, rdi
je 0x140001920
mov rcx, rdi
call fcn.140001ce0
test al, al
je 0x1400018e8
mov rcx, qword [rdi + 0x18]
mov rax, rbp
inc rax
cmp word [rcx + rax*2], r14w
jne 0x140001904
mov rcx, qword [rdi + 0x20]
add rbx, 2
add rbx, rax
test rcx, rcx
je 0x1400018e8
jmp 0x1400018ca
cmp qword [0x14005f3a0], r14
jne 0x14000192d
add rbx, 4
lea rcx, [rsi + rsi]
add rbx, 3
call fcn.140007930
lea rcx, [rbx + rbx]
mov qword [rsp + 0x30], rax
mov r12, rax
call fcn.140007930
xor r8d, r8d
mov rdi, rax
mov word [rax], r14w
mov r14, rax
mov rsi, qword [r13 + 8]
test rsi, rsi
je 0x140001a00
mov r15, qword [rsp + 0x60]
mov rbp, r12
xor r12d, r12d
mov rcx, rsi
call fcn.140001ce0
test al, al
je 0x1400019e6
mov rax, r14
lea r8, [0x14002fa70]
sub rax, rdi
mov rdx, rbx
sar rax, 1
mov rcx, r14
sub rdx, rax
call fcn.140007950
mov r8, qword [rsi + 0x18]
mov rcx, rax
sub rcx, rdi
mov rdx, rbx
sar rcx, 1
sub rdx, rcx
mov rcx, rax
call fcn.140007950
mov rdx, qword [rsi + 0x20]
mov r14, rax
test rdx, rdx
jne 0x140001c5c
mov rax, r14
lea r8, [0x14002ffa8]
sub rax, rdi
mov rdx, rbx
sar rax, 1
mov rcx, r14
sub rdx, rax
call fcn.140007950
mov r14, rax
mov rsi, qword [rsi + 8]
test rsi, rsi
jne 0x140001970
mov r15, qword [rsp + 0x40]
or rbp, 0xffffffffffffffff
mov r12, qword [rsp + 0x30]
xor r8d, r8d
cmp qword [0x14005f3a0], r8
jne 0x140001a60
mov rcx, qword [r13 + 0x38]
mov edx, dword [rcx + 0x28]
test edx, edx
je 0x14001ecd4
sub edx, 1
jne 0x14001ecc3
lea r8, [0x14002fa60]
mov rax, r14
mov rdx, rbx
sub rax, rdi
mov rcx, r14
sar rax, 1
sub rdx, rax
call fcn.140007950
mov rcx, rax
lea r8, [0x14002ffa8]
sub rcx, rdi
mov rdx, rbx
sar rcx, 1
sub rdx, rcx
mov rcx, rax
call fcn.140007950
mov r14, rax
mov rax, r14
lea r8, [0x14002fa68]
sub rax, rdi
mov rcx, r14
sar rax, 1
sub rbx, rax
mov rdx, rbx
call fcn.140007950
mov rsi, qword [rsp + 0x38]
xor ebx, ebx
cmp dword [0x140061460], ebx
jne 0x14001ece0
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x50]
cmp dword [0x1400613cc], ebx
jne 0x14001edb6
call fcn.140001dd8
lea rcx, [0x1400602a0]
test al, al
je 0x14001ed8b
mov r8d, 0x10
lea rdx, [0x14002faec]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfsopen]
mov rbx, rax
test rax, rax
je 0x14001ed8b
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x40000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
cmp eax, ebp
je 0x14001ed8b
mov r8, rdi
lea rdx, [0x14002ffa0]
mov rcx, rbx
call fcn.140001e7c
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rbx, qword [rsp + 0x58]
xor eax, eax
inc rbp
cmp word [rdi + rbp*2], ax
jne 0x140001b1a
lea rax, [0x1400602a0]
mov edx, 0x10e
lea r9, [rbp + 1]
mov qword [rsp + 0x20], rax
lea r8, str._x__s
lea rcx, [rsp + 0x70]
call fcn.14000350c
xor ebp, ebp
test rsi, rsi
je 0x140001b68
mov rdx, rsi
lea rcx, str.ENC_CWD
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001eda3
mov rdx, r13
lea rcx, str.ENC_CL
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001eda3
mov rdx, r14
lea rcx, str.ENC_SRC
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001eda3
test r15, r15
je 0x140001bb5
mov rdx, r15
lea rcx, str.ENC_PDB
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001eda3
lea rdx, [rsp + 0x70]
lea rcx, str.ENC_CMD
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001eda3
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r15, r15
je 0x140001be6
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r14, r14
je 0x140001bf4
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r13, r13
je 0x140001c02
mov rcx, r13
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test rsi, rsi
je 0x140001c10
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r12, r12
je 0x140001c1e
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword [rsp + 0x60]
test rax, rax
je 0x140001c31
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x290]
xor rcx, rsp
call fcn.140011610
mov rbx, qword [rsp + 0x2f0]
add rsp, 0x2a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rcx, r14
mov r12, rbx
sub rcx, rdi
sar rcx, 1
sub r12, rcx
mov rcx, rbp
test byte [rsi], 0x20
jne 0x14001ec97
call fcn.140007990
mov r8, rbp
mov rdx, r12
mov rcx, r14
call fcn.140007950
xor r12d, r12d
mov r14, rax
jmp 0x1400019c5
mov rax, rbp
inc rax
cmp word [r12 + rax*2], r14w
jne 0x140001c98
lea rax, [r12 + rax*2]
jmp 0x140001863
cmp word [rbx + 2], r14w
jne 0x14000184a
lea r8, str.vc140
mov edx, 0x400
mov rcx, r12
call fcn.14001080c
jmp 0x140001863
test rbx, rbx
jne 0x14001ec72
mov rbx, rax
jmp 0x14000182d
cmp rax, rbx
jbe 0x14000182d
jmp 0x140001cd8
mov r8, qword [r13 + 0x38]
mov rdx, r13
call fcn.140007c00
movsxd rcx, eax
add rbx, rcx
jmp 0x1400018e8
mov rax, qword [r13 + 0x38]
mov r8, rdx
mov edx, 0x400
mov qword [rsp + 0x20], rax
mov r9, r13
call fcn.1400080d0
mov rdx, rbp
mov rcx, r15
call fcn.140007990
mov r8, r15
jmp 0x140001c7f
sub edx, 1
je 0x140001a21
sub edx, 1
jmp 0x140001a21
lea r8, [0x140054588]
jmp 0x140001a28
test rsi, rsi
je 0x14001ed00
mov r9, rsi
lea r8, str.ENC_CWD
lea rdx, str._s_s_n
mov ecx, 2
call fcn.1400085cc
mov r13, qword [rsp + 0x50]
test r13, r13
je 0x14001ed25
mov r9, r13
lea r8, str.ENC_CL
lea rdx, str._s_s_n
mov ecx, 2
call fcn.1400085cc
mov r14, qword [rsp + 0x48]
test r14, r14
je 0x14001ed4a
mov r9, r14
lea r8, str.ENC_SRC
lea rdx, str._s_s_n
mov ecx, 2
call fcn.1400085cc
test r15, r15
je 0x14001ed6a
mov r9, r15
lea r8, str.ENC_PDB
lea rdx, str._s_s_n
mov ecx, 2
call fcn.1400085cc
mov r9, rdi
lea r8, str.ENC_CMD
lea rdx, str._s_s_n
mov ecx, 2
call fcn.1400085cc
nop
jmp 0x140001a9b
mov rbx, qword [rsp + 0x58]
mov ecx, 0x1f72
mov rdx, rbx
call fcn.14000cfa4
nop
jmp 0x140001b18
mov rdx, rbx
mov ecx, 0x1f5d
call fcn.14000cfa4
nop
jmp 0x140001bcf
xor ebp, ebp
jmp 0x140001bcf