Function at 0x140001768
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.140007230
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 0x1400017ff
mov rbx, rbp
inc rbx
cmp word [rdi + rbx*2], r14w
jne 0x1400017d5
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007230
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 0x140001817
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007230
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, [0x14002faa4]
mov rdx, r13
call fcn.140007500
inc eax
movsxd rbx, eax
lea rcx, [rbx + rbx]
call fcn.140007230
mov rcx, qword [r13 + 0x38]
lea r8, [0x14002faa4]
mov qword [rsp + 0x20], rcx
mov r9, r13
mov rcx, rax
mov qword [rsp + 0x48], rax
mov rdx, rbx
call fcn.1400079d0
mov rdx, qword [0x14005e2b0]
test rdx, rdx
je 0x140001968
lea r12, [0x14005ead0]
mov word [0x14005ead0], r14w
mov rcx, r12
call fcn.1400016bc
movzx eax, word [0x14002fdac]
lea rsi, [0x14002fa88]
lea rdi, [0x14002fdac]
mov rbx, r14
movzx edx, ax
mov rcx, r12
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
jne 0x140001d7d
add rdi, 2
movzx eax, word [rdi]
test ax, ax
jne 0x1400018c4
mov edi, 0x2e
test rbx, rbx
jne 0x140001d59
mov rbx, r12
mov edx, edi
mov rcx, rbx
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x140001d43
lea rax, [rsp + 0x70]
mov word [rax], di
mov ecx, 0x70
add rax, 2
cmp cx, 0x2c
je 0x140001934
add rsi, 2
mov word [rax], cx
add rax, 2
movzx ecx, word [rsi]
test cx, cx
jne 0x14000191b
mov word [rax], r14w
mov rbx, rbp
inc rbx
cmp word [r12 + rbx*2], r14w
jne 0x14000193b
inc rbx
lea rcx, [rbx + rbx]
call fcn.140007230
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 0x140001994
inc rax
cmp word [rcx + rax*2], r14w
jne 0x140001976
mov rcx, qword [rdi + 0x20]
add rbx, 2
add rbx, rax
test rcx, rcx
jne 0x1400019ae
mov rdi, qword [rdi + 8]
test rdi, rdi
je 0x1400019ce
mov rcx, rdi
call fcn.140001d90
test al, al
je 0x140001990
mov rcx, qword [rdi + 0x18]
mov rax, rbp
jmp 0x140001976
test byte [rdi], 0x20
jne 0x14001eac0
call fcn.1400077b0
movsxd rcx, eax
add rbx, rcx
inc rcx
cmp rsi, rcx
cmovb rsi, rcx
jmp 0x140001990
cmp qword [0x14005f330], r14
jne 0x1400019db
add rbx, 4
lea rcx, [rsi + rsi]
add rbx, 3
call fcn.140007230
lea rcx, [rbx + rbx]
mov qword [rsp + 0x30], rax
mov r12, rax
call fcn.140007230
xor r8d, r8d
mov rdi, rax
mov word [rax], r14w
mov r14, rax
mov rsi, qword [r13 + 8]
test rsi, rsi
je 0x140001aae
mov r15, qword [rsp + 0x60]
mov rbp, r12
xor r12d, r12d
mov rcx, rsi
call fcn.140001d90
test al, al
je 0x140001a94
mov rax, r14
lea r8, [0x14002faa0]
sub rax, rdi
mov rdx, rbx
sar rax, 1
mov rcx, r14
sub rdx, rax
call fcn.140007250
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.140007250
mov rdx, qword [rsi + 0x20]
mov r14, rax
test rdx, rdx
jne 0x140001d0a
mov rax, r14
lea r8, [0x14002ff20]
sub rax, rdi
mov rdx, rbx
sar rax, 1
mov rcx, r14
sub rdx, rax
call fcn.140007250
mov r14, rax
mov rsi, qword [rsi + 8]
test rsi, rsi
jne 0x140001a1e
mov r15, qword [rsp + 0x40]
or rbp, 0xffffffffffffffff
mov r12, qword [rsp + 0x30]
xor r8d, r8d
cmp qword [0x14005f330], r8
jne 0x140001b0e
mov rcx, qword [r13 + 0x38]
mov edx, dword [rcx + 0x28]
test edx, edx
je 0x14001eb14
sub edx, 1
jne 0x14001eb03
lea r8, [0x14002fa90]
mov rax, r14
mov rdx, rbx
sub rax, rdi
mov rcx, r14
sar rax, 1
sub rdx, rax
call fcn.140007250
mov rcx, rax
lea r8, [0x14002ff20]
sub rcx, rdi
mov rdx, rbx
sar rcx, 1
sub rdx, rcx
mov rcx, rax
call fcn.140007250
mov r14, rax
mov rax, r14
lea r8, [0x14002fa98]
sub rax, rdi
mov rcx, r14
sar rax, 1
sub rbx, rax
mov rdx, rbx
call fcn.140007250
mov rsi, qword [rsp + 0x38]
xor ebx, ebx
cmp dword [0x14006141c], ebx
jne 0x14001eb20
mov r14, qword [rsp + 0x48]
mov r13, qword [rsp + 0x50]
cmp dword [0x140061388], ebx
jne 0x14001ebf6
call fcn.140001e88
lea rcx, [0x140060290]
test al, al
je 0x14001ebcb
mov r8d, 0x10
lea rdx, [0x14002fb1c]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfsopen]
mov rbx, rax
test rax, rax
je 0x14001ebcb
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 0x14001ebcb
mov r8, rdi
lea rdx, [0x14002ff18]
mov rcx, rbx
call fcn.140001f2c
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 0x140001bc8
lea rax, [0x140060290]
mov edx, 0x10e
lea r9, [rbp + 1]
mov qword [rsp + 0x20], rax
lea r8, str._x__s
lea rcx, [rsp + 0x70]
call fcn.140002e0c
xor ebp, ebp
test rsi, rsi
je 0x140001c16
mov rdx, rsi
lea rcx, str.ENC_CWD
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001ebe3
mov rdx, r13
lea rcx, str.ENC_CL
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001ebe3
mov rdx, r14
lea rcx, str.ENC_SRC
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001ebe3
test r15, r15
je 0x140001c63
mov rdx, r15
lea rcx, str.ENC_PDB
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001ebe3
lea rdx, [rsp + 0x70]
lea rcx, str.ENC_CMD
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x14001ebe3
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r15, r15
je 0x140001c94
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r14, r14
je 0x140001ca2
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r13, r13
je 0x140001cb0
mov rcx, r13
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test rsi, rsi
je 0x140001cbe
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r12, r12
je 0x140001ccc
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 0x140001cdf
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.140011450
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 0x14001ead7
call fcn.140007290
mov r8, rbp
mov rdx, r12
mov rcx, r14
call fcn.140007250
xor r12d, r12d
mov r14, rax
jmp 0x140001a73
mov rax, rbp
inc rax
cmp word [r12 + rax*2], r14w
jne 0x140001d46
lea rax, [r12 + rax*2]
jmp 0x14000190f
cmp word [rbx + 2], r14w
jne 0x1400018f6
lea r8, str.vc140
mov edx, 0x400
mov rcx, r12
call fcn.140006098
jmp 0x14000190f
test rbx, rbx
jne 0x14001eab2
mov rbx, rax
jmp 0x1400018d9
cmp rax, rbx
jbe 0x1400018d9
jmp 0x140001d86
mov r8, qword [r13 + 0x38]
mov rdx, r13
call fcn.140007500
movsxd rcx, eax
add rbx, rcx
jmp 0x140001990
mov rax, qword [r13 + 0x38]
mov r8, rdx
mov edx, 0x400
mov qword [rsp + 0x20], rax
mov r9, r13
call fcn.1400079d0
mov rdx, rbp
mov rcx, r15
call fcn.140007290
mov r8, r15
jmp 0x140001d2d
sub edx, 1
je 0x140001acf
sub edx, 1
jmp 0x140001acf
lea r8, [0x140053f88]
jmp 0x140001ad6
test rsi, rsi
je 0x14001eb40
mov r9, rsi
lea r8, str.ENC_CWD
lea rdx, str._s_s_n
mov ecx, 2
call fcn.140007ecc
mov r13, qword [rsp + 0x50]
test r13, r13
je 0x14001eb65
mov r9, r13
lea r8, str.ENC_CL
lea rdx, str._s_s_n
mov ecx, 2
call fcn.140007ecc
mov r14, qword [rsp + 0x48]
test r14, r14
je 0x14001eb8a
mov r9, r14
lea r8, str.ENC_SRC
lea rdx, str._s_s_n
mov ecx, 2
call fcn.140007ecc
test r15, r15
je 0x14001ebaa
mov r9, r15
lea r8, str.ENC_PDB
lea rdx, str._s_s_n
mov ecx, 2
call fcn.140007ecc
mov r9, rdi
lea r8, str.ENC_CMD
lea rdx, str._s_s_n
mov ecx, 2
call fcn.140007ecc
nop
jmp 0x140001b49
mov rbx, qword [rsp + 0x58]
mov ecx, 0x1f72
mov rdx, rbx
call fcn.14000c824
nop
jmp 0x140001bc6
mov rdx, rbx
mov ecx, 0x1f5d
call fcn.14000c824
nop
jmp 0x140001c7d
xor ebp, ebp
jmp 0x140001c7d