Function at 0x4012a0
Capabilities:
Query service status
Start service
Stop service
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x445360
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x45c3a4]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov bl, 1
mov dword [ebp - 0x80], vtable.CServiceControlManager.0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0
mov dword [ebp - 4], 0
sub esp, 8
lea ecx, [ebp - 0x80]
mov byte [ebp - 4], bl
call fcn.0040c5a0
test al, al
jne 0x401347
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x8c]
mov dword [ebp - 0x58], str.OpenService
call fcn.0041bb11
push 0x4589e8
lea eax, [ebp - 0x8c]
push eax
mov dword [ebp - 0x8c], vtable.std::runtime_error.0
call fcn.0041de2b
mov esi, dword [ebp - 0x78]
test esi, esi
je 0x401368
lea eax, [ebp - 0x58]
push eax
push 0x24
lea eax, [ebp - 0x38]
push eax
push 0
push esi
mov dword [ebp - 0x58], 0
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
cmp dword [ebp - 0x34], 4
jne 0x401442
push str.CAppMain::OnRestart
push str.Stopping_service...
push 0x462e98
call fcn.00402460
add esp, 0xc
test esi, esi
je 0x4013b2
lea eax, [ebp - 0x54]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x4013b2
push ecx
lea ecx, [ebp - 0x80]
call fcn.0040c620
mov esi, dword [ebp - 0x78]
test al, al
jne 0x401437
push str.CAppMain::OnRestart
push str.Unable_to_stop_service._Killing_process...
push 0x462e98
call fcn.00402460
add esp, 0xc
mov dword [ebp - 0x68], vtable.CProcessManager.0
push 0
push 0
mov dword [ebp - 0x64], 0
mov dword [ebp - 0x60], 0
call fcn.0040b160
mov dword [ebp - 0x64], eax
lea ecx, [ebp - 0x68]
mov byte [ebp - 4], 2
call fcn.0040ae10
mov byte [ebp - 4], 1
push dword [ebp - 0x1c]
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
test edi, edi
je 0x40141d
push 0
push edi
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x64]
mov dword [ebp - 0x68], vtable.CProcessManager.0
call fcn.0040b120
push dword [ebp - 0x64]
call fcn.0041b8e3
add esp, 4
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
push str.CAppMain::OnRestart
push str.Starting_service...
push 0x462e98
call fcn.00402460
add esp, 0xc
test esi, esi
je 0x4014d1
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x4014d1
push ecx
lea ecx, [ebp - 0x80]
call fcn.0040c620
mov eax, dword [ebp - 0x78]
test eax, eax
je 0x401496
lea ecx, [ebp - 0x58]
push ecx
push 0x24
lea ecx, [ebp - 0x38]
push ecx
push 0
push eax
mov dword [ebp - 0x58], 0
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
cmp dword [ebp - 0x34], 4
je 0x401550
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x98]
mov dword [ebp - 0x58], str.StartService2
call fcn.0041bb11
push 0x4589e8
lea eax, [ebp - 0x98]
push eax
mov dword [ebp - 0x98], vtable.std::runtime_error.0
call fcn.0041de2b
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0xa8]
mov dword [ebp - 0x58], str.StartService
call fcn.0041bb11
push 0x4589e8
lea eax, [ebp - 0xa8]
push eax
mov dword [ebp - 0xa8], vtable.std::runtime_error.0
call fcn.0041de2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x9c]
push eax
mov eax, dword [ecx]
call dword [eax + 4]
push eax
push str.CAppMain::OnRestart
push str.Error:___s__LastError__0x_08X_
push 0x462e98
call fcn.00402460
add esp, 0x14
push str.CAppMain::OnRestart
push str.Failed_to_restart_service.
push 0x462e98
call fcn.00402460
add esp, 0xc
mov byte [ebp - 0x59], 0
mov eax, 0x40154d
ret
lea ecx, [ebp - 0x80]
call fcn.0040c540
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0041b8d4
mov esp, ebp
pop ebp
ret