Function at 0x140001740
Capabilities:
Get session user name
Stop service

Disassembly:
push rbp
push r14
lea rbp, [rsp - 0x188]
sub rsp, 0x288
mov rax, qword [0x140022008]
xor rax, rsp
mov qword [rbp + 0x170], rax
xor r14d, r14d
mov dword [rsp + 0x28], 0x101
lea rdx, [rsp + 0x28]
mov qword [rsp + 0x20], r14
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x30]
call fcn.140001ce0
cmp qword [rsp + 0x48], 8
lea rdx, [rsp + 0x30]
lea rcx, str.___Current_user_is:__s_n
cmovae rdx, qword [rsp + 0x30]
call fcn.140001ac0
mov rdx, qword [rsp + 0x48]
cmp rdx, 8
jb 0x1400017f2
mov rcx, qword [rsp + 0x30]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400017ed
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001aa8
call fcn.140001e50
lea rdx, [rsp + 0x20]
lea rcx, str.winlogon.exe
call section..text
test eax, eax
je 0x140001a9d
lea rdx, [rsp + 0x20]
lea rcx, str.lsass.exe
call section..text
test eax, eax
je 0x140001a9d
mov rcx, qword [rsp + 0x20]
call fcn.140001440
mov qword [rsp + 0x20], rax
test rax, rax
je 0x140001a9d
lea rcx, str.___CreateTokenWinDefend_success__n
call fcn.140001ac0
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x140001a7c
lea rcx, str.___ImpersonatedLoggedOnUser___success__n
call fcn.140001ac0
lea rdx, [rsp + 0x28]
mov dword [rsp + 0x28], 0x101
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x30]
call fcn.140001ce0
cmp qword [rsp + 0x48], 8
lea rdx, [rsp + 0x30]
lea rcx, str.___Current_user_is:__s_n
cmovae rdx, qword [rsp + 0x30]
call fcn.140001ac0
mov rdx, qword [rsp + 0x48]
cmp rdx, 8
jb 0x1400018ed
mov rcx, qword [rsp + 0x30]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400018e8
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001a97
call fcn.140001e50
xor edx, edx
mov qword [rsp + 0x2a8], rsi
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
jne 0x140001959
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____OpenSCManager_failed___d__n
call fcn.140001ac0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____StopDefenderServices_Error:__i_n
call fcn.140001ac0
mov rsi, qword [rsp + 0x2a8]
xor eax, eax
mov rcx, qword [rbp + 0x170]
xor rcx, rsp
call fcn.140001e30
add rsp, 0x288
pop r14
pop rbp
ret
mov qword [rsp + 0x2a0], rbx
lea rcx, str.___OpenSCManager_success__n
mov qword [rsp + 0x2b0], rdi
mov qword [rsp + 0x280], r15
call fcn.140001ac0
lea rbx, str.WdFilter
lea r15, str.Unknown_exception
nop dword [rax + rax]
mov rdx, qword [rbx]
mov r8d, 0x2c
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
test rax, rax
jne 0x1400019c4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, qword [rbx]
lea rcx, str.____OpenService__s_failed___d__n
mov r8d, eax
call fcn.140001ac0
jmp 0x140001a34
mov rdx, qword [rbx]
lea rcx, str.___OpenService__s_success__n
call fcn.140001ac0
lea r8, [rsp + 0x30]
mov edx, 1
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x140001a16
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x426
je 0x140001a16
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Stop_attempt_failed___Error__d__n
call fcn.140001ac0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140001a34
mov rdx, qword [rbx]
lea rcx, str.____s_stopped_successfully__n
call fcn.140001ac0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r14d, 1
add rbx, 8
cmp rbx, r15
jl 0x140001990
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r15, qword [rsp + 0x280]
mov rdi, qword [rsp + 0x2b0]
mov rbx, qword [rsp + 0x2a0]
test r14d, r14d
je 0x140001921
lea rcx, str.___StopDefenderServices_success__n
call fcn.140001ac0
jmp 0x140001935
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____ImpersonatedLoggedOnUser___Error:__i_n
call fcn.140001ac0
xor eax, eax
jmp 0x14000193f
call fcn.1400060fc
int3
mov ecx, 1
call fcn.140008c24
int3
call fcn.1400060fc
int3