Function at 0x140031ef0
Capabilities:
Connect pipe
Read pipe
Stop service
Write pipe

Disassembly:
push rbx
push rdi
sub rsp, 0x8e8
lea rcx, [rsp + 0xc0]
xor edx, edx
mov r8d, 0x200
xor ebx, ebx
call fcn.14007cd30
bt dword [0x1400dd138], 0xa
jae 0x140031f27
lea rcx, str.StopGlobalService_is_called
call fcn.14000cbb0
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 4]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
test rax, rax
mov rdi, rax
jne 0x140031f73
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.StopGlobalService._failed_to_open_SCM._err_d
lea rcx, [rsp + 0xc0]
mov r8d, eax
call fcn.14007dc1c
lea rcx, [rsp + 0xc0]
call fcn.140014620
mov eax, ebx
add rsp, 0x8e8
pop rdi
pop rbx
ret
cmp dword [0x1400df34c], 7
lea rax, str.Ati_HotKey_Poller
lea rdx, str.Ati_External_Event_Utility
mov r8d, 0x34
mov rcx, rdi
cmovbe rdx, rax
mov qword [rsp + 0x908], rbp
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
test rax, rax
mov rbp, rax
jne 0x140031fda
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.StopGlobalService._failed_to_OpenService._err_d
lea rcx, [rsp + 0xc0]
mov r8d, eax
call fcn.14007dc1c
lea rcx, [rsp + 0xc0]
call fcn.140014620
jmp 0x1400321a4
xor eax, eax
lea rcx, [rsp + 0x2c0]
xor edx, edx
mov r8d, 0x620
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x44], eax
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x4c], eax
mov dword [rsp + 0x50], eax
mov dword [rsp + 0x54], eax
mov dword [rsp + 0x58], eax
call fcn.14007cd30
xor edx, edx
lea rcx, [rsp + 0x60]
lea r8d, [rdx + 0x2c]
call fcn.14007cd30
xor edx, edx
lea rcx, [rsp + 0x90]
lea r8d, [rdx + 0x2c]
mov dword [rsp + 0x2c8], 0x40
mov dword [rsp + 0x2c0], 0x8001
mov dword [rsp + 0x2c4], 0x620
call fcn.14007cd30
lea rax, [rsp + 0x900]
mov dword [rsp + 0x30], ebx
mov qword [rsp + 0x28], rax
lea r9, [rsp + 0x90]
lea rdx, [rsp + 0x2c0]
lea rcx, str..pipeExtEventPipe_Service
mov r8d, 0x620
mov dword [rsp + 0x20], 0x2c
call qword [sym.imp.KERNEL32.dll_CallNamedPipeA]
test eax, eax
je 0x1400320d7
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x1400320d7
lea rcx, [rsp + 0x90]
lea rdx, [rsp + 0x60]
mov rax, qword [rcx]
mov qword [rdx], rax
mov rax, qword [rcx + 8]
mov qword [rdx + 8], rax
mov rax, qword [rcx + 0x10]
mov qword [rdx + 0x10], rax
mov rax, qword [rcx + 0x18]
mov qword [rdx + 0x18], rax
mov rax, qword [rcx + 0x20]
mov qword [rdx + 0x20], rax
mov eax, dword [rcx + 0x28]
mov dword [rdx + 0x28], eax
cmp dword [rsp + 0x88], 2
jne 0x14003219b
mov qword [rsp + 0x8e0], r12
mov r12d, 1
lea r8, [rsp + 0x40]
mov edx, r12d
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x140032134
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.StopGlobalService._failed_to_ControlService._err_d
lea rcx, [rsp + 0xc0]
mov r8d, eax
call fcn.14007dc1c
lea rcx, [rsp + 0xc0]
call fcn.140014620
jmp 0x140032193
mov r8d, dword [rsp + 0x6c]
xor edx, edx
mov ecx, 0x100000
mov qword [rsp + 0x910], rsi
call qword [sym.imp.KERNEL32.dll_OpenProcess]
test rax, rax
mov rsi, rax
jne 0x14003216e
bt dword [0x1400dd138], 0xa
jae 0x14003218b
lea rcx, str.StopGlobalService:_open_service_process_fails__n
call fcn.14000cbb0
jmp 0x14003218b
mov edx, 0x3e8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rsi
test eax, eax
cmove ebx, r12d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rsi, qword [rsp + 0x910]
mov r12, qword [rsp + 0x8e0]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rbp, qword [rsp + 0x908]
mov eax, ebx
add rsp, 0x8e8
pop rdi
pop rbx
ret