Function at 0x401890
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 0x401ea8
mov rax, qword [0x004c2030]
test rax, rax
je 0x401cd5
mov rbx, qword [0x004c2030]
xor r13d, r13d
cmp byte [rbx], 0
jne 0x4018f0
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 0x401c50
cmp rax, 1
je 0x401c40
test rax, rax
jne 0x401ea0
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 0x401c90
cmp rax, 1
je 0x401d90
test rax, rax
jne 0x401e98
lea rbp, [rsp + 0x70]
lea rdx, [0x0049b387]
mov qword [rsp + 0x58], rax
mov r8, rsi
mov byte [rbx + rax], 0
mov rcx, rbp
call fcn.00494450
movabs rax, 0x7fffffffffffffff
cmp qword [rsp + 0x78], rax
je 0x401ebc
lea rdx, [0x0049b387]
mov r8d, 1
mov rcx, rbp
call fcn.00485170
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 0x401e20
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 0x401e60
lea rcx, [rsi + 0x10]
cmp rax, rcx
je 0x401da0
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 0x401dbf
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 0x401aa1
call fcn.00496360
mov rcx, qword [rsp + 0x70]
add rbp, 0x10
cmp rcx, rbp
je 0x401ab4
call fcn.00496360
lea rbp, [rsp + 0x90]
lea rdx, [0x0049b387]
mov r8, rdi
mov rcx, rbp
call fcn.00494450
movabs rax, 0x7fffffffffffffff
cmp qword [rsp + 0x98], rax
je 0x401f15
lea rdx, [0x0049b387]
mov r8d, 1
mov rcx, rbp
call fcn.00485170
lea rdx, [rbx + 0x10]
mov qword [rsp + 0xb0], rdx
mov rcx, qword [rax]
lea rdx, [rax + 0x10]
cmp rcx, rdx
je 0x401e40
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 0x401e80
lea rcx, [rdi + 0x10]
cmp rax, rcx
je 0x401dd0
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 0x401def
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 0x401bcf
call fcn.00496360
mov rcx, qword [rsp + 0x90]
add rbp, 0x10
cmp rcx, rbp
je 0x401be5
call fcn.00496360
mov r9, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x50]
xor r8d, r8d
mov rcx, rsi
call fcn.00429e30
mov rcx, qword [rsp + 0x50]
cmp rax, 0xffffffffffffffff
setne r13b
add rdi, 0x10
cmp rcx, rdi
je 0x401c15
call fcn.00496360
mov rcx, qword [rsp + 0x30]
add rsi, 0x10
cmp rcx, rsi
je 0x401c28
call fcn.00496360
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4018d4
movzx edx, byte [rbx]
mov byte [rsp + 0x40], dl
jmp 0x401934
lea rdx, [rsp + 0x28]
xor r8d, r8d
mov rcx, rsi
call fcn.004852b0
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 0x401934
lea rdx, [rsp + 0xb0]
xor r8d, r8d
mov rcx, rdi
call fcn.004852b0
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 0x40197b
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 0x401d0d
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 0x401d10
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.00496380
test rsi, rsi
mov r9, rax
jne 0x401e00
xor eax, eax
lock cmpxchg qword [0x004c2030], r9
test rax, rax
je 0x401d7a
mov rcx, r9
call fcn.00496350
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x4018c5
movzx edx, byte [rbp]
mov byte [rsp + 0x60], dl
jmp 0x40197b
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 0x401a7c
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 0x401baa
mov r8, rsi
mov rdx, rbx
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov r9, rax
jmp 0x401d62
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0xc0], r9
mov qword [rsp + 0xc8], r10
jmp 0x4019fd
mov r9, qword [rax + 0x10]
mov r10, qword [rax + 0x18]
mov qword [rsp + 0xc0], r9
mov qword [rsp + 0xc8], r10
jmp 0x401b2b
mov rdx, rbx
mov rcx, rsi
call fcn.00485200
mov rax, qword [rsp + 0xb0]
jmp 0x401a7c
mov rdx, rbx
mov rcx, rdi
call fcn.00485200
mov rax, qword [rsp + 0xb0]
jmp 0x401baa
mov rcx, rbx
jmp 0x401cb8
mov rcx, rdi
jmp 0x401c72
lea rcx, str.INTERNAL_ERROR:_hasDebugFlag_flag_has_comma:__s
mov rdx, rbp
call fcn.004015c0
call sub.msvcrt.dll_abort
lea rcx, [0x0049b2e0]
call fcn.00490530
mov rcx, qword [rsp + 0x70]
add rbp, 0x10
mov rbx, rax
cmp rcx, rbp
je 0x401ede
call fcn.00496360
mov rcx, qword [rsp + 0x50]
add rdi, 0x10
cmp rcx, rdi
je 0x401ef1
call fcn.00496360
mov rcx, qword [rsp + 0x30]
add rsi, 0x10
cmp rcx, rsi
je 0x401f04
call fcn.00496360
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rbx
call fcn.00411ad0
lea rcx, [0x0049b2e0]
call fcn.00490530
mov rcx, qword [rsp + 0x90]
add rbp, 0x10
mov rbx, rax
cmp rcx, rbp
jne 0x401ed9
jmp 0x401ede