Function at 0x409240
Capabilities:
Check for time delay via gettickcount
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x45d240
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x5c
push esi
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
mov dword [ebp - 0x1c], edi
mov dword [ebp - 4], 0
test edi, edi
jne 0x4092cb
push 0x3d0
push str.nidscosdepDaemon.cpp
sub esp, 0x14
xorps xmm0, xmm0
mov eax, esp
movups xmmword [eax], xmm0
mov dword [eax + 0x10], 0
movq qword [eax + 4], xmm0
mov dword [eax + 0xc], 0
mov dword [eax + 0x10], 0
mov dword [eax], vtable.ni::dsc::exception::ServiceFailure.0
lea eax, [ebp - 0x34]
push eax
call fcn.00407430
add esp, 0x20
lea eax, [ebp - 0x34]
push 0x473990
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
mov ecx, dword [ebp + 8]
push 0xf01ff
call fcn.0040e0a0
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
mov dword [ebp - 0x20], esi
mov byte [ebp - 4], 1
test esi, esi
jne 0x4092f4
push 0x3d5
jmp 0x409281
lea eax, [ebp - 0x10]
push eax
push 0x24
lea eax, [ebp - 0x68]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x409315
push 0x3db
jmp 0x409281
mov eax, dword [ebp - 0x64]
cmp eax, 1
je 0x40934d
cmp eax, 3
je 0x40933e
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
pop esi
mov esp, ebp
pop ebp
ret
push 0
push 1
push dword [ebp + 8]
call fcn.004094b0
add esp, 0xc
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x409391
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x420
je 0x409391
push 0x3ec
push str.nidscosdepDaemon.cpp
sub esp, 0x14
xorps xmm0, xmm0
mov ecx, esp
movups xmmword [ecx], xmm0
mov dword [ecx + 0x10], 0
call fcn.00407850
jmp 0x4092b1
lea eax, [ebp - 0x10]
push eax
push 0x24
lea eax, [ebp - 0x68]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4093af
push 0x3f1
jmp 0x409370
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x64]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x14], eax
cmp ecx, 2
jne 0x409445
nop word [eax + eax]
mov eax, 0xcccccccd
mov ecx, 0x2710
mul dword [ebp - 0x50]
shr edx, 3
cmp edx, 0x3e8
jae 0x4093ef
mov edx, 0x3e8
jmp 0x4093f8
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x10]
push eax
push 0x24
lea eax, [ebp - 0x68]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x409476
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x54], eax
jbe 0x40942f
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x14], eax
jmp 0x40943d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x50]
ja 0x409471
mov ecx, dword [ebp - 0x64]
cmp ecx, 2
je 0x4093d0
cmp ecx, 4
jne 0x4094a3
mov eax, dword [ebp + 0x14]
test al, al
je 0x409322
push eax
push esi
call fcn.00407c20
add esp, 8
test eax, eax
jns 0x409322
push 0x41c
jmp 0x409370
mov ecx, dword [ebp - 0x64]
jmp 0x409445
push 0x406
push str.nidscosdepDaemon.cpp
sub esp, 0x24
mov ecx, esp
call fcn.0040a8f0
lea eax, [ebp - 0x44]
push eax
call fcn.004074a0
add esp, 0x30
lea eax, [ebp - 0x44]
push 0x4739cc
jmp 0x4092c5
push 0x420
jmp 0x409370