Function at 0x14002d5cc
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 0x14002d90a
test rdx, rdx
je 0x14002d90a
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 0x14002d90a
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.14003c310
mov qword [rsp + 0x58], rax
mov r15, rax
test rax, rax
je 0x14002d90a
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 0x14002d6e3
call fcn.14003c2b8
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.140016868
mov eax, ebx
jmp 0x14002d90e
lea rdx, [0x140043808]
call qword [sym.imp.msvcrt.dll_wcstok]
mov rsi, rax
test rax, rax
je 0x14002d8fa
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.140016868
mov r9, r14
xor r8d, r8d
mov rdx, rsi
mov rcx, r15
call qword [sym.imp.SETUPAPI.dll_SetupFindFirstLineW]
test eax, eax
je 0x14002d8da
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.1400159e8
cmp esi, 1
jb 0x14002d8da
mov esi, dword [rsp + 0x44]
mov r15d, dword [rsp + 0x48]
mov ecx, esi
call fcn.140015aec
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 0x14002d8bc
lea rdx, [rsp + 0x60]
xor ecx, ecx
mov esi, 1
call fcn.14002c79c
test eax, eax
je 0x14002d87d
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 0x14002d868
mov r8d, ebx
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x14002d841
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x14002d820
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.140016868
lea r8, [rsp + 0x60]
mov ecx, 4
lea rdx, str.Deletion_of_service_:__S_succeeded._r_n
call fcn.140016868
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14002d857
lea r8, [rsp + 0x60]
mov ecx, 4
lea rdx, str.Could_not_open_service_:__S._r_n
call fcn.140016868
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r12d, 0x57
jmp 0x14002d8a4
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 0x14002d88c
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.140016868
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 0x14002d8d5
cmp esi, r15d
jbe 0x14002d768
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 0x14002d707
mov r15, qword [rsp + 0x58]
mov rcx, r15
call fcn.14003c2b8
test ebx, ebx
js 0x14002d90a
test edi, edi
jne 0x14002d90c
mov edi, ebx
mov eax, edi
mov rcx, qword [rbp + 0x170]
xor rcx, rsp
call fcn.14003c6c0
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