Function at 0x40ecc0
Capabilities:
Query service status
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x4ae44c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov bl, byte [ebp + 8]
push esi
push edi
push 0xf003f
push 0
push 0
mov esi, ecx
mov byte [ebp - 0x21], 1
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [ebp - 0x30], edi
test edi, edi
jne 0x40ed2e
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [edi + 4]
push eax
mov eax, dword [esi + 4]
push 0x485294
push eax
push str.Failed_to_open_service_control_manager_for_
push str.sssi
push esi
call ecx
add esp, 0x18
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046b17c
mov esp, ebp
pop ebp
ret 4
movzx edx, bl
neg edx
sbb edx, edx
and edx, 0xfffffff0
add edx, 0x20
or edx, 4
lea ecx, [esi + 4]
push edx
call dword [sym.imp.mfc100u.dll_]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edx, eax
xor eax, eax
mov dword [ebp - 0x2c], edx
cmp edx, eax
jne 0x40ed9f
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [edi + 4]
push eax
mov eax, dword [esi + 4]
push 0x485294
push eax
push str.Failed_to_open_service_
push str.sssi
push esi
call ecx
mov edx, dword [ebp - 0x30]
add esp, 0x18
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046b17c
mov esp, ebp
pop ebp
ret 4
mov dword [ebp - 0x28], eax
xor al, al
xor cl, cl
test bl, bl
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
je 0x40eec5
mov byte [ebp - 0x22], al
mov byte [ebp - 0x23], cl
jmp 0x40edc9
mov al, byte [ebp - 0x22]
mov cl, byte [ebp - 0x23]
mov edx, dword [ebp - 0x2c]
test al, al
jne 0x40ee54
test cl, cl
jne 0x40ee54
cmp dword [ebp - 0x28], 0x14
jge 0x40ee54
lea eax, [ebp - 0x20]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40ee1d
mov eax, dword [ebp - 0x1c]
cmp eax, 1
jne 0x40ee02
push 0x1f4
mov byte [ebp - 0x22], al
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40ee42
cmp eax, 4
je 0x40ee0c
cmp eax, 2
jne 0x40ee10
mov byte [ebp - 0x23], 1
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40ee42
mov edi, dword [esi]
call ebx
mov ecx, dword [esi + 4]
mov edx, dword [edi + 4]
push eax
push 0x485294
push ecx
push str.Failed_to_query_service_status_for_
push str.sssi
push esi
call edx
add esp, 0x18
mov byte [ebp - 0x21], 0
inc dword [ebp - 0x28]
cmp byte [ebp - 0x21], 0
jne 0x40edc0
jmp 0x40f047
cmp byte [ebp - 0x21], 0
je 0x40f047
test al, al
je 0x40f047
test cl, cl
jne 0x40f047
push 0
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40eea2
mov edi, dword [esi]
call ebx
mov ecx, dword [edi + 4]
push eax
mov eax, dword [esi + 4]
push 0x485294
push eax
push 0x4853cc
push str.sssi
push esi
call ecx
add esp, 0x18
mov byte [ebp - 0x21], 0
mov eax, dword [esi + 4]
mov edx, dword [esi]
mov ecx, dword [edx + 4]
push 0x4853c8
push eax
push str.Successfully_started_service_
push 0x484c3c
push esi
call ecx
add esp, 0x14
jmp 0x40f047
mov byte [ebp - 0x23], al
mov byte [ebp - 0x22], cl
jmp 0x40eed9
mov al, byte [ebp - 0x23]
mov cl, byte [ebp - 0x22]
mov edx, dword [ebp - 0x2c]
test al, al
jne 0x40ef69
test cl, cl
jne 0x40ef69
cmp dword [ebp - 0x28], 0x14
jge 0x40ef69
lea eax, [ebp - 0x20]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40ef32
mov eax, dword [ebp - 0x1c]
cmp eax, 4
jne 0x40ef17
push 0x1f4
mov byte [ebp - 0x23], 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40ef57
cmp eax, 1
je 0x40ef21
cmp eax, 3
jne 0x40ef25
mov byte [ebp - 0x22], 1
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40ef57
mov edi, dword [esi]
call ebx
mov ecx, dword [esi + 4]
mov edx, dword [edi + 4]
push eax
push 0x485294
push ecx
push str.Failed_to_query_service_status_for_
push str.sssi
push esi
call edx
add esp, 0x18
mov byte [ebp - 0x21], 0
inc dword [ebp - 0x28]
cmp byte [ebp - 0x21], 0
jne 0x40eed0
jmp 0x40f047
cmp byte [ebp - 0x21], 0
je 0x40f047
test al, al
je 0x40f047
test cl, cl
jne 0x40f047
lea eax, [ebp - 0x20]
push eax
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40efbb
mov edi, dword [esi]
call ebx
mov ecx, dword [esi + 4]
mov edx, dword [edi + 4]
push eax
push 0x485294
push ecx
push str.Failed_to_stop_service_
push str.sssi
push esi
call edx
mov byte [ebp - 0x21], 0
jmp 0x40f044
xor edi, edi
lea ecx, [ecx]
mov al, byte [ebp - 0x22]
test al, al
jne 0x40f073
cmp edi, 0x28
jge 0x40f06f
mov ecx, dword [ebp - 0x2c]
lea eax, [ebp - 0x20]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40f001
cmp dword [ebp - 0x1c], 1
jne 0x40eff3
mov byte [ebp - 0x22], 1
inc edi
jmp 0x40efc0
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
inc edi
jmp 0x40efc0
mov edi, dword [esi]
call ebx
mov edx, dword [esi + 4]
push eax
mov eax, dword [edi + 4]
push 0x485294
push edx
push str.Service_stop_failed._Failed_to_query_service_status_for_
push str.sssi
push esi
call eax
add esp, 0x18
mov byte [ebp - 0x21], 0
mov edi, dword [esi]
call ebx
mov ecx, dword [esi + 4]
mov edx, dword [edi + 4]
push eax
push 0x485294
push ecx
push str.Failed_to_stop_service_
push str.sssi
push esi
call edx
add esp, 0x18
mov eax, dword [ebp - 0x2c]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push eax
call esi
mov ecx, dword [ebp - 0x30]
push ecx
call esi
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 0x21]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0046b17c
mov esp, ebp
pop ebp
ret 4
test al, al
je 0x40f026
mov edx, dword [esi + 4]
mov ecx, dword [esi]
mov eax, dword [ecx + 4]
push 0x4853c8
push edx
push str.Successfully_stopped_service_
push 0x484c3c
push esi
call eax
add esp, 0x14
jmp 0x40f047