Function at 0x140006e10
Capabilities:
Delete service

Disassembly:
mov rax, rsp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x40
mov qword [rax - 0x38], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x20], rbp
mov r14, rcx
lea r12, [0x140106190]
lea r13, [0x1400dc2f8]
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006e63
test byte [rcx + 0x1c], 1
je 0x140006e63
mov edx, 0x40
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003574
mov esi, 0x400d377a
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
jne 0x140006ecb
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006eb2
test byte [rcx + 0x1c], 2
je 0x140006eb2
cmp byte [rcx + 0x19], 2
jb 0x140006eb2
lea edx, [rbx + 0x41]
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003634
cmp edi, 5
jne 0x140006ec1
mov esi, 0xc00d37e7
jmp 0x14000707f
mov esi, 0xc00d37e8
jmp 0x14000704e
mov r8d, 0x10024
mov rdx, qword [r14 + 0x28]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbp, rax
test rax, rax
jne 0x140006f59
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp eax, 0x424
jne 0x140006f23
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006f1c
test byte [rcx + 0x1c], 2
je 0x140006f1c
cmp byte [rcx + 0x19], 4
jb 0x140006f1c
lea edx, [rbp + 0x42]
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003574
xor edi, edi
jmp 0x140007045
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006f4f
test byte [rcx + 0x1c], 2
je 0x140006f4f
cmp byte [rcx + 0x19], 2
jb 0x140006f4f
mov edx, 0x43
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003634
mov esi, 0xc00d37e9
jmp 0x140007045
mov rdx, rax
mov rcx, rbx
call fcn.140006bec
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x140006f9e
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006f9a
test byte [rcx + 0x1c], 2
je 0x140006f9a
cmp byte [rcx + 0x19], 4
jb 0x140006f9a
mov edx, 0x44
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003574
xor edi, edi
jmp 0x140007010
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp eax, 0x430
jne 0x140006fdf
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140006fd6
test byte [rcx + 0x1c], 2
je 0x140006fd6
cmp byte [rcx + 0x19], 4
jb 0x140006fd6
mov edx, 0x45
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003574
xor edi, edi
mov esi, 0x400d377b
jmp 0x140007010
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x14000700b
test byte [rcx + 0x1c], 2
je 0x14000700b
cmp byte [rcx + 0x19], 2
jb 0x14000700b
mov edx, 0x46
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003634
mov esi, 0xc00d37ea
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, qword [r14 + 0x28]
sub rcx, 0x18
call fcn.140004c20
add rax, 0x18
mov qword [rsp + 0x78], rax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
lea rdx, [rsp + 0x78]
mov rcx, rbx
call fcn.140006710
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
jne 0x14000707f
lea edx, [rdi + 4]
and qword [rsp + 0x28], 0
and qword [rsp + 0x20], 0
mov r9, qword [r14 + 0x28]
mov r8d, esi
mov rcx, r14
call fcn.140005c28
xor r8d, r8d
mov edx, esi
call fcn.1400153c8
jmp 0x14000710d
mov rax, qword [0x140108fd0]
lea rcx, [0x140108fd0]
mov rax, qword [rax + 0x18]
call qword [case.0x14006e230.0]
add rax, 0x18
mov qword [rsp + 0x80], rax
mov r8d, edi
lea rdx, [0x1400dc2e0]
lea rcx, [rsp + 0x80]
call fcn.140008d6c
mov edx, 1
and qword [rsp + 0x28], 0
mov rbx, qword [rsp + 0x80]
mov qword [rsp + 0x20], rbx
mov r9, qword [r14 + 0x28]
mov r8d, esi
mov rcx, r14
call fcn.140005c28
mov r8d, edi
mov edx, esi
call fcn.1400153c8
nop
lea rdx, [rbx - 0x18]
or eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x14000710d
mov rcx, qword [rdx]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [case.0x14006e230.0]
mov rcx, qword [0x140106190]
cmp rcx, r12
je 0x140007149
test byte [rcx + 0x1c], 1
je 0x140007149
movzx r9d, byte [rcx + 0x19]
mov eax, edi
neg eax
sbb edx, edx
and edx, 0xfffffffd
add edx, 5
cmp r9d, edx
jl 0x140007149
mov edx, 0x47
mov r9d, edi
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.140003634
mov eax, edi
lea r11, [rsp + 0x40]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x48]
mov rsp, r11
pop r14
pop r13
pop r12
pop rdi
pop rsi
ret