Function at 0x14002d6bc
Capabilities:
Delete service

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x180]
sub rsp, 0x280
mov rax, qword [0x1400502a8]
xor rax, rsp
mov qword [rbp + 0x170], rax
xor ebx, ebx
mov qword [rsp + 0x50], rcx
xor edi, edi
or rsi, 0xffffffffffffffff
mov r14, rdx
cmp rcx, rsi
je 0x14002d9fa
test rdx, rdx
je 0x14002d9fa
and dword [rsp + 0x40], ebx
lea rax, [rsp + 0x40]
mov qword [rsp + 0x30], rax
xor r9d, r9d
and dword [rsp + 0x28], ebx
xor r8d, r8d
and qword [rsp + 0x20], rbx
xor edx, edx
mov rcx, r14
call qword [sym.imp.SETUPAPI.dll_SetupGetLineTextW]
test eax, eax
je 0x14002d9fa
mov eax, dword [rsp + 0x40]
inc eax
mov ecx, eax
mov dword [rsp + 0x40], eax
lea eax, [rbx + 2]
mul rcx
cmovo rax, rsi
mov rcx, rax
call fcn.14003c460
mov qword [rsp + 0x58], rax
mov r15, rax
test rax, rax
je 0x14002d9fa
mov ecx, dword [rsp + 0x40]
xor r9d, r9d
and qword [rsp + 0x30], rbx
xor r8d, r8d
mov dword [rsp + 0x28], ecx
xor edx, edx
mov rcx, r14
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupGetLineTextW]
mov rcx, r15
test eax, eax
jne 0x14002d7d3
call fcn.14003c408
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [rbx + 0x57]
test eax, eax
lea rdx, str.Failed_to_get_information_from_inf_with_error_code_0x_x._r_n
cmove eax, ecx
lea ecx, [rdi + 4]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
mov r8d, ebx
call fcn.1400168a8
mov eax, ebx
jmp 0x14002d9fe
lea rdx, [0x140043808]
call qword [sym.imp.msvcrt.dll_wcstok]
mov rsi, rax
test rax, rax
je 0x14002d9ea
mov r15, qword [rsp + 0x50]
mov r12d, 0x57
mov r8, rsi
lea rdx, str._Parsing_DeleteServices_section:_S._r_n
mov ecx, 4
call fcn.1400168a8
mov r9, r14
xor r8d, r8d
mov rdx, rsi
mov rcx, r15
call qword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
test eax, eax
je 0x14002d9ca
mov rdx, rsi
mov dword [rsp + 0x44], 1
mov rcx, r15
call qword [sym.imp.SETUPAPI.dll_SetupGetLineCountW]
mov ecx, eax
mov dword [rsp + 0x48], eax
mov esi, eax
call fcn.140015a28
cmp esi, 1
jb 0x14002d9ca
mov esi, dword [rsp + 0x44]
mov r15d, dword [rsp + 0x48]
mov ecx, esi
call fcn.140015b2c
and qword [rsp + 0x20], 0
lea r8, [rsp + 0x60]
inc esi
mov r9d, 0x105
mov edx, 1
mov dword [rsp + 0x44], esi
mov rcx, r14
call qword [sym.imp.SETUPAPI.dll_SetupGetStringFieldW]
test eax, eax
je 0x14002d9ac
lea rdx, [rsp + 0x60]
xor ecx, ecx
mov esi, 1
call fcn.14002c88c
test eax, eax
je 0x14002d96d
mov ebx, 0xf003f
xor edx, edx
mov r8d, ebx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r12, rax
test rax, rax
je 0x14002d958
mov r8d, ebx
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x14002d931
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x14002d910
xor esi, esi
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [rsi + 0x57]
test eax, eax
lea r8, [rsp + 0x60]
cmove eax, ecx
lea rdx, str.ERROR:_Failed_to_delete_service_:__S.__Result:_0x_x._r_n
mov r9d, eax
lea ecx, [rsi + 2]
call fcn.1400168a8
lea r8, [rsp + 0x60]
mov ecx, 4
lea rdx, str.Deletion_of_service_:__S_succeeded._r_n
call fcn.1400168a8
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14002d947
lea r8, [rsp + 0x60]
mov ecx, 4
lea rdx, str.Could_not_open_service_:__S._r_n
call fcn.1400168a8
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r12d, 0x57
jmp 0x14002d994
xor esi, esi
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_Failed_to_open_SCM:__S.__Result:_0x_x._r_n
lea r12d, [rsi + 0x57]
jmp 0x14002d97c
xor esi, esi
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_Failed_to_delete_service_:__S.__Result:_0x_x._r_n
test eax, eax
lea r8, [rsp + 0x60]
mov ecx, 2
cmove eax, r12d
mov r9d, eax
call fcn.1400168a8
mov eax, esi
neg eax
mov eax, 0x80004005
sbb ebx, ebx
not ebx
and ebx, eax
test esi, esi
mov esi, dword [rsp + 0x44]
cmove edi, eax
mov rdx, r14
mov rcx, r14
call qword [sym.imp.SETUPAPI.dll_SetupFindNextLine]
test eax, eax
je 0x14002d9c5
cmp esi, r15d
jbe 0x14002d858
mov r15, qword [rsp + 0x50]
lea rdx, [0x140043808]
xor ecx, ecx
call qword [sym.imp.msvcrt.dll_wcstok]
mov rsi, rax
test rax, rax
jne 0x14002d7f7
mov r15, qword [rsp + 0x58]
mov rcx, r15
call fcn.14003c408
test ebx, ebx
js 0x14002d9fa
test edi, edi
jne 0x14002d9fc
mov edi, ebx
mov eax, edi
mov rcx, qword [rbp + 0x170]
xor rcx, rsp
call fcn.14003c810
lea r11, [rsp + 0x280]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret