Function at 0x140016ac0
Capabilities:
Get common file path
Query environment variable

Disassembly:
push rbp
push r14
lea rbp, [rsp - 0x5c8]
sub rsp, 0x6c8
mov rax, qword [0x1402a87a8]
xor rax, rsp
mov qword [rbp + 0x5a0], rax
cmp qword [rcx + 8], 0
mov r14, rcx
jne 0x140016b00
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x140017056
cmp dword [rcx + 0x1c], 0
je 0x140016b10
mov eax, 1
jmp 0x140017056
mov qword [rsp + 0x6e8], rbx
mov qword [rsp + 0x6f0], rsi
xor esi, esi
test byte [rcx + 0x28], 0x10
mov ebx, esi
je 0x140016e52
mov ecx, 0x1000
call fcn.1401c591c
mov rbx, rax
test rax, rax
jne 0x140016b50
lea ecx, [rsi + 8]
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x140017046
mov byte [rax], sil
mov r8, qword [r14 + 0x20]
test r8, r8
je 0x140016b7d
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df8]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea rdx, [rbp + 0x1a0]
mov ecx, 0x400
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x140016bd6
lea r8, [rbp + 0x1a0]
mov byte [rbp + 0x59f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
mov r8d, 0x400
lea rdx, [rbp + 0x1a0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x140016ca6
mov rdx, 0xffffffffffffffff
mov byte [rbp + 0x59f], sil
mov rcx, rdx
lea rax, [rbp + 0x1a0]
nop dword [rax + rax]
inc rcx
cmp byte [rax + rcx], sil
jne 0x140016c10
lea rax, [rbp + 0x1a0]
dec rax
add rcx, rax
lea rax, [rbp + 0x1a0]
cmp rcx, rax
jb 0x140016c63
movabs r8, 0x200000000801
nop dword [rax]
movzx eax, byte [rcx]
sub al, 0x2f
cmp al, 0x2d
ja 0x140016c4f
bt r8, rax
jb 0x140016c60
dec rcx
lea rax, [rbp + 0x1a0]
cmp rcx, rax
jae 0x140016c40
jmp 0x140016c63
mov byte [rcx], sil
lea rax, [rbp + 0x1a0]
nop word [rax + rax]
inc rdx
cmp byte [rax + rdx], sil
jne 0x140016c70
test rdx, rdx
je 0x140016ca6
lea r8, [rbp + 0x1a0]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
mov r8d, 0x400
lea rdx, [rbp + 0x1a0]
lea rcx, str._NT_SYMBOL_PATH
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140016cf3
lea r8, [rbp + 0x1a0]
mov byte [rbp + 0x59f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
mov r8d, 0x400
lea rdx, [rbp + 0x1a0]
lea rcx, str._NT_ALTERNATE_SYMBOL_PATH
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140016d40
lea r8, [rbp + 0x1a0]
mov byte [rbp + 0x59f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
mov r8d, 0x400
lea rdx, [rbp + 0x1a0]
lea rcx, str.SYSTEMROOT
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140016dcd
lea r8, [rbp + 0x1a0]
mov byte [rbp + 0x59f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, str._system32
mov edx, 0x400
lea rcx, [rbp + 0x1a0]
call fcn.1401c5924
lea r8, [rbp + 0x1a0]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, [0x140265df4]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
test byte [r14 + 0x28], 0x10
je 0x140016e52
mov r8d, 0x400
lea rdx, [rbp + 0x1a0]
lea rcx, str.SYSTEMDRIVE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edx, 0x1000
mov rcx, rbx
test eax, eax
je 0x140016e46
lea r8, str.SRV
mov byte [rbp + 0x59f], sil
call fcn.1401c5924
lea r8, [rbp + 0x1a0]
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, str.websymbols
mov edx, 0x1000
mov rcx, rbx
call fcn.1401c5924
lea r8, str.http:__msdl.microsoft.com_download_symbols_
mov edx, 0x1000
mov rcx, rbx
jmp 0x140016e4d
lea r8, str.SRVc:websymbolshttp:__msdl.microsoft.com_download_symbols_
call fcn.1401c5924
mov rcx, qword [r14 + 8]
mov rdx, rbx
mov qword [rsp + 0x6f8], rdi
call fcn.140015e60
mov edi, eax
test rbx, rbx
je 0x140016e75
mov rcx, rbx
call fcn.1401bb058
test edi, edi
jne 0x140016ea1
mov rax, qword [r14]
lea rdx, str.Error_while_initializing_dbghelp.dll
xor r9d, r9d
xor r8d, r8d
mov rcx, r14
call qword [rax + 0x20]
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x14001703e
mov eax, dword [r14 + 0x18]
lea rcx, str.kernel32.dll
mov dword [rsp + 0x40], eax
mov rdi, rsi
mov rax, qword [r14 + 0x10]
mov qword [rsp + 0x6c0], r12
mov r12, rsi
mov qword [rsp + 0x30], rax
mov rax, qword [r14 + 8]
mov qword [rsp + 0x6b8], r13
mov r13, rsi
mov qword [rsp + 0x38], rax
lea rax, str.tlhelp32.dll
mov qword [rsp + 0x6b0], r15
mov r15, rsi
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], rcx
mov dword [rsp + 0x60], 0x238
nop
mov rcx, qword [rsp + rdi*8 + 0x48]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rbx, rax
test rax, rax
je 0x140016f67
lea rdx, str.CreateToolhelp32Snapshot
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.Module32First
mov rcx, rbx
mov r13, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.Module32Next
mov rcx, rbx
mov r12, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r15, rax
test r13, r13
je 0x140016f5b
test r12, r12
je 0x140016f5b
test rax, rax
jne 0x140016f70
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rbx, rsi
inc rdi
cmp rdi, 2
jb 0x140016f00
test rbx, rbx
je 0x140017005
mov edx, dword [rsp + 0x40]
mov ecx, 8
call r13
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x140017005
lea rdx, [rsp + 0x60]
mov rcx, rax
call r12
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x38]
test eax, eax
je 0x140016fe8
nop word [rax + rax]
mov ecx, dword [rbp - 0x80]
lea r9, [rbp - 0x70]
mov rax, qword [rsp + 0x78]
lea r8, [rbp + 0x90]
mov dword [rsp + 0x28], ecx
mov rdx, r12
mov rcx, r13
mov qword [rsp + 0x20], rax
call fcn.140016550
lea rdx, [rsp + 0x60]
mov rcx, rdi
inc esi
call r15
test eax, eax
jne 0x140016fb0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
jle 0x14001700f
mov eax, 1
jmp 0x14001701e
mov r13, qword [rsp + 0x38]
mov r12, qword [rsp + 0x30]
mov rdx, r12
mov rcx, r13
call fcn.1400162c0
test eax, eax
je 0x140017026
mov dword [r14 + 0x1c], 1
mov r15, qword [rsp + 0x6b0]
mov r13, qword [rsp + 0x6b8]
mov r12, qword [rsp + 0x6c0]
mov rdi, qword [rsp + 0x6f8]
mov rbx, qword [rsp + 0x6e8]
mov rsi, qword [rsp + 0x6f0]
mov rcx, qword [rbp + 0x5a0]
xor rcx, rsp
call fcn.1401b2f00
add rsp, 0x6c8
pop r14
pop rbp
ret