Function at 0x406d60
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov rax, qword [0x005102f8]
mov rdx, qword [0x00510300]
sub rdx, rax
cmp rdx, 0x13
jbe 0x407230
movabs rcx, 0x5f5443454c4c4f43
movabs rbx, 0x4954504f5f434347
mov dword [rax + 0x10], 0x3d534e4f
mov qword [rax], rcx
mov qword [rax + 8], rbx
xor r14d, r14d
mov rax, qword [0x005102f8]
mov r8d, dword [0x00510164]
lea r12, [0x005102e0]
mov dword [rsp + 0x2c], 0
mov rdx, qword [0x00510300]
add rax, 0x14
test r8d, r8d
mov qword [0x005102f8], rax
jle 0x407150
mov r8, qword [0x00510168]
mov rdx, qword [0x00510300]
add r8, r14
mov ecx, dword [r8 + 0x10]
and ecx, 0x14
cmp ecx, 4
je 0x406f43
sub rdx, rax
cmp rdx, 1
jbe 0x4071db
mov ecx, 0x2d27
mov word [rax], cx
mov rax, qword [0x005102f8]
mov rdi, qword [r8]
lea rsi, [rax + 2]
mov qword [0x005102f8], rsi
jmp 0x406e7d
mov r8, rbx
mov rdx, rdi
mov rcx, rsi
call sub.msvcrt.dll_memcpy
add rbx, qword [0x005102f8]
mov rax, qword [0x00510300]
sub rax, rbx
mov qword [0x005102f8], rbx
cmp rax, 3
jbe 0x406ec2
mov dword [rbx], 0x27275c27
mov rax, qword [0x005102f8]
lea rdi, [r15 + 1]
lea rsi, [rax + 4]
mov qword [0x005102f8], rsi
mov edx, 0x27
mov rcx, rdi
call sub.msvcrt.dll_strchr
mov rbp, qword [0x00510300]
mov r15, rax
sub rbp, rsi
test rax, rax
je 0x406f80
mov rbx, rax
sub rbx, rdi
cmp rbx, rbp
jbe 0x406e35
mov rdx, rbx
mov rcx, r12
call fcn.0047911e
mov rsi, qword [0x005102f8]
jmp 0x406e35
mov edx, 4
mov rcx, r12
call fcn.0047911e
mov rbx, qword [0x005102f8]
jmp 0x406e61
mov rcx, rdi
call sub.msvcrt.dll_strlen
cmp rax, r15
mov rbx, rax
ja 0x4070e0
mov r8, rbx
mov rdx, rdi
mov rcx, rsi
call sub.msvcrt.dll_memcpy
add rbx, qword [0x005102f8]
cmp qword [0x00510300], rbx
mov qword [0x005102f8], rbx
je 0x407120
mov byte [rbx], 0x27
mov rax, qword [0x005102f8]
mov rdx, qword [0x00510300]
add rax, 1
add rbp, 8
mov qword [0x005102f8], rax
jne 0x406ff0
add dword [rsp + 0x2c], 1
mov ecx, dword [rsp + 0x2c]
cmp ecx, dword [0x00510164]
jge 0x407150
cmp rdx, rax
je 0x407217
mov byte [rax], 0x20
mov rax, qword [0x005102f8]
add r14, 0x18
add rax, 1
mov qword [0x005102f8], rax
jmp 0x406de8
mov rcx, rdi
call sub.msvcrt.dll_strlen
cmp rax, rbp
mov rbx, rax
ja 0x407139
mov r8, rbx
mov rdx, rdi
mov rcx, rsi
call sub.msvcrt.dll_memcpy
add rbx, qword [0x005102f8]
cmp qword [0x00510300], rbx
mov qword [0x005102f8], rbx
je 0x4071fe
mov rdx, qword [0x00510168]
mov byte [rbx], 0x27
mov rax, qword [0x005102f8]
mov rbp, qword [rdx + r14 + 8]
mov rdx, qword [0x00510300]
add rax, 1
mov qword [0x005102f8], rax
test rbp, rbp
je 0x406f43
nop
cmp qword [rbp], 0
je 0x406f43
sub rdx, rax
cmp rdx, 1
jbe 0x407100
mov edx, 0x2720
mov word [rax], dx
mov rax, qword [0x005102f8]
lea rsi, [rax + 2]
mov qword [0x005102f8], rsi
mov rdi, qword [rbp]
jmp 0x407078
mov r8, rbx
mov rdx, rdi
mov rcx, rsi
call sub.msvcrt.dll_memcpy
add rbx, qword [0x005102f8]
mov rax, qword [0x00510300]
sub rax, rbx
mov qword [0x005102f8], rbx
cmp rax, 3
jbe 0x4070c0
mov dword [rbx], 0x27275c27
mov rax, qword [0x005102f8]
lea rdi, [r13 + 1]
lea rsi, [rax + 4]
mov qword [0x005102f8], rsi
mov edx, 0x27
mov rcx, rdi
call sub.msvcrt.dll_strchr
mov r15, qword [0x00510300]
mov r13, rax
sub r15, rsi
test rax, rax
je 0x406ee0
mov rbx, rax
sub rbx, rdi
cmp rbx, r15
jbe 0x407030
mov rdx, rbx
mov rcx, r12
call fcn.0047911e
mov rsi, qword [0x005102f8]
jmp 0x407030
mov edx, 4
mov rcx, r12
call fcn.0047911e
mov rbx, qword [0x005102f8]
jmp 0x40705c
mov rdx, rax
mov rcx, r12
call fcn.0047911e
mov rsi, qword [0x005102f8]
jmp 0x406ef4
mov edx, 2
mov rcx, r12
call fcn.0047911e
mov rax, qword [0x005102f8]
jmp 0x407008
mov edx, 1
mov rcx, r12
call fcn.0047911e
mov rbx, qword [0x005102f8]
jmp 0x406f1d
mov rdx, rax
mov rcx, r12
call fcn.0047911e
mov rsi, qword [0x005102f8]
jmp 0x406f94
cmp rdx, rax
je 0x407259
mov byte [rax], 0
mov rax, qword [0x005102f8]
mov rdx, qword [0x005102f0]
lea rcx, [rax + 1]
cmp rcx, rdx
je 0x40724d
mov r8, qword [0x00510310]
lea rax, [rcx + r8]
not r8
mov rcx, qword [0x00510300]
and rax, r8
mov r8, qword [0x005102e8]
mov r9, rax
mov rdi, rcx
mov qword [0x005102f8], rax
sub r9, r8
sub rdi, r8
cmp r9, rdi
jbe 0x4071b8
mov qword [0x005102f8], rcx
mov rax, rcx
lea rcx, [0x00510410]
mov qword [0x005102f0], rax
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.00406ae0
mov edx, 2
mov rcx, r12
call fcn.0047911e
mov r8, qword [0x00510168]
mov rax, qword [0x005102f8]
add r8, r14
jmp 0x406e16
mov edx, 1
mov rcx, r12
call fcn.0047911e
mov rbx, qword [0x005102f8]
jmp 0x406fbd
mov edx, 1
mov rcx, r12
call fcn.0047911e
mov rax, qword [0x005102f8]
jmp 0x406f61
lea rcx, [0x005102e0]
mov edx, 0x14
call fcn.0047911e
mov rax, qword [0x005102f8]
jmp 0x406d8b
or byte [0x00510330], 2
jmp 0x407177
lea rcx, [0x005102e0]
mov edx, 1
call fcn.0047911e
mov rax, qword [0x005102f8]
jmp 0x407159