Function at 0x402d70
Capabilities:
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5653e8
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
mov eax, dword [0x5c2f60]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
call fcn.00405c10
mov ebx, dword [eax]
mov ecx, dword [ebx - 0x10]
lea esi, [ebx - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi + 0xc], 0
mov ecx, eax
lea eax, [esi + 0xc]
jl 0x402dc1
cmp ecx, dword [esi]
jne 0x402dc1
lock inc dword [eax]
jmp 0x402deb
mov eax, dword [ecx]
lea edi, [esi + 4]
push 2
push dword [edi]
call dword [eax]
mov esi, eax
test esi, esi
je 0x402f93
mov eax, dword [edi]
lea ecx, [esi + 0x10]
mov dword [esi + 4], eax
mov edx, dword [edi]
inc edx
push edx
push ebx
call fcn.004036d0
add esp, 8
add esi, 0x10
mov dword [ebp - 0x34], esi
mov dword [ebp - 4], 0
mov edx, dword [esi - 0xc]
test edx, edx
js 0x402f98
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x402e20
push edx
lea ecx, [ebp - 0x34]
call fcn.00403860
mov esi, dword [ebp - 0x34]
push dword [esi - 8]
push esi
call fcn.005476ad
add esp, 8
test eax, eax
js 0x402f98
cmp eax, dword [esi - 8]
jg 0x402f98
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
xor dl, dl
mov ecx, esi
call fcn.00405b30
push 1
push 0
push 0
mov byte [ebp - 0x2d], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [ebp - 0x38], edi
test edi, edi
jne 0x402e70
mov byte [ebp - 0x2d], al
jmp 0x402f39
push 0x14
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
jne 0x402e95
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov byte [ebp - 0x2d], bl
jmp 0x402f39
lea eax, [ebp - 0x2c]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x402ebc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push ebx
call edi
mov byte [ebp - 0x2d], 0
jmp 0x402f39
mov eax, dword [ebp - 0x28]
cmp eax, 4
je 0x402f21
cmp eax, 1
jne 0x402f25
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
setne byte [ebp - 0x2d]
test eax, eax
jne 0x402ef2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push ebx
call edi
jmp 0x402f39
mov edi, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
lea eax, [ebp - 0x2c]
push eax
push ebx
call edi
cmp eax, 1
jne 0x402f25
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x28], 4
je 0x402f21
lea eax, [ebp - 0x2c]
push eax
push ebx
call edi
cmp eax, 1
je 0x402f04
jmp 0x402f25
mov byte [ebp - 0x2d], 1
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call edi
push dword [ebp - 0x38]
call edi
mov al, byte [ebp - 0x2d]
mov byte [ebp - 0x2d], al
cmp byte [ebp - 0x2d], 0
mov ecx, str.Service_Start_Success
mov eax, str.Service_Start_Fail
cmovne eax, ecx
push eax
call fcn.00403c90
add esp, 4
call fcn.00405d50
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x402f77
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00540fa1
mov esp, ebp
pop ebp
ret
call fcn.00403810
push 0x80070057
call fcn.004037f0
int3