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

Disassembly:
push rbp
push r14
lea rbp, [rsp - 0x5a8]
sub rsp, 0x6a8
cmp qword [rcx + 8], 0
mov r14, rcx
jne 0x140013bd5
mov ecx, 0x45a
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
add rsp, 0x6a8
pop r14
pop rbp
ret
cmp dword [rcx + 0x1c], 0
je 0x140013beb
mov eax, 1
add rsp, 0x6a8
pop r14
pop rbp
ret
mov qword [rsp + 0x6d8], rbx
mov qword [rsp + 0x6a0], rsi
xor esi, esi
test byte [rcx + 0x28], 0x10
mov ebx, esi
je 0x140013f02
mov ecx, 0x1000
call fcn.14004a95c
mov rbx, rax
test rax, rax
jne 0x140013c2b
lea ecx, [rsi + 8]
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x14001409a
mov byte [rax], sil
mov r8, qword [r14 + 0x20]
test r8, r8
je 0x140013c58
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef4]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea rdx, [rsp + 0x40]
mov ecx, 0x400
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x140013cad
lea r8, [rsp + 0x40]
mov byte [rbp + 0x33f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
mov r8d, 0x400
lea rdx, [rsp + 0x40]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x140013d6a
mov rdx, 0xffffffffffffffff
mov byte [rbp + 0x33f], sil
mov rcx, rdx
lea rax, [rsp + 0x40]
nop
inc rcx
cmp byte [rax + rcx], sil
jne 0x140013ce0
lea rax, [rsp + 0x40]
dec rax
add rcx, rax
lea rax, [rsp + 0x40]
cmp rcx, rax
jb 0x140013d31
movabs r8, 0x200000000801
nop dword [rax + rax]
movzx eax, byte [rcx]
sub al, 0x2f
cmp al, 0x2d
ja 0x140013d1f
bt r8, rax
jb 0x140013d2e
dec rcx
lea rax, [rsp + 0x40]
cmp rcx, rax
jae 0x140013d10
jmp 0x140013d31
mov byte [rcx], sil
lea rax, [rsp + 0x40]
inc rdx
cmp byte [rax + rdx], sil
jne 0x140013d36
test rdx, rdx
je 0x140013d6a
lea r8, [rsp + 0x40]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
mov r8d, 0x400
lea rdx, [rsp + 0x40]
lea rcx, str._NT_SYMBOL_PATH
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140013db3
lea r8, [rsp + 0x40]
mov byte [rbp + 0x33f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
mov r8d, 0x400
lea rdx, [rsp + 0x40]
lea rcx, str._NT_ALTERNATE_SYMBOL_PATH
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140013dfc
lea r8, [rsp + 0x40]
mov byte [rbp + 0x33f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
mov r8d, 0x400
lea rdx, [rsp + 0x40]
lea rcx, str.SYSTEMROOT
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x140013e81
lea r8, [rsp + 0x40]
mov byte [rbp + 0x33f], sil
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, str._system32
mov edx, 0x400
lea rcx, [rsp + 0x40]
call fcn.14004a768
lea r8, [rsp + 0x40]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, [0x140083ef0]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
test byte [r14 + 0x28], 0x20
je 0x140013f02
mov r8d, 0x400
lea rdx, [rsp + 0x40]
lea rcx, str.SYSTEMDRIVE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edx, 0x1000
mov rcx, rbx
test eax, eax
je 0x140013ef6
lea r8, str.SRV
mov byte [rbp + 0x33f], sil
call fcn.14004a768
lea r8, [rsp + 0x40]
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, str.websymbols
mov edx, 0x1000
mov rcx, rbx
call fcn.14004a768
lea r8, str.http:__msdl.microsoft.com_download_symbols_
mov edx, 0x1000
mov rcx, rbx
jmp 0x140013efd
lea r8, str.SRVc:websymbolshttp:__msdl.microsoft.com_download_symbols_
call fcn.14004a768
mov rcx, qword [r14 + 8]
mov rdx, rbx
mov qword [rsp + 0x698], rdi
call fcn.140013380
mov edi, eax
test rbx, rbx
je 0x140013f25
mov rcx, rbx
call fcn.14004a948
test edi, edi
jne 0x140013f51
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 0x140014092
mov rax, qword [r14 + 8]
lea rcx, [0x1400839c0]
mov qword [rbp + 0x5c8], rax
mov rdi, rsi
mov eax, dword [r14 + 0x18]
mov qword [rsp + 0x690], r12
mov r12, rsi
mov dword [rbp + 0x5c0], eax
mov rax, qword [r14 + 0x10]
mov qword [rsp + 0x688], r13
mov r13, rsi
mov qword [rbp + 0x5d0], rax
lea rax, str.tlhelp32.dll
mov qword [rsp + 0x680], r15
mov r15, rsi
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rcx
mov dword [rbp + 0x340], 0x238
nop word [rax + rax]
mov rcx, qword [rsp + rdi*8 + 0x30]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
test rax, rax
je 0x140014027
lea rdx, [0x140083d90]
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 0x14001401b
test r12, r12
je 0x14001401b
test rax, rax
jne 0x140014030
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rbx, rsi
inc rdi
cmp rdi, 2
jb 0x140013fc0
test rbx, rbx
je 0x140014055
mov edx, dword [rbp + 0x5c0]
mov ecx, 8
call r13
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1400140b5
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov r13, qword [rbp + 0x5d0]
mov r12, qword [rbp + 0x5c8]
mov rdx, r13
mov rcx, r12
call fcn.140012a20
test eax, eax
je 0x14001407a
mov dword [r14 + 0x1c], 1
mov r15, qword [rsp + 0x680]
mov r13, qword [rsp + 0x688]
mov r12, qword [rsp + 0x690]
mov rdi, qword [rsp + 0x698]
mov rbx, qword [rsp + 0x6d8]
mov rsi, qword [rsp + 0x6a0]
add rsp, 0x6a8
pop r14
pop rbp
ret
lea rdx, [rbp + 0x340]
mov rcx, rdi
call r12
mov r12, qword [rbp + 0x5c8]
mov r13, qword [rbp + 0x5d0]
test eax, eax
je 0x140014122
nop dword [rax]
nop dword [rax + rax]
mov eax, dword [rbp + 0x360]
lea r9, [rbp + 0x370]
mov dword [rsp + 0x28], eax
lea r8, [rbp + 0x470]
mov rax, qword [rbp + 0x358]
mov rdx, r13
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.1400138f0
lea rdx, [rbp + 0x340]
mov rcx, rdi
inc esi
call r15
test eax, eax
jne 0x1400140e0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
jle 0x140014063
mov eax, 1
jmp 0x140014072