Function at 0x413d90
Capabilities:
Query environment variable

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x1b8
mov edx, 0x2c
mov rbp, rcx
call sub.msvcrt.dll_strchr
test rax, rax
jne 0x4143a8
mov rax, qword [0x004de0a0]
test rax, rax
je 0x4141d5
mov rbx, qword [0x004de0a0]
xor r13d, r13d
cmp byte [rbx], 0
jne 0x413df0
mov eax, r13d
add rsp, 0x1b8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea rsi, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdi, [rsi + 0x10]
mov rcx, rbx
mov r12d, eax
mov qword [rsp + 0x30], rdi
call sub.msvcrt.dll_strlen
cmp rax, 0xf
mov r13, rax
mov qword [rsp + 0x28], rax
ja 0x414150
cmp rax, 1
je 0x414140
test rax, rax
jne 0x4143a0
mov qword [rsp + 0x38], rax
mov byte [rdi + rax], 0
lea rdi, [rsp + 0x50]
mov rcx, rbp
lea rbx, [rdi + 0x10]
mov qword [rsp + 0x50], rbx
call sub.msvcrt.dll_strlen
cmp rax, 0xf
mov r13, rax
mov qword [rsp + 0xb0], rax
ja 0x414190
cmp rax, 1
je 0x414290
test rax, rax
jne 0x414398
lea rbp, [rsp + 0x70]
lea rdx, [0x004b4027]
mov qword [rsp + 0x58], rax
mov r8, rsi
mov byte [rbx + rax], 0
mov rcx, rbp
call fcn.004a9000
movabs rax, 0x7fffffffffffffff
cmp qword [rsp + 0x78], rax
je 0x4143bc
lea rdx, [0x004b4027]
mov r8d, 1
mov rcx, rbp
call fcn.00499d20
lea rbx, [rsp + 0xb0]
lea rdx, [rbx + 0x10]
mov qword [rsp + 0xb0], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x414320
mov qword [rsp + 0xb0], rcx
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0xc0], rcx
mov rcx, qword [rax + 8]
mov qword [rsp + 0xb8], rcx
mov qword [rax], rdx
lea rcx, [rbx + 0x10]
mov byte [rax + 0x10], 0
mov rdx, qword [rsp + 0xb0]
mov qword [rax + 8], 0
mov rax, qword [rsp + 0x30]
cmp rdx, rcx
je 0x414360
lea rcx, [rsi + 0x10]
cmp rax, rcx
je 0x4142a0
mov qword [rsp + 0x30], rdx
mov rdx, qword [rsp + 0xb8]
test rax, rax
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x38], rdx
mov rdx, qword [rsp + 0xc0]
mov qword [rsp + 0x40], rdx
je 0x4142bf
mov qword [rsp + 0xb0], rax
mov qword [rsp + 0xc0], rcx
mov qword [rsp + 0xb8], 0
mov byte [rax], 0
lea rax, [rbx + 0x10]
mov rcx, qword [rsp + 0xb0]
cmp rcx, rax
je 0x413fa1
call fcn.004aaf10
mov rcx, qword [rsp + 0x70]
add rbp, 0x10
cmp rcx, rbp
je 0x413fb4
call fcn.004aaf10
lea rbp, [rsp + 0x90]
lea rdx, [0x004b4027]
mov r8, rdi
mov rcx, rbp
call fcn.004a9000
movabs rax, 0x7fffffffffffffff
cmp qword [rsp + 0x98], rax
je 0x414415
lea rdx, [0x004b4027]
mov r8d, 1
mov rcx, rbp
call fcn.00499d20
lea rdx, [rbx + 0x10]
mov qword [rsp + 0xb0], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x414340
mov qword [rsp + 0xb0], rcx
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0xc0], rcx
mov rcx, qword [rax + 8]
mov qword [rsp + 0xb8], rcx
mov qword [rax], rdx
lea rcx, [rbx + 0x10]
mov byte [rax + 0x10], 0
mov rdx, qword [rsp + 0xb0]
mov qword [rax + 8], 0
mov rax, qword [rsp + 0x50]
cmp rdx, rcx
je 0x414380
lea rcx, [rdi + 0x10]
cmp rax, rcx
je 0x4142d0
mov qword [rsp + 0x50], rdx
mov rdx, qword [rsp + 0xb8]
test rax, rax
mov rcx, qword [rsp + 0x60]
mov qword [rsp + 0x58], rdx
mov rdx, qword [rsp + 0xc0]
mov qword [rsp + 0x60], rdx
je 0x4142ef
mov qword [rsp + 0xb0], rax
mov qword [rsp + 0xc0], rcx
mov qword [rsp + 0xb8], 0
mov byte [rax], 0
add rbx, 0x10
mov rcx, qword [rsp + 0xb0]
cmp rcx, rbx
je 0x4140cf
call fcn.004aaf10
mov rcx, qword [rsp + 0x90]
add rbp, 0x10
cmp rcx, rbp
je 0x4140e5
call fcn.004aaf10
mov r9, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x50]
xor r8d, r8d
mov rcx, rsi
call fcn.0043d680
mov rcx, qword [rsp + 0x50]
cmp rax, 0xffffffffffffffff
setne r13b
add rdi, 0x10
cmp rcx, rdi
je 0x414115
call fcn.004aaf10
mov rcx, qword [rsp + 0x30]
add rsi, 0x10
cmp rcx, rsi
je 0x414128
call fcn.004aaf10
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x413dd4
movzx edx, byte [rbx]
mov byte [rsp + 0x40], dl
jmp 0x413e34
lea rdx, [rsp + 0x28]
xor r8d, r8d
mov rcx, rsi
call fcn.00499e60
mov rcx, rax
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x28]
mov qword [rsp + 0x40], rax
mov r8, r13
mov rdx, rbx
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x30]
jmp 0x413e34
lea rdx, [rsp + 0xb0]
xor r8d, r8d
mov rcx, rdi
call fcn.00499e60
mov rcx, rax
mov qword [rsp + 0x50], rax
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0x60], rax
mov r8, r13
mov rdx, rbp
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0xb0]
mov rbx, qword [rsp + 0x50]
jmp 0x413e7b
lea rbx, [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, 0x100
mov edi, eax
mov rdx, rbx
lea rcx, str.WINPTY_DEBUG
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
sub eax, 1
cmp eax, 0xfe
jbe 0x41420d
mov byte [rsp + 0xb0], 0
mov rax, rbx
mov ecx, dword [rax]
add rax, 4
lea edx, [rcx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x414210
mov ecx, edx
shr ecx, 0x10
test edx, 0x8080
cmove edx, ecx
lea rcx, [rax + 2]
mov esi, edx
cmove rax, rcx
add sil, dl
sbb rax, 3
sub rax, rbx
lea rsi, [rax + 1]
mov rcx, rsi
call fcn.004aaf30
test rsi, rsi
mov r9, rax
jne 0x414300
xor eax, eax
lock cmpxchg qword [0x004de0a0], r9
test rax, rax
je 0x41427a
mov rcx, r9
call fcn.004aaf00
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x413dc5
movzx edx, byte [rbp]
mov byte [rsp + 0x60], dl
jmp 0x413e7b
mov rax, qword [rsp + 0xb8]
mov qword [rsp + 0x30], rdx
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x40], rax
lea rax, [rbx + 0x10]
mov qword [rsp + 0xb0], rax
jmp 0x413f7c
mov rax, qword [rsp + 0xb8]
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x58], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x60], rax
lea rax, [rbx + 0x10]
mov qword [rsp + 0xb0], rax
jmp 0x4140aa
mov r8, rsi
mov rdx, rbx
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov r9, rax
jmp 0x414262
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0xc0], r9
mov qword [rsp + 0xc8], r10
jmp 0x413efd
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0xc0], r9
mov qword [rsp + 0xc8], r10
jmp 0x41402b
mov rdx, rbx
mov rcx, rsi
call fcn.00499db0
mov rax, qword [rsp + 0xb0]
jmp 0x413f7c
mov rdx, rbx
mov rcx, rdi
call fcn.00499db0
mov rax, qword [rsp + 0xb0]
jmp 0x4140aa
mov rcx, rbx
jmp 0x4141b8
mov rcx, rdi
jmp 0x414172
lea rcx, str.INTERNAL_ERROR:_hasDebugFlag_flag_has_comma:__s
mov rdx, rbp
call fcn.00413ac0
call sub.msvcrt.dll_abort
lea rcx, [0x004b3f80]
call fcn.004a50e0
mov rcx, qword [rsp + 0x70]
add rbp, 0x10
mov rbx, rax
cmp rcx, rbp
je 0x4143de
call fcn.004aaf10
mov rcx, qword [rsp + 0x50]
add rdi, 0x10
cmp rcx, rdi
je 0x4143f1
call fcn.004aaf10
mov rcx, qword [rsp + 0x30]
add rsi, 0x10
cmp rcx, rsi
je 0x414404
call fcn.004aaf10
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rbx
call fcn.00424a70
lea rcx, [0x004b3f80]
call fcn.004a50e0
mov rcx, qword [rsp + 0x90]
add rbp, 0x10
mov rbx, rax
cmp rcx, rbp
jne 0x4143d9
jmp 0x4143de