Function at 0x180021040
Capabilities:
Create service
Delete service
Query service status
Start service

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x4d0
mov rax, qword [0x1800680c0]
xor rax, rsp
mov qword [rsp + 0x4c0], rax
xor ebx, ebx
lea rcx, [0x18006b480]
xor sil, sil
mov dword [rsp + 0x70], ebx
test rdx, rdx
lea rax, str.system32drivers_S.sys
mov r13d, 1
lea r12, [0x18005e158]
mov r15, rdx
cmove r12, rax
cmove r15, rcx
mov edi, ebx
mov r14d, r13d
nop dword [rax + rax]
mov r9, rcx
lea r8, [0x18005e158]
lea rcx, [rsp + 0xa0]
mov edx, 0x104
call fcn.180021e00
mov r9, r15
lea rcx, [rsp + 0x2b0]
mov r8, r12
mov edx, 0x104
call fcn.180021e00
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rbp, rax
test rax, rax
je 0x1800212af
mov qword [rsp + 0x60], rbx
lea rax, [rsp + 0x70]
mov qword [rsp + 0x58], rbx
lea r8, [rsp + 0xa0]
mov qword [rsp + 0x50], rbx
lea rdx, [rsp + 0xa0]
mov qword [rsp + 0x48], rax
mov r9d, 0xf01ff
lea rax, [0x18005e190]
mov rcx, rbp
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x2b0]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], r13d
mov dword [rsp + 0x28], r13d
mov dword [rsp + 0x20], r13d
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
test byte [0x18006b960], 8
mov rbx, rax
jne 0x18002125a
test rax, rax
je 0x180021190
xor r8d, r8d
xor edx, edx
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
je 0x1800211f0
movzx esi, r13b
jmp 0x18002123f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp eax, 0x431
jne 0x180021283
mov r8d, 0x14
lea rdx, [0x18006b480]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rbx, rax
test rax, rax
je 0x180021252
lea rdx, [rsp + 0x78]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x1800211de
cmp dword [rsp + 0x7c], 4
je 0x18002123c
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x18002123c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rbx
cmp eax, 0x241
je 0x18002121d
call qword [sym.imp.ADVAPI32.dll_DeleteService]
inc r14d
cmp r14d, 3
jg 0x180021288
xor ebx, ebx
lea rcx, [0x18006b480]
jmp 0x1800210b0
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, 0xfffffffd
jmp 0x1800212b4
mov sil, 1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rbx
mov edi, eax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x180021283
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x180021281
test rbx, rbx
je 0x18002126e
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
movzx esi, r13b
jmp 0x180021283
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
movzx esi, sil
cmove esi, r13d
mov edi, eax
call fcn.1800218d0
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test rbx, rbx
je 0x18002129f
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
movzx eax, sil
dec eax
jmp 0x1800212b4
mov eax, 0xffffffff
mov rcx, qword [rsp + 0x4c0]
xor rcx, rsp
call fcn.180023640
lea r11, [rsp + 0x4d0]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret