Function at 0x180045da0
Capabilities:
Modify service
Query service status
Start service

Disassembly:
mov byte [rsp + 0x20], r9b
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0xb8
mov byte [rsp + 0x60], 0
mov r8d, 0xf003f
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0x88], 0
je 0x180046027
mov r8d, 0xf01ff
mov rdx, qword [rsp + 0xc0]
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov qword [rsp + 0x70], rax
cmp qword [rsp + 0x70], 0
je 0x180046005
mov dword [rsp + 0x68], 0
lea r9, [rsp + 0x68]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
cmp dword [rsp + 0x68], 0
je 0x180045fe6
mov eax, dword [rsp + 0x68]
shl eax, 1
mov eax, eax
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x78], rax
mov eax, dword [rsp + 0x68]
shl eax, 1
lea r9, [rsp + 0x68]
mov r8d, eax
mov rdx, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
je 0x180045fc7
lea rdx, [rsp + 0x90]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x180045e9e
mov dword [rsp + 0x94], 1
mov rax, qword [rsp + 0x78]
cmp dword [rax], 1
jne 0x180045edb
mov rax, qword [rsp + 0x78]
cmp dword [rax + 4], 1
jne 0x180045edb
mov rax, qword [rsp + 0x78]
cmp dword [rax + 8], 1
jne 0x180045edb
mov rax, qword [rsp + 0x78]
mov rdx, qword [rax + 0x10]
mov rcx, qword [rsp + 0xc8]
call fcn.180046040
movzx eax, al
test eax, eax
jne 0x180045f59
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov rax, qword [rsp + 0xc8]
mov qword [rsp + 0x20], rax
mov r9d, 1
mov r8d, 1
mov edx, 1
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
je 0x180045f4c
cmp dword [rsp + 0x94], 1
je 0x180045f59
mov dword [rsp + 0x84], 0
jmp 0x180045f64
mov dword [rsp + 0x84], 1
movzx eax, byte [rsp + 0x84]
mov byte [rsp + 0x60], al
movzx eax, byte [rsp + 0xd8]
test eax, eax
je 0x180045fc7
movzx eax, byte [rsp + 0x60]
test eax, eax
je 0x180045fb0
cmp dword [rsp + 0x94], 4
je 0x180045fa3
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x180045fb0
mov dword [rsp + 0x80], 1
jmp 0x180045fbb
mov dword [rsp + 0x80], 0
movzx eax, byte [rsp + 0x80]
mov byte [rsp + 0x60], al
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x64], eax
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [rsp + 0x64]
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x64], eax
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [rsp + 0x64]
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x64], eax
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [rsp + 0x64]
call qword [sym.imp.KERNEL32.dll_SetLastError]
movzx eax, byte [rsp + 0x60]
add rsp, 0xb8
ret