Function at 0x408160
Capabilities:
Query environment variable

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x30
mov r11d, dword [0x01042710]
test r11d, r11d
mov rsi, rcx
jle 0x4081db
movsx r10d, byte [rcx]
lea rbx, [0x01042720]
xor r8d, r8d
mov r9, rbx
nop word [rax + rax]
movsx eax, byte [r9]
mov rdx, r9
cmp eax, r10d
jne 0x4081cb
test r10d, r10d
je 0x4082d0
mov rax, rsi
jmp 0x4081b8
test ecx, ecx
je 0x4082d0
add rax, 1
add rdx, 1
movzx edi, byte [rax]
cmp byte [rdx], dil
movsx ecx, byte [rax]
je 0x4081b0
add r8d, 1
add r9, 0x807f
cmp r8d, r11d
jne 0x408190
movsxd r9, r11d
cmp r9, 4
ja 0x4082f7
mov rax, r9
mov rdx, r9
mov r8d, 0x7fff
shl rax, 7
shl rdx, 0xf
mov rcx, rsi
lea rbx, [0x01042720]
sub rax, r9
lea rdx, [rax + rdx + 0x80]
add rdx, rbx
call qword [sym.imp.kernel32.dll_GetEnvironmentVariableA]
sub eax, 1
cmp eax, 0x7ffd
ja 0x40831f
cmp byte [rsi], 0
je 0x408245
xor r9d, r9d
add r9, 1
cmp byte [rsi + r9], 0
jne 0x408230
cmp r9, 0x7f
ja 0x408323
movsxd r10, dword [0x01042710]
mov rcx, r10
mov rax, r10
mov r11, r10
shl rax, 0xf
shl rcx, 7
add rcx, rax
xor eax, eax
sub rcx, r10
add rcx, rbx
jmp 0x408283
mov byte [rcx + rax], dl
add rax, 1
cmp rax, 0x80
je 0x408318
movzx edx, byte [rsi + rax]
test dl, dl
jne 0x408270
mov edx, pe_nt_image_headers64
sub rdx, rax
add rcx, rax
call fcn.00401990
mov rdx, r10
mov rax, r10
add r11d, 1
shl rdx, 7
shl rax, 0xf
mov dword [0x01042710], r11d
add rax, rdx
sub rax, r10
lea rax, [rbx + rax + 0x80]
add rsp, 0x30
pop rbx
pop rsi
pop rdi
ret
movsxd r8, r8d
mov rax, r8
mov rdx, r8
shl rax, 7
shl rdx, 0xf
sub rax, r8
lea rax, [rax + rdx + 0x80]
add rax, rbx
add rsp, 0x30
pop rbx
pop rsi
pop rdi
ret
mov qword [rsp + 0x20], 5
lea r8, str.__num_env_vars_______kEnvVariables__
mov edx, 0x2442
lea rcx, str.gotsan.cpp
call fcn.00406990
xor edx, edx
jmp 0x408293
xor eax, eax
jmp 0x4082ef
mov qword [rsp + 0x20], pe_nt_image_headers64
lea r8, str.__internal_strlen_name________kMaxEnvNameLength__
mov edx, 0x2446
lea rcx, str.gotsan.cpp
call fcn.00406990
nop
nop word cs:[rax + rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x244f
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x2453
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x248c
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x2492
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x2496
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x249a
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x38
xor r9d, r9d
mov edx, 0x249e
lea r8, str.__0___unimplemented_______0_
lea rcx, str.gotsan.cpp
mov qword [rsp + 0x20], 0
call fcn.00406990
nop
nop dword [rax]
sub rsp, 0x48
cmp qword [0x00842278], 0
je 0x4084d0
lea rcx, [rsp + 0x30]
call qword [sym.imp.kernel32.dll_QueryPerformanceCounter]
imul rax, qword [rsp + 0x30], 0x3b9aca00
cqo
idiv qword [0x00842278]
add rsp, 0x48
ret
lea rcx, [0x00842278]
call qword [sym.imp.kernel32.dll_QueryPerformanceFrequency]
cmp qword [0x00842278], 0
jne 0x4084ae
lea r8, str.__frequency.QuadPart_______0__
xor r9d, r9d
mov edx, 0x24bc
mov qword [rsp + 0x20], 0
lea rcx, str.gotsan.cpp
call fcn.00406990
nop
nop dword [rax]