Function at 0x40ec70
Capabilities:
Query service status
Start service

Disassembly:
sub esp, 0x228
mov eax, dword [0x422760]
xor eax, esp
mov dword [esp + 0x224], eax
cmp dword [esp + 0x230], 1
push ebp
mov ebp, dword [esp + 0x238]
jge 0x40ecb6
push 1
call fcn.004095e0
add esp, 4
pop ebp
mov ecx, dword [esp + 0x224]
xor ecx, esp
call fcn.004126f3
add esp, 0x228
ret
mov eax, dword [ebp]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40ecc0
sub eax, edx
sar eax, 1
add eax, 0xffffffff
js 0x40ece3
mov ecx, dword [ebp]
cmp word [ecx + eax*2], 0x2f
je 0x40ece3
sub eax, 1
jns 0x40ecd4
push ebx
lea edx, [eax + eax + 2]
add dword [ebp], edx
mov ebx, dword [ebp]
push esi
push 5
call fcn.0040c840
mov esi, eax
add esp, 4
test esi, esi
jne 0x40ed30
push 0x400001fb
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 8
lea eax, [esi + 2]
pop esi
pop ebx
pop ebp
mov ecx, dword [esp + 0x224]
xor ecx, esp
call fcn.004126f3
add esp, 0x228
ret
push edi
mov edi, dword [esp + 0x23c]
mov eax, 4
cmp edi, 0x80
ja case.0x40ed4c.4
movzx ecx, byte [edi + 0x40f01c]
jmp dword [ecx*4 + 0x40f008]
mov eax, 0x14
jmp case.0x40ed4c.4
mov eax, 0x44
jmp case.0x40ed4c.4
mov eax, 0x24
jmp case.0x40ed4c.4
mov eax, 0x104
push 0x100
lea edx, [esp + 0x38]
push edx
push eax
push ebx
push esi
call fcn.0040c880
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x40ed97
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [ebx + 3]
jmp 0x40ee2a
test edi, edi
jne 0x40eea7
mov eax, dword [esp + 0x240]
push ebp
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp edi, 0x3e5
jne 0x40edcc
xor edi, edi
jmp 0x40edd4
test ebp, ebp
je 0x40ee6e
push 1
push 0
lea esi, [esp + 0x20]
call fcn.0040c330
add esp, 8
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40ee43
push 0
call fcn.0040e290
mov ecx, dword [esp + 0x20]
add esp, 4
push eax
push ecx
call fcn.0040e380
add esp, 4
push eax
lea edx, [esp + 0x3c]
push edx
push 0x40000227
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 0x14
mov eax, 1
mov ecx, dword [esp + 0x234]
pop edi
pop esi
pop ebx
pop ebp
xor ecx, esp
call fcn.004126f3
add esp, 0x228
ret
push edi
call fcn.00404fa0
add esp, 4
push eax
push 0
call fcn.0040e290
add esp, 4
push eax
lea eax, [esp + 0x3c]
push eax
push str._s:__s:__s
call fcn.004139ba
add esp, 0x10
xor eax, eax
jmp 0x40ee2a
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call fcn.00404fa0
add esp, 4
push eax
push 0
call fcn.0040e290
add esp, 4
push eax
lea ecx, [esp + 0x3c]
push ecx
push str._s:__s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
jmp 0x40ee22
lea edx, [esp + 0x18]
push edx
cmp edi, 4
jne 0x40ef0d
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
je 0x40eee3
mov eax, dword [esp + 0x1c]
push eax
call fcn.0040e380
push eax
push 0x41e84c
call fcn.004139ba
add esp, 0xc
xor eax, eax
jmp 0x40ee2a
push eax
call fcn.00404fa0
add esp, 4
push eax
lea ecx, [esp + 0x38]
push ecx
push str._s:__s_n
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x10
jmp 0x40ee25
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov ebp, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp ebp, 0x3e5
jne 0x40ef3c
xor ebp, ebp
jmp 0x40ef43
cmp dword [esp + 0x14], 0
je 0x40efb1
mov ecx, dword [esp + 0x10]
push ecx
push edi
lea esi, [esp + 0x20]
call fcn.0040c330
add esp, 8
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x40ef84
push edi
call fcn.0040e290
mov edx, dword [esp + 0x20]
add esp, 4
push eax
push edx
call fcn.0040e380
add esp, 4
push eax
lea eax, [esp + 0x3c]
push eax
jmp 0x40ee0f
push ebp
call fcn.00404fa0
add esp, 4
push eax
push edi
call fcn.0040e290
add esp, 4
push eax
lea ecx, [esp + 0x3c]
push ecx
push str._s:__s:__s
call fcn.004139ba
add esp, 0x10
xor eax, eax
jmp 0x40ee2a
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call fcn.00404fa0
add esp, 4
push eax
push edi
call fcn.0040e290
add esp, 4
push eax
lea edx, [esp + 0x3c]
push edx
push str._s:__s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x14
cmp ebp, 0x426
jne 0x40ee25
cmp edi, 5
je 0x40f001
cmp edi, 1
jne 0x40ee25
xor eax, eax
jmp 0x40ee2a