Function at 0x411670
Capabilities:
Access the windows event log
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4b69d8
mov eax, dword fs:[0]
push eax
sub esp, 0xdc
mov eax, dword [0x506054]
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
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp - 0xe8], ebx
test ebx, ebx
jne 0x4117a3
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xbc]
push str.OpenSCManager_failed_with_error__d
push eax
call fcn.0040b570
mov esi, dword [ebp - 0xbc]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x411718
push dword [esi - 0xc]
lea ecx, [ebp - 0xbc]
call fcn.0040b4a0
mov esi, dword [ebp - 0xbc]
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov edi, eax
test edi, edi
je 0x41177b
push esi
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
mov dword [ebp - 0xb4], 0x4ede8c
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push edi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x411d2d
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x411d2d
push 0xf01ff
push 0x4ede8c
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
jne 0x41188c
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xbc]
push str.OpenService_failed_with_error__d
push eax
call fcn.0040b570
mov esi, dword [ebp - 0xbc]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x41181d
push dword [esi - 0xc]
lea ecx, [ebp - 0xbc]
call fcn.0040b4a0
mov esi, dword [ebp - 0xbc]
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov edi, eax
test edi, edi
je 0x411880
push esi
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
mov dword [ebp - 0xb4], 0x4ede8c
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push edi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x41177b
lea eax, [ebp - 0xc0]
push eax
push 0x24
lea eax, [ebp - 0xe4]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x411985
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed_with_error__d
lea eax, [ebp - 0xbc]
push eax
call fcn.0040b570
mov esi, dword [ebp - 0xbc]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x41190c
push dword [esi - 0xc]
lea ecx, [ebp - 0xbc]
call fcn.0040b4a0
mov esi, dword [ebp - 0xbc]
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov ebx, eax
test ebx, ebx
je 0x41196f
push esi
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 1
push ebx
mov dword [ebp - 0xb4], 0x4ede8c
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push ebx
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push dword [ebp - 0xe8]
call edi
jmp 0x41177b
mov eax, dword [ebp - 0xe0]
cmp eax, 1
je 0x411a65
cmp eax, 3
je 0x411a65
call fcn.0040bd30
test eax, eax
je 0x411e3d
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov eax, str.Service_already_running
mov dword [ebp - 4], 3
lea ecx, [ebp - 0xbc]
test eax, 0xffff0000
jne 0x4119de
movzx eax, ax
push eax
call fcn.0040b200
jmp 0x4119ea
push 0x17
push str.Service_already_running
call fcn.0040b8e0
mov dword [ebp - 4], 4
mov esi, dword [ebp - 0xbc]
cmp dword [esi - 4], 1
jle 0x411a11
push dword [esi - 0xc]
lea ecx, [ebp - 0xbc]
call fcn.0040b4a0
mov esi, dword [ebp - 0xbc]
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov ebx, eax
test ebx, ebx
je 0x41196f
push esi
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 4
jmp 0x411957
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount64]
call ebx
cmp dword [ebp - 0xe0], 3
mov ecx, 0x2710
mov esi, dword [ebp - 0xd0]
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0xb4], edx
jne 0x411b33
mov eax, 0xcccccccd
mul dword [ebp - 0xcc]
shr edx, 3
cmp edx, 0x3e8
jae 0x411aae
mov edx, 0x3e8
jmp 0x411ab7
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xc0]
push eax
push 0x24
lea eax, [ebp - 0xe4]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x411b77
cmp dword [ebp - 0xd0], esi
jbe 0x411afd
call ebx
mov esi, dword [ebp - 0xd0]
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0xb4], edx
jmp 0x411b21
call ebx
sub eax, dword [ebp - 0xbc]
sbb edx, dword [ebp - 0xb4]
test edx, edx
ja 0x411d1c
jb 0x411b21
cmp eax, dword [ebp - 0xcc]
ja 0x411d1c
cmp dword [ebp - 0xe0], 3
mov ecx, 0x2710
je 0x411a91
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x411ba0
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed_with_error__d
jmp 0x4118dd
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 5
jmp 0x4118d1
lea eax, [ebp - 0xc0]
push eax
push 0x24
lea eax, [ebp - 0xe4]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x411be6
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 7
jmp 0x4118d1
call ebx
cmp dword [ebp - 0xe0], 2
mov esi, dword [ebp - 0xd0]
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xbc], edx
jne 0x411caa
nop word [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0xcc]
shr edx, 3
cmp edx, 0x3e8
jae 0x411c2d
mov edx, 0x3e8
jmp 0x411c3b
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0xc0]
push eax
push 0x24
lea eax, [ebp - 0xe4]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x411d49
cmp dword [ebp - 0xd0], esi
jbe 0x411c81
call ebx
mov esi, dword [ebp - 0xd0]
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xbc], edx
jmp 0x411c9d
call ebx
sub eax, dword [ebp - 0xb4]
sbb edx, dword [ebp - 0xbc]
test edx, edx
ja 0x411caa
jb 0x411c9d
cmp eax, dword [ebp - 0xcc]
ja 0x411caa
cmp dword [ebp - 0xe0], 2
je 0x411c10
mov ebx, dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
cmp dword [ebp - 0xe0], 4
jne 0x411d1c
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov esi, eax
test esi, esi
je 0x411d1c
push str.Service_already_running
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
mov dword [ebp - 0xb4], 0x4ede8c
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 4
push esi
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push esi
call ebx
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0xe8]
call esi
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.004364d3
mov esp, ebp
pop ebp
ret
call fcn.0040bd30
mov ecx, eax
test ecx, ecx
je 0x411e3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0xbc], eax
mov dword [ebp - 4], 8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xbc]
push str.QueryServiceStatusEx_failed_with_error__d
push eax
call fcn.0040b570
mov esi, dword [ebp - 0xbc]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x411da8
push dword [esi - 0xc]
lea ecx, [ebp - 0xbc]
call fcn.0040b4a0
mov esi, dword [ebp - 0xbc]
push 0x4ede8c
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov ebx, eax
test ebx, ebx
je 0x411e0f
push esi
push 0x4ed750
lea eax, [ebp - 0xb0]
push 0x50
push eax
call fcn.00410230
add esp, 0x10
mov dword [ebp - 0xb4], 0x4ede8c
lea eax, [ebp - 0xb0]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0xb8]
push 0
push eax
push 0
push 2
push 0
push 0
push 0
push 1
push ebx
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
call ebx
jmp 0x411e15
mov ebx, dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x411cb0
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x411cb0
push 0x80004005
call fcn.0040bb00
int3