Function at 0x16700
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 [0x00034020]
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 [0x00035918], r13d
je 0x16759
xor bl, bl
jmp 0x169fc
lea rax, [0x0003591c]
mov qword [rbp - 0x50], rax
mov ebx, r13d
mov eax, 1
xchg dword [0x0003591c], eax
test eax, eax
je 0x1679f
nop word [rax + rax]
mov eax, ebx
inc ebx
and eax, 0x3ff
jne 0x16790
call sub.KERNEL32.dll_SwitchToThread
mov eax, 1
xchg dword [0x0003591c], eax
test eax, eax
jne 0x16780
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov qword [0x00035920], 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 0x16823
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x168b3
test eax, eax
jle 0x16808
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.00016e60
jmp 0x168b3
mov eax, 2
mul r14
cmovo rax, rbx
mov rcx, rax
call fcn.00023dcc
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 0x167eb
mov r8, rbx
inc r8
cmp word [rdi + r8*2], 0
jne 0x16854
mov rdx, rdi
lea rcx, [rbp - 0x48]
call fcn.00015160
mov rcx, rdi
call fcn.00023b00
lea rcx, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rcx, qword [rbp - 0x48]
lea rdx, [0x0002d858]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
mov rdi, rax
test rax, rax
je 0x168b0
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 [0x00035920], rdi
jmp 0x168b3
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 0x1690b
mov eax, 2
mul r14
cmovo rax, rbx
mov rcx, rax
call fcn.00023dcc
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 0x16940
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x16978
test eax, eax
jle 0x16924
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.00016e60
jmp 0x16978
inc rbx
cmp word [rdi + rbx*2], 0
jne 0x16940
mov r8, rbx
mov rdx, rdi
lea rcx, [rbp - 0x28]
call fcn.00015160
mov rcx, rdi
call fcn.00023b00
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 [0x00035918], r15d
mov rdx, qword [rbp - 0x10]
cmp rdx, 8
jb 0x169c2
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x169bd
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x169bd
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.00023b00
mov qword [rbp - 0x18], r13
mov qword [rbp - 0x10], rsi
mov word [rbp - 0x28], r13w
nop
mov dword [0x0003591c], r13d
test r12b, r12b
je 0x169f6
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.00016bd0
mov bl, 1
mov rsi, qword [rbp - 0x30]
cmp rsi, 8
jb 0x16a3b
lea rdx, [rsi*2 + 2]
mov rcx, qword [rbp - 0x48]
mov rax, rcx
cmp rdx, 0x1000
jb 0x16a36
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x16a36
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.00023b00
movzx eax, bl
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.00023ae0
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