Function at 0x1402d6340
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 [0x14049e510]
xor rax, rsp
mov qword [rbp + 0x1c0], rax
mov rsi, r8
mov rdi, rdx
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x60], xmm0
xor r14d, r14d
mov word [rsp + 0x50], r14w
lea r13, str.WinDefend
mov rdx, r13
lea rcx, [rsp + 0x50]
call fcn.14004d5c4
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x50]
call fcn.14024f5a4
mov ebx, eax
lea rcx, [rsp + 0x50]
call fcn.14004e0f0
cmp ebx, 0x80070424
jne 0x1402d6444
call fcn.14004d8a4
mov rcx, qword [rax + 8]
lea ebx, [r14 + 4]
cmp dword [rcx], ebx
jbe 0x1402d6417
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, [0x1403dfd91]
call fcn.140001158
xor eax, eax
mov rcx, qword [rbp + 0x1c0]
xor rcx, rsp
call fcn.1402dfdb0
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
test ebx, ebx
jns 0x1402d6473
lea rax, str.Failed_to_get_Defender_run_state
mov edx, 0x3e
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
mov r9d, ebx
mov qword [rsp + 0x20], rax
mov rcx, qword [rbp + 0x1f8]
call fcn.140177750
mov eax, ebx
jmp 0x1402d6419
call fcn.14004d8a4
mov r10, qword [rax + 8]
mov ebx, 4
cmp dword [r10], ebx
jbe 0x1402d64fb
lea rax, str.Enabling_Sense_for_Windows_Defender
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], VarR8FromUI1
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x1402d64a6
mov rcx, qword [rdi]
lea rdx, [0x140344690]
mov rax, r14
test rcx, rcx
je 0x1402d64c6
mov rdx, rcx
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], r14w
jne 0x1402d64bc
mov qword [rbp - 0x60], rdx
lea eax, [rax*2 + 2]
mov dword [rbp - 0x58], eax
mov dword [rbp - 0x54], r14d
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e6c25]
mov rcx, r10
call fcn.140001158
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rbp - 0x80], xmm0
mov word [rsp + 0x70], r14w
lea r15, str.SOFTWAREMicrosoftWindows_DefenderFeatures
mov rdx, r15
lea rcx, [rsp + 0x70]
call fcn.14004d5c4
nop
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x60], xmm0
mov word [rsp + 0x50], r14w
lea rdx, str.SenseOrgId
lea rcx, [rsp + 0x50]
call fcn.14004d5c4
mov byte [rsp + 0x20], 1
xor r9d, r9d
lea r8, [rsp + 0x70]
mov rdx, rdi
lea rcx, [rsp + 0x50]
call fcn.1401d6420
mov edi, eax
lea rcx, [rsp + 0x50]
call fcn.14004e0f0
nop
lea rcx, [rsp + 0x70]
call fcn.14004e0f0
test edi, edi
jns 0x1402d65b0
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, edi
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
call fcn.140177750
mov eax, edi
jmp 0x1402d6419
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x60], xmm0
mov word [rsp + 0x50], r14w
mov rdx, r15
lea rcx, [rsp + 0x50]
call fcn.14004d5c4
nop
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rbp - 0x80], xmm0
mov word [rsp + 0x70], r14w
lea rdx, str.SenseEnabled
lea rcx, [rsp + 0x70]
call fcn.14004d5c4
lea r8, [rsp + 0x50]
mov edx, 1
lea rcx, [rsp + 0x70]
call fcn.140173c88
mov edi, eax
lea rcx, [rsp + 0x70]
call fcn.14004e0f0
nop
lea rcx, [rsp + 0x50]
call fcn.14004e0f0
test edi, edi
jns 0x1402d6636
lea rax, str.Failed_setting_SenseEnabled_under_Defender_registry__ws
mov edx, VarR8FromUI1
jmp 0x1402d6589
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rsp + 0x60], xmm0
mov word [rsp + 0x50], r14w
mov rdx, r15
lea rcx, [rsp + 0x50]
call fcn.14004d5c4
nop
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rbp - 0x80], xmm0
mov word [rsp + 0x70], r14w
lea rdx, str.GeoPreferenceId
lea rcx, [rsp + 0x70]
call fcn.14004d5c4
mov byte [rsp + 0x20], 1
xor r9d, r9d
lea r8, [rsp + 0x50]
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.1401d6420
mov edi, eax
lea rcx, [rsp + 0x70]
call fcn.14004e0f0
nop
lea rcx, [rsp + 0x50]
call fcn.14004e0f0
test edi, edi
jns 0x1402d66c2
lea rax, str.Failed_setting_GeoPreferenceId_under_Defender_registry__ws
mov edx, 0x4f
jmp 0x1402d6589
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], ebx
jbe 0x1402d6713
lea rax, str.Defender_run_state
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], MsiGetActiveDatabase
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, [0x1403e6c50]
call fcn.140001158
cmp dword [rsp + 0x40], 1
jne 0x1402d6417
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], ebx
jbe 0x1402d676a
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, [0x1403e6bb7]
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 0x1402d67fc
mov qword [rsp + 0x30], r14
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 0x1402d67c0
lea edx, [rax + 0x6a]
jmp 0x1402d67d6
cmp rbx, 0xffffffffffffffff
je 0x1402d67e9
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_InstallELAMCertificateInfo]
test eax, eax
jne 0x1402d67e9
lea edx, [rax + 0x6e]
lea r8, str.amcorewcd_sourcecommon_srcdefendersettings.cpp
mov rcx, qword [rbp + 0x1f8]
call fcn.140250bd0
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1402d67fc
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
call fcn.1402d626c
mov ebx, eax
test eax, eax
jns 0x1402d6417
lea rax, str.Failed_to_start_Defender_service
mov edx, reloc.WS2_32.dll_WSACleanup
jmp 0x1402d6454