Function at 0x140021030
Capabilities:
Modify service

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x30]
sub rsp, 0x130
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov rax, qword [0x140228058]
xor rax, rsp
mov qword [rbp + 0x20], rax
mov r14d, r8d
mov rbx, rdx
mov qword [rbp - 0x58], rdx
xor r15b, r15b
mov rcx, qword [rcx + 8]
xor r12d, r12d
test rcx, rcx
je 0x140021264
cmp qword [rdx + 0x18], 8
jb 0x140021085
mov rdx, qword [rdx]
mov r8d, r9d
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
xor eax, eax
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], rax
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], rax
mov qword [rbp - 0x10], rax
mov qword [rbp - 8], rax
mov qword [rbp], rax
mov qword [rbp + 8], rax
mov qword [rbp + 0x10], rax
mov qword [rbp - 0x60], r12
mov rcx, r12
lea rdx, vtable.std::_Func_impl_no_alloc_int____cdecl___struct_SC_HANDLE______ptr64___int__struct_SC_HANDLE______ptr64_.0
cmp qword [sym.imp.ADVAPI32.dll_CloseServiceHandle], rax
je 0x1400210ed
mov qword [rsp + 0x68], rdx
mov rax, qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov qword [rsp + 0x70], rax
lea rax, [rsp + 0x68]
mov qword [rbp - 0x60], rax
lea rcx, [rsp + 0x68]
mov qword [rbp - 0x30], rdi
mov rax, r12
mov qword [rbp + 0x10], rax
test rcx, rcx
je 0x140021129
mov qword [rbp - 0x28], rdx
mov rax, qword [rcx + 8]
mov qword [rbp - 0x20], rax
lea rax, [rbp - 0x28]
mov qword [rbp + 0x10], rax
lea rdx, [rsp + 0x68]
cmp rcx, rdx
je 0x140021129
mov edx, 0x10
call fcn.14013db80
mov rax, qword [rbp + 0x10]
test rdi, rdi
je 0x140021222
mov dword [rbp - 0x50], r12d
xorps xmm0, xmm0
movdqu xmmword [rbp - 0x48], xmm0
mov qword [rbp - 0x38], r12
lea r9, [rbp - 0x50]
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x1400211a6
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x1400211a6
mov eax, dword [rbp - 0x50]
test eax, eax
je 0x1400211a6
mov edx, eax
lea r8, [rbp - 0x48]
lea rcx, [rbp - 0x48]
call fcn.140022c40
mov rsi, qword [rbp - 0x48]
lea r9, [rbp - 0x50]
mov r8d, dword [rbp - 0x50]
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
setne r15b
test eax, eax
je 0x1400211a6
test rsi, rsi
je 0x1400211a6
cmp r14d, dword [rsi + 4]
je 0x1400211e4
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x48], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], r12
mov r9d, 0xffffffff
mov r8d, r14d
mov edx, r9d
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
setne r15b
mov rcx, qword [rbp - 0x48]
test rcx, rcx
je 0x14002121e
mov rdx, qword [rbp - 0x38]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140021219
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400212dd
call fcn.14013db80
mov rax, qword [rbp + 0x10]
cmp qword [rbp - 0x30], 0
je 0x140021248
test rax, rax
je 0x1400212d1
mov rcx, qword [rbp - 0x30]
mov rax, qword [rax + 8]
call qword [case.0x14001ac40.0]
mov qword [rbp - 0x30], r12
mov rax, qword [rbp + 0x10]
test rax, rax
je 0x140021264
lea rcx, [rbp - 0x28]
cmp rax, rcx
je 0x140021264
mov edx, 0x10
mov rcx, rax
call fcn.14013db80
nop
mov rdx, qword [rbx + 0x18]
cmp rdx, 8
jb 0x14002129f
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbx]
cmp rdx, 0x1000
jb 0x14002129a
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x1400212d7
mov rcx, r8
call fcn.14013db80
mov qword [rbx + 0x10], r12
mov qword [rbx + 0x18], 7
mov word [rbx], r12w
movzx eax, r15b
mov rcx, qword [rbp + 0x20]
xor rcx, rsp
call fcn.14013df50
add rsp, 0x130
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
call fcn.14011b9e0
nop
call fcn.14015fb1c
nop
call fcn.14015fb1c
int3