Function at 0x180138ee0
Capabilities:
Query environment variable

Disassembly:
push rbp
push rbx
push rsi
push r12
lea rbp, [rsp - 0x558]
sub rsp, 0x658
mov rax, qword [0x18018f008]
xor rax, rsp
mov qword [rbp + 0x530], rax
mov rsi, 0xffffffffffffffff
mov r12, rcx
mov rax, rsi
inc rax
cmp byte [rdx + rax], 0
jne 0x180138f13
lea rbx, [rdx - 1]
add rbx, rax
cmp rbx, rdx
jbe 0x180138f5f
cmp byte [rbx], 0x2f
je 0x180138f37
dec rbx
cmp rbx, rdx
ja 0x180138f28
jmp 0x180138f5c
mov rcx, rsi
nop word [rax + rax]
inc rcx
cmp byte [rdx + rcx], 0
jne 0x180138f40
mov eax, ebx
dec rcx
sub eax, edx
cmp rax, rcx
je 0x180139215
inc rbx
cmp rbx, rdx
je 0x180139222
mov r8d, 0x104
lea rdx, [rbp + 0x320]
lea rcx, [0x180172f08]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea rdx, [rbp + 0x10]
test eax, eax
jne 0x180138f9f
mov r8d, 0x104
mov byte [rbp + 0x10], al
lea rcx, str.TCL_LIBRARY
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
jmp 0x180139018
movzx eax, word [rbp + 0x320]
lea r9, [rbp + 0x320]
test ax, ax
je 0x180139015
movzx ecx, ax
lea eax, [rcx - 1]
cmp eax, 0x7f
jae 0x180138fc4
mov eax, 1
jmp 0x180139003
movzx r8d, cl
mov eax, ecx
and r8b, 0x3f
shr eax, 6
or r8b, 0x80
cmp ecx, 0x7ff
ja 0x180138fed
or al, 0xc0
mov byte [rdx + 1], r8b
movzx ecx, al
mov eax, 2
jmp 0x180139003
and al, 0x3f
shr ecx, 0xc
or al, 0x80
mov byte [rdx + 2], r8b
mov byte [rdx + 1], al
or cl, 0xe0
mov eax, 3
add r9, 2
mov byte [rdx], cl
add rdx, rax
movzx eax, word [r9]
test ax, ax
jne 0x180138fb2
mov byte [rdx], 0
cmp byte [rbp + 0x10], 0
je 0x1801391f9
mov qword [rsp + 0x690], rdi
lea rax, [rbp + 0x10]
mov qword [rsp + 0x650], r13
mov rdi, rsi
mov qword [rsp + 0x648], r14
inc rdi
cmp byte [rax + rdi], 0
jne 0x180139041
mov qword [rsp + 0x640], r15
call fcn.180106220
xor r13d, r13d
mov r14, rax
mov dword [rax], r13d
test edi, edi
jne 0x180139074
mov rax, qword [0x18018f080]
mov edi, r13d
mov qword [r14 + 8], rax
jmp 0x1801390ac
lea r15d, [rdi + 1]
mov ecx, r15d
call sym.tcl86t.dll_hclpAlloc
test rax, rax
jne 0x18013908e
test r15d, r15d
jne 0x18013922f
mov r8d, edi
lea rdx, [rbp + 0x10]
mov rcx, rax
mov qword [r14 + 8], rax
call sub.VCRUNTIME140.dll_memcpy
mov rax, qword [r14 + 8]
movsxd rcx, edi
mov byte [rcx + rax], r13b
mov dword [r14 + 0x10], edi
mov r8, r14
mov rdx, r12
mov qword [r14 + 0x18], r13
xor ecx, ecx
call sym.tcl86t.dll_hcl_ListObjAppendElement
movzx ecx, byte [rbp + 0x10]
lea rax, [rbp + 0x10]
test cl, cl
je 0x1801390e3
nop dword [rax]
cmp cl, 0x5c
jne 0x1801390d8
mov byte [rax], 0x2f
movzx ecx, byte [rax + 1]
inc rax
test cl, cl
jne 0x1801390d0
lea r8, [rsp + 0x28]
lea rdx, [rsp + 0x20]
lea rcx, [rbp + 0x10]
call sym.tcl86t.dll_hcl_SplitPath
mov edi, dword [rsp + 0x20]
mov r14, qword [rsp + 0x28]
test edi, edi
jle 0x18013915b
lea eax, [rdi - 1]
movsxd rcx, eax
mov rdx, qword [r14 + rcx*8]
lea r15, [r14 + rcx*8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x18013915b
mov qword [r15], rbx
lea rax, [rsp + 0x40]
lea r8, [rsp + 0x30]
mov qword [rsp + 0x30], rax
mov rdx, r14
mov dword [rsp + 0x38], r13d
mov ecx, edi
mov dword [rsp + 0x3c], 0xc8
mov byte [rsp + 0x40], r13b
call sym.tcl86t.dll_hcl_JoinPath
lea rcx, [rsp + 0x30]
call fcn.180112110
mov rbx, rax
jmp 0x1801391c4
lea rax, [rbp + 0x10]
nop
inc rsi
cmp byte [rax + rsi], r13b
jne 0x180139160
call fcn.180106220
mov rbx, rax
mov dword [rax], r13d
test esi, esi
jne 0x180139188
mov rax, qword [0x18018f080]
mov esi, r13d
mov qword [rbx + 8], rax
jmp 0x1801391bd
lea edi, [rsi + 1]
mov ecx, edi
call sym.tcl86t.dll_hclpAlloc
test rax, rax
jne 0x18013919f
test edi, edi
jne 0x18013923f
mov r8d, esi
lea rdx, [rbp + 0x10]
mov rcx, rax
mov qword [rbx + 8], rax
call sub.VCRUNTIME140.dll_memcpy
mov rax, qword [rbx + 8]
movsxd r8, esi
mov byte [r8 + rax], r13b
mov dword [rbx + 0x10], esi
mov qword [rbx + 0x18], r13
mov r8, rbx
mov rdx, r12
xor ecx, ecx
call sym.tcl86t.dll_hcl_ListObjAppendElement
mov rcx, r14
call sym.tcl86t.dll_hclpFree
mov r15, qword [rsp + 0x640]
mov r13, qword [rsp + 0x650]
mov rdi, qword [rsp + 0x690]
mov r14, qword [rsp + 0x648]
mov rcx, qword [rbp + 0x530]
xor rcx, rsp
call fcn.180146240
add rsp, 0x658
pop r12
pop rsi
pop rbx
pop rbp
ret
lea rcx, str.last_character_in_lib_cannot_be__
call sym.tcl86t.dll_hcl_Panic
int3
lea rcx, str.no___character_found_in_lib
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, r15d
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, edi
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3