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

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
sub rsp, 0x110
mov qword [rsp + 0xf8], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
movzx r13d, r9b
mov rbp, r8
mov r12d, edx
mov rsi, rcx
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rdi, rax
mov qword [rsp + 0x100], rax
test rax, rax
jne 0x1400048bf
lea rcx, [rsp + 0x60]
call qword [sym.imp.MSVCR90.dll_public:_void___cdecl_std::exception::constructor_void____ptr64]
xor r11d, r11d
mov dword [rsp + 0x78], r11d
mov qword [rsp + 0x80], r11
lea rax, vtable.ni::dsc::exception::ServiceFailure.0
mov qword [rsp + 0x60], rax
mov r9d, 0x3d0
lea r8, str.nidscosdepDaemon.cpp
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
mov rcx, rsi
call fcn.140006ce0
mov rdx, rax
mov r8d, 0xf01ff
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
mov qword [rsp + 0xf0], rax
test rax, rax
jne 0x140004944
lea rcx, [rsp + 0x60]
call qword [sym.imp.MSVCR90.dll_public:_void___cdecl_std::exception::constructor_void____ptr64]
xor r11d, r11d
mov dword [rsp + 0x78], r11d
mov qword [rsp + 0x80], r11
lea rax, vtable.ni::dsc::exception::ServiceFailure.0
mov qword [rsp + 0x60], rax
mov r9d, 0x3d5
lea r8, str.nidscosdepDaemon.cpp
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r9d, 0x24
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x1400049c3
lea rcx, [rsp + 0x60]
call qword [sym.imp.MSVCR90.dll_public:_void___cdecl_std::exception::constructor_void____ptr64]
xor r11d, r11d
mov dword [rsp + 0x78], r11d
mov qword [rsp + 0x80], r11
lea rax, vtable.ni::dsc::exception::ServiceFailure.0
mov qword [rsp + 0x60], rax
mov r9d, 0x3db
lea r8, str.nidscosdepDaemon.cpp
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
mov eax, dword [rsp + 0x3c]
cmp eax, 1
je 0x1400049f6
cmp eax, 3
je 0x1400049e9
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140004c35
xor r8d, r8d
mov dl, 1
mov rcx, rsi
call fcn.140003c00
mov r8, rbp
mov edx, r12d
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x140004a52
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x420
je 0x140004a52
lea rcx, [rsp + 0x60]
call fcn.140002590
mov r9d, 0x3ec
lea r8, str.nidscosdepDaemon.cpp
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
mov r9d, 0x24
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x140004ab2
lea rcx, [rsp + 0x60]
call fcn.140002590
mov r9d, 0x3f1
lea r8, str.nidscosdepDaemon.cpp
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, eax
mov esi, dword [rsp + 0x4c]
mov ecx, dword [rsp + 0x3c]
cmp ecx, 2
jne 0x140004b8e
mov r12d, 0x2710
mov eax, 0xcccccccd
mul dword [rsp + 0x50]
shr edx, 3
cmp edx, 0x3e8
jae 0x140004aec
mov edx, 0x3e8
jmp 0x140004af3
cmp edx, r12d
cmova edx, r12d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea r11, [rsp + 0x30]
mov qword [rsp + 0x20], r11
mov r9d, 0x24
lea r8, [rsp + 0x38]
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x140004b52
cmp dword [rsp + 0x4c], esi
jbe 0x140004b33
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, eax
mov esi, dword [rsp + 0x4c]
jmp 0x140004b41
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, ebp
cmp eax, dword [rsp + 0x50]
ja 0x140004b4c
mov ecx, dword [rsp + 0x3c]
cmp ecx, 2
je 0x140004ad1
jmp 0x140004b8e
mov ecx, dword [rsp + 0x3c]
jmp 0x140004b8e
lea rcx, [rsp + 0x60]
call fcn.140005b80
mov r9d, 0x406
lea r8, str.nidscosdepDaemon.cpp
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140002080
lea rdx, [0x14000f230]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
int3
cmp ecx, 4
jne 0x140004bf9
test r13b, r13b
je 0x140004be4
movzx edx, r13b
mov rcx, rbx
call fcn.140004c60
test eax, eax
jns 0x140004be4
lea rcx, [rsp + 0x60]
call fcn.140002590
mov r9d, 0x41c
lea r8, str.nidscosdepDaemon.cpp
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
nop
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140004c35
lea rcx, [rsp + 0x60]
call fcn.140002590
mov r9d, 0x420
lea r8, str.nidscosdepDaemon.cpp
mov rdx, rax
lea rcx, [rsp + 0xa8]
call fcn.140002790
lea rdx, [0x14000f2c8]
lea rcx, [rsp + 0xa8]
call fcn.14000858a
nop
lea r11, [rsp + 0x110]
mov rbx, qword [r11 + 0x20]
mov rbp, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r13
pop r12
pop rdi
ret