Function at 0x140006700
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
push rbp
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov rax, qword [0x140024020]
xor rax, rsp
mov qword [rbp - 8], rax
xor r12b, r12b
xor r13d, r13d
mov qword [rbp - 0x48], r13
mov qword [rbp - 0x38], r13
mov esi, 7
mov qword [rbp - 0x30], rsi
mov word [rbp - 0x48], r13w
cmp dword [0x140025918], r13d
je 0x140006759
xor bl, bl
jmp 0x1400069fc
lea rax, [0x14002591c]
mov qword [rbp - 0x50], rax
mov ebx, r13d
mov eax, 1
xchg dword [0x14002591c], eax
test eax, eax
je 0x14000679f
nop word [rax + rax]
mov eax, ebx
inc ebx
and eax, 0x3ff
jne 0x140006790
call sub.KERNEL32.dll_SwitchToThread
mov eax, 1
xchg dword [0x14002591c], eax
test eax, eax
jne 0x140006780
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov qword [0x140025920], rax
mov qword [rbp - 0x38], r13
lea rax, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rax, qword [rbp - 0x48]
mov word [rax], r13w
xor r8d, r8d
xor edx, edx
lea rcx, str.COREHOST_TRACEFILE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r14d, eax
mov rbx, 0xffffffffffffffff
lea r15d, [rbx + 5]
test eax, eax
jne 0x140006823
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x1400068b3
test eax, eax
jle 0x140006808
movzx eax, ax
or eax, 0x80070000
mov r8d, eax
lea rdx, str.COREHOST_TRACEFILE
lea rcx, str.Failed_to_read_environment_variable___s___HRESULT:_0x_X
call fcn.140006e60
jmp 0x1400068b3
mov eax, 2
mul r14
cmovo rax, rbx
mov rcx, rax
call fcn.140013dcc
mov rdi, rax
mov r8d, r14d
mov rdx, rax
lea rcx, str.COREHOST_TRACEFILE
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x1400067eb
mov r8, rbx
inc r8
cmp word [rdi + r8*2], 0
jne 0x140006854
mov rdx, rdi
lea rcx, [rbp - 0x48]
call fcn.140005160
mov rcx, rdi
call fcn.140013b00
lea rcx, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rcx, qword [rbp - 0x48]
lea rdx, [0x14001d858]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
mov rdi, rax
test rax, rax
je 0x1400068b0
xor r9d, r9d
mov r8d, r15d
xor edx, edx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_setvbuf]
mov qword [0x140025920], rdi
jmp 0x1400068b3
mov r12b, 1
mov qword [rbp - 0x28], r13
mov qword [rbp - 0x10], rsi
mov qword [rbp - 0x18], r13
mov word [rbp - 0x28], r13w
xor r8d, r8d
xor edx, edx
lea rcx, str.COREHOST_TRACE_VERBOSITY
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r14d, eax
test eax, eax
je 0x14000690b
mov eax, 2
mul r14
cmovo rax, rbx
mov rcx, rax
call fcn.140013dcc
mov rdi, rax
mov r8d, r14d
mov rdx, rax
lea rcx, str.COREHOST_TRACE_VERBOSITY
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0x140006940
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x140006978
test eax, eax
jle 0x140006924
movzx eax, ax
or eax, 0x80070000
mov r8d, eax
lea rdx, str.COREHOST_TRACE_VERBOSITY
lea rcx, str.Failed_to_read_environment_variable___s___HRESULT:_0x_X
call fcn.140006e60
jmp 0x140006978
inc rbx
cmp word [rdi + rbx*2], 0
jne 0x140006940
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 0x28]
call fcn.140005160
mov rcx, rdi
call fcn.140013b00
lea rcx, [rbp - 0x28]
cmp qword [rbp - 0x10], 8
cmovae rcx, qword [rbp - 0x28]
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wtoi]
mov r15d, eax
mov dword [0x140025918], r15d
mov rdx, qword [rbp - 0x10]
cmp rdx, 8
jb 0x1400069c2
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400069bd
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400069bd
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140013b00
mov qword [rbp - 0x18], r13
mov qword [rbp - 0x10], rsi
mov word [rbp - 0x28], r13w
nop
mov dword [0x14002591c], r13d
test r12b, r12b
je 0x1400069f6
lea rdx, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rdx, qword [rbp - 0x48]
lea rcx, str.Unable_to_open_COREHOST_TRACEFILE_s_for_writing
call fcn.140006bd0
mov bl, 1
mov rsi, qword [rbp - 0x30]
cmp rsi, 8
jb 0x140006a3b
lea rdx, [rsi*2 + 2]
mov rcx, qword [rbp - 0x48]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140006a36
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140006a36
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140013b00
movzx eax, bl
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.140013ae0
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret