Function at 0x140013870
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, [0x140148ea8]
lea r13, [0x1400057f8]
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x1400138c3
test byte [rcx + 0x1c], 1
je 0x1400138c3
mov edx, 0x40
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
mov edi, 0x400d377a
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
jne 0x14001392b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x140013912
test byte [rcx + 0x1c], 2
je 0x140013912
cmp byte [rcx + 0x19], 2
jb 0x140013912
lea edx, [rbx + 0x41]
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
cmp esi, 5
jne 0x140013921
mov edi, 0xc00d37e7
jmp 0x140013ae5
mov edi, 0xc00d37e8
jmp 0x140013ab4
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 0x1400139b9
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp eax, 0x424
jne 0x140013983
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x14001397c
test byte [rcx + 0x1c], 2
je 0x14001397c
cmp byte [rcx + 0x19], 4
jb 0x14001397c
lea edx, [rbp + 0x42]
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
xor esi, esi
jmp 0x140013aab
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x1400139af
test byte [rcx + 0x1c], 2
je 0x1400139af
cmp byte [rcx + 0x19], 2
jb 0x1400139af
mov edx, 0x43
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov edi, 0xc00d37e9
jmp 0x140013aab
mov rdx, rax
mov rcx, rbx
call fcn.140013650
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x1400139fe
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x1400139fa
test byte [rcx + 0x1c], 2
je 0x1400139fa
cmp byte [rcx + 0x19], 4
jb 0x1400139fa
mov edx, 0x44
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
xor esi, esi
jmp 0x140013a70
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp eax, 0x430
jne 0x140013a3f
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x140013a36
test byte [rcx + 0x1c], 2
je 0x140013a36
cmp byte [rcx + 0x19], 4
jb 0x140013a36
mov edx, 0x45
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
xor esi, esi
mov edi, 0x400d377b
jmp 0x140013a70
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x140013a6b
test byte [rcx + 0x1c], 2
je 0x140013a6b
cmp byte [rcx + 0x19], 2
jb 0x140013a6b
mov edx, 0x46
mov r9d, eax
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov edi, 0xc00d37ea
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, qword [r14 + 0x28]
sub rcx, 0x18
call fcn.140011504
add rax, 0x18
mov qword [rsp + 0x80], rax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r8d, eax
lea rdx, [rsp + 0x80]
mov rcx, rbx
call fcn.140013170
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test esi, esi
jne 0x140013ae5
lea edx, [rsi + 4]
and qword [rsp + 0x28], 0
and qword [rsp + 0x20], 0
mov r9, qword [r14 + 0x28]
mov r8d, edi
mov rcx, r14
call fcn.1400125c4
xor r8d, r8d
mov edx, edi
call fcn.140022c78
jmp 0x140013b75
mov rax, qword [section..data]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140015690]
lea rcx, section..data
call rbx
add rax, 0x18
mov qword [rsp + 0x78], rax
mov r8d, esi
lea rdx, [0x1400057e0]
lea rcx, [rsp + 0x78]
call fcn.1400157a0
mov edx, 1
and qword [rsp + 0x28], 0
mov rbx, qword [rsp + 0x78]
mov qword [rsp + 0x20], rbx
mov r9, qword [r14 + 0x28]
mov r8d, edi
mov rcx, r14
call fcn.1400125c4
mov r8d, esi
mov edx, edi
call fcn.140022c78
nop
lea r14, [rbx - 0x18]
lock add dword [r14 + 0x10], 0xffffffff
jg 0x140013b75
mov rdi, qword [r14]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140015690]
mov rdx, r14
mov rcx, rdi
call rbx
mov rcx, qword [0x140148ea8]
cmp rcx, r12
je 0x140013bb1
test byte [rcx + 0x1c], 1
je 0x140013bb1
movzx r9d, byte [rcx + 0x19]
mov eax, esi
neg eax
sbb edx, edx
and edx, 0xfffffffd
add edx, 5
cmp r9d, edx
jl 0x140013bb1
mov edx, 0x47
mov r9d, esi
mov r8, r13
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov eax, esi
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