Function at 0x402390
Capabilities:
Get session information
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40e4c3
mov eax, dword fs:[0]
push eax
sub esp, 0xe0
mov eax, dword [0x414024]
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 ebx, ecx
push 0x88
lea eax, [ebp - 0xe0]
mov dword [ebp - 0xec], ebx
push 0
push eax
mov dword [ebp - 4], 0
call sub.VCRUNTIME140.dll_memset
add esp, 8
lea ecx, [ebp - 0xe0]
call fcn.0040a140
lea ecx, [ebp - 0xe0]
mov byte [ebp - 4], 1
call fcn.0040acc0
push 0xa
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0xe0]
call fcn.0040a800
mov byte [ebp - 4], 2
cmp dword [ebp - 0x20], 0
je 0x40259d
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
lea ecx, [ebp - 0x18]
mov dword [ebp - 0xe4], 0
push ecx
lea ecx, [ebp - 0xe4]
mov dword [ebp - 0x18], 0
push ecx
push 0x18
push eax
push 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x40259d
mov eax, dword [ebp - 0xe4]
test eax, eax
je 0x40259d
mov ecx, dword [eax + 0xcc]
mov esi, dword [eax]
mov edi, dword [eax + 0xc8]
push eax
mov dword [ebp - 0xe8], ecx
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
test esi, esi
jne 0x40259d
cmp dword [ebp - 0xe8], esi
jl 0x40259d
jg 0x40249b
test edi, edi
je 0x40259d
push 0xf0001
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40258b
cmp dword [ebp - 0x1c], 0x10
lea ecx, [ebp - 0x30]
push 0xa0000000
cmovae ecx, dword [ebp - 0x30]
push ecx
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x402551
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x58]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40252a
cmp dword [ebp - 0x54], 1
jne 0x402543
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
push eax
push str.Start_service_:__d
push str.ws_update_service
mov dword [ebp - 0xe8], eax
call fcn.00401b30
add esp, 0xc
cmp dword [ebp - 0xe8], 0
jne 0x402543
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_start_the_service.__error_:__d_
jmp 0x402536
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Failed_to_QueryServiceStatus.__error_:__d_
push str.ws_update_service
call fcn.00401aa0
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
jmp 0x40259d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cannot_open_service.__error_:__d_
push str.ws_update_service
call fcn.00401aa0
add esp, 0xc
lea ecx, [ebp - 0xe0]
call fcn.0040b940
lea ecx, [ebp - 0xe0]
call fcn.0040b670
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
jmp 0x40259d
push str.Cannot_open_SCManager.
push str.ws_update_service
call fcn.00401aa0
add esp, 8
mov eax, dword [ebp - 0x1c]
cmp eax, 0x10
jb 0x4025af
inc eax
push eax
push dword [ebp - 0x30]
call fcn.00402aa0
lea ecx, [ebp - 0xe0]
mov dword [ebp - 0x1c], 0xf
mov dword [ebp - 0x20], 0
mov byte [ebp - 0x30], 0
call fcn.0040a540
jmp 0x4025ec
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebx + 4]
push 0
push 0xa
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
call dword [eax + 8]
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.0040d22b
mov esp, ebp
pop ebp
ret 4