Function at 0x402d70
Capabilities:
Delete service
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [0x4224dc], eax
test eax, eax
jne 0x402df4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
push 0x42260c
call fcn.00404cf0
mov esi, dword [0x42260c]
add esp, 8
mov ebx, esp
mov dword [ebp - 4], ebx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
mov ecx, eax
lea eax, [esi - 4]
jl 0x402dd6
cmp ecx, dword [esi - 0x10]
jne 0x402dd6
lea edi, [esi - 0x10]
lock inc dword [eax]
jmp 0x402f7c
mov eax, dword [ecx]
push 1
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
je 0x402fc2
mov ecx, dword [esi - 0xc]
mov dword [edi + 4], ecx
jmp 0x402f6b
push 0x10024
push 0x41eb6c
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [0x4224d8], eax
test eax, eax
jne 0x402e1f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed_w_err_0x_08lx_n
jmp 0x402d9b
push 0x4224b8
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
js 0x402f02
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x1f4
call edi
mov ebx, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
xor esi, esi
nop word [eax + eax]
push 0x4224b8
push dword [0x4224d8]
call ebx
test eax, eax
je 0x402e78
mov eax, dword [0x4224bc]
cmp eax, 3
jne 0x402e7d
push 0x1f4
call edi
inc esi
cmp esi, 0x14
jl 0x402e50
mov eax, dword [0x4224bc]
push 0x41ebd4
cmp eax, 1
jne 0x402e8e
push str._s_is_stopped._n
jmp 0x402e93
push str._s_failed_to_stop._n
push 0x42260c
call fcn.00404cf0
mov esi, dword [0x42260c]
add esp, 8
mov ebx, esp
mov dword [ebp - 4], ebx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
mov ecx, eax
lea eax, [esi - 4]
jl 0x402ecb
cmp ecx, dword [esi - 0x10]
jne 0x402ecb
lea edi, [esi - 0x10]
lock inc dword [eax]
jmp 0x402ef5
mov eax, dword [ecx]
push 1
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
je 0x402fc2
mov ecx, dword [esi - 0xc]
mov dword [edi + 4], ecx
lea ecx, [edi + 0x10]
mov edx, dword [esi - 0xc]
inc edx
push edx
push esi
call fcn.00404b50
add esp, 8
lea eax, [edi + 0x10]
mov dword [ebx], eax
call fcn.00401710
add esp, 4
push dword [0x4224d8]
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jns 0x402f89
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeleteService_failed_w_err_0x_08lx_n
push 0x42260c
call fcn.00404cf0
mov esi, dword [0x42260c]
add esp, 8
mov ebx, esp
mov dword [ebp - 4], ebx
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
mov ecx, eax
lea eax, [esi - 4]
jl 0x402f56
cmp ecx, dword [esi - 0x10]
jne 0x402f56
lea edi, [esi - 0x10]
lock inc dword [eax]
jmp 0x402f7c
mov eax, dword [ecx]
push 1
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
je 0x402fc2
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov edx, dword [esi - 0xc]
lea ecx, [edi + 0x10]
inc edx
push edx
push esi
call fcn.00404b50
add esp, 8
lea eax, [edi + 0x10]
mov dword [ebx], eax
call fcn.00401710
add esp, 4
mov eax, dword [0x4224dc]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x402fa5
push eax
call esi
mov dword [0x4224dc], 0
mov eax, dword [0x4224d8]
test eax, eax
je 0x402fbb
push eax
call esi
mov dword [0x4224d8], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.004048e0
int3