Function at 0x1402a5470
Capabilities:
Query environment variable

Disassembly:
mov rax, rsp
push rbp
push rdi
push r13
push r14
push r15
lea rbp, [rax - 0x1f8]
sub rsp, 0x2d0
mov qword [rsp + 0x48], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x14044e770]
xor rax, rsp
mov qword [rbp + 0x1c0], rax
mov r14, r8
mov rsi, rdx
lea r13, str.WinDefend
mov rdx, r13
lea rcx, [rsp + 0x50]
call fcn.14004a9e4
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x50]
call fcn.1402a65c8
mov ebx, eax
lea rcx, [rsp + 0x50]
call fcn.14004b500
cmp ebx, 0x80070424
jne 0x1402a555e
call fcn.14004acb4
mov rcx, qword [rax + 8]
mov ebx, 4
cmp dword [rcx], ebx
jbe 0x1402a5531
lea rax, str.Defender_not_installed_on_this_machine___not_enabling_Sense_mode
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], 0x82
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403a3d4e]
call fcn.140001158
xor eax, eax
mov rcx, qword [rbp + 0x1c0]
xor rcx, rsp
call fcn.1402ae860
lea r11, [rsp + 0x2d0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop rdi
pop rbp
ret
xor edi, edi
test ebx, ebx
jns 0x1402a558d
lea rax, str.Failed_to_get_Defender_run_state
lea edx, [rdi + 0x3e]
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
mov r9d, ebx
mov qword [rsp + 0x20], rax
mov rcx, qword [rbp + 0x1f8]
call fcn.14016b7bc
mov eax, ebx
jmp 0x1402a5533
call fcn.14004acb4
mov r10, qword [rax + 8]
mov ebx, 4
cmp dword [r10], ebx
jbe 0x1402a5613
lea rax, str.Enabling_Sense_for_Windows_Defender
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], VarR8FromUI1
mov rax, rsi
cmp qword [rsi + 0x18], 8
jb 0x1402a55c0
mov rax, qword [rsi]
lea rdx, [0x14030cae0]
mov rcx, rdi
test rax, rax
je 0x1402a55df
mov rdx, rax
or rcx, 0xffffffffffffffff
inc rcx
cmp word [rax + rcx*2], di
jne 0x1402a55d6
mov qword [rbp - 0x60], rdx
lea eax, [rcx*2 + 2]
mov dword [rbp - 0x58], eax
mov dword [rbp - 0x54], edi
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403a3df2]
mov rcx, r10
call fcn.140001158
lea r15, str.SOFTWAREMicrosoftWindows_DefenderFeatures
mov rdx, r15
lea rcx, [rsp + 0x70]
call fcn.14004a9e4
nop
lea rdx, str.SenseOrgId
lea rcx, [rsp + 0x50]
call fcn.14004a9e4
mov byte [rsp + 0x20], 1
xor r9d, r9d
lea r8, [rsp + 0x70]
mov rdx, rsi
lea rcx, [rsp + 0x50]
call fcn.1401c61ac
mov esi, eax
lea rcx, [rsp + 0x50]
call fcn.14004b500
nop
lea rcx, [rsp + 0x70]
call fcn.14004b500
test esi, esi
jns 0x1402a56a1
lea rax, str.Failed_setting_SenseOrgId_under_Defender_registry__ws
mov edx, 0x47
mov qword [rsp + 0x28], r15
mov rcx, qword [rbp + 0x1f8]
mov qword [rsp + 0x20], rax
mov r9d, esi
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
call fcn.14016b7bc
mov eax, esi
jmp 0x1402a5533
mov rdx, r15
lea rcx, [rsp + 0x50]
call fcn.14004a9e4
nop
lea rdx, str.SenseEnabled
lea rcx, [rsp + 0x70]
call fcn.14004a9e4
lea r8, [rsp + 0x50]
mov edx, 1
lea rcx, [rsp + 0x70]
call fcn.140168048
mov esi, eax
lea rcx, [rsp + 0x70]
call fcn.14004b500
nop
lea rcx, [rsp + 0x50]
call fcn.14004b500
test esi, esi
jns 0x1402a5700
lea rax, str.Failed_setting_SenseEnabled_under_Defender_registry__ws
mov edx, VarR8FromUI1
jmp 0x1402a567a
mov rdx, r15
lea rcx, [rsp + 0x50]
call fcn.14004a9e4
nop
lea rdx, str.GeoPreferenceId
lea rcx, [rsp + 0x70]
call fcn.14004a9e4
mov byte [rsp + 0x20], 1
xor r9d, r9d
lea r8, [rsp + 0x50]
mov rdx, r14
lea rcx, [rsp + 0x70]
call fcn.1401c61ac
mov esi, eax
lea rcx, [rsp + 0x70]
call fcn.14004b500
nop
lea rcx, [rsp + 0x50]
call fcn.14004b500
test esi, esi
jns 0x1402a5765
lea rax, str.Failed_setting_GeoPreferenceId_under_Defender_registry__ws
mov edx, 0x4f
jmp 0x1402a567a
call fcn.14004acb4
mov rcx, qword [rax + 8]
cmp dword [rcx], ebx
jbe 0x1402a57b6
lea rax, str.Defender_run_state
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], 0x26
lea rax, [rsp + 0x40]
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], 4
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403a3e5e]
call fcn.140001158
cmp dword [rsp + 0x40], 1
jne 0x1402a5531
call fcn.14004acb4
mov rcx, qword [rax + 8]
cmp dword [rcx], ebx
jbe 0x1402a580d
lea rax, str.Defender_service_is_stopped._Starting_it.
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], 0x54
mov qword [rbp - 0x60], r13
mov qword [rbp - 0x58], reloc.OLEAUT32.dll_SafeArrayLock
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403a3dc5]
call fcn.140001158
mov r8d, 0x104
lea rdx, [rbp - 0x50]
lea rcx, str._SystemRoot_System32DriversWdBoot.sys
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
dec eax
cmp eax, 0x103
ja 0x1402a589f
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
lea edx, [r9 + 1]
mov r8d, edx
lea rcx, [rbp - 0x50]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
test rax, rax
jne 0x1402a5863
lea edx, [rax + 0x6a]
jmp 0x1402a5879
cmp rbx, 0xffffffffffffffff
je 0x1402a588c
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_InstallELAMCertificateInfo]
test eax, eax
jne 0x1402a588c
lea edx, [rax + 0x6e]
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
mov rcx, qword [rbp + 0x1f8]
call fcn.14023ae94
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1402a589f
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
call fcn.1402a53ac
mov ebx, eax
test eax, eax
jns 0x1402a5531
lea rax, str.Failed_to_start_Defender_service
mov edx, reloc.WS2_32.dll_WSACleanup
jmp 0x1402a556e