Function at 0x41fc06
Capabilities:
Check for time delay via gettickcount
Delete registry key
Manipulate safe mode programs
Query or enumerate registry value
Query service status
Set registry value
Start service
Stop service

Disassembly:
push 0x8c
mov eax, 0x46c16b
call fcn.0042dc0b
mov al, byte [ebp + 0xc]
lea ecx, [ebp - 0x78]
mov esi, dword [ebp + 8]
mov byte [ebp - 0x79], al
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x90], esi
mov dword [ebp - 0x80], eax
call fcn.0040699e
xor ebx, ebx
push 1
push ebx
push ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ecx, eax
mov dword [ebp - 0x84], ecx
test ecx, ecx
jne 0x41fc5b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager___failed.__Error:__d
jmp 0x41fcbb
movzx eax, byte [ebp - 0x79]
xor eax, 1
mov dword [ebp - 0x8c], eax
inc eax
shl eax, 4
or eax, 4
push eax
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
push dword [ebp - 0x84]
mov edi, eax
mov dword [ebp - 0x88], edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
jne 0x41fccc
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [ebp - 0x79], bl
jne 0x41fcb3
call esi
cmp eax, 0x424
jne 0x41fcb3
mov eax, dword [ebp - 0x80]
mov esi, dword [ebp - 0x78]
mov byte [eax], bl
mov bl, 1
jmp 0x4200c0
call esi
push eax
push str.OpenService___failed._Error:__d
lea eax, [ebp - 0x78]
push eax
call fcn.00406b1a
add esp, 0xc
jmp 0x42009c
lea eax, [ebp - 0x58]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x41fcec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatus___failed._Error:__d
jmp 0x41ff39
cmp dword [ebp - 0x54], 4
mov eax, dword [ebp - 0x80]
jne 0x41fd2f
test eax, eax
je 0x41fcfc
mov byte [eax], 1
cmp byte [ebp - 0x79], bl
je 0x41fd09
push esi
push str._s_is_already_running
jmp 0x41fd40
lea eax, [ebp - 0x74]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x41ff05
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService___failed._Error:__d
jmp 0x41ff39
test eax, eax
je 0x41fd35
mov byte [eax], bl
cmp byte [ebp - 0x79], bl
jne 0x41fd7c
push esi
push str._s_is_not_running.
lea eax, [ebp - 0x78]
push eax
call fcn.00406b1a
mov esi, dword [ebp - 0x78]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x41fd63
push dword [esi - 0xc]
lea ecx, [ebp - 0x78]
call fcn.00406aae
mov esi, dword [ebp - 0x78]
push 4
push esi
mov ecx, 0x493f4c
call fcn.0040c5b8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x42006a
push ebx
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x41ff05
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x43c
jne 0x41fef1
push str.SYSTEMCurrentControlSetControlSafeBootMinimal_
lea ecx, [ebp - 0x80]
call fcn.0040c993
mov byte [ebp - 4], 1
test esi, esi
jne 0x41fdb7
mov eax, ebx
jmp 0x41fdbe
push esi
call fcn.00436130
pop ecx
push eax
push esi
lea ecx, [ebp - 0x80]
call fcn.0040c295
push str.SYSTEMCurrentControlSetControlSafeBootNetwork_
lea ecx, [ebp - 0x84]
call fcn.0040c993
mov byte [ebp - 4], 2
test esi, esi
jne 0x41fde4
mov eax, ebx
jmp 0x41fdeb
push esi
call fcn.00436130
pop ecx
push eax
push esi
lea ecx, [ebp - 0x84]
call fcn.0040c295
mov esi, dword [sym.imp.SHLWAPI.dll_SHGetValueA]
push ebx
push ebx
push ebx
push 0x487527
push dword [ebp - 0x80]
mov dword [ebp - 0x18], 0x76726553
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x14], 0x656369
call esi
push ebx
push ebx
push ebx
mov edi, eax
xor eax, eax
push 0x487527
push dword [ebp - 0x84]
cmp edi, 2
push reloc.OLEAUT32.dll_SysReAllocString
sete al
mov dword [ebp - 0x94], eax
call esi
lea esi, [eax - 2]
neg esi
sbb esi, esi
inc esi
cmp edi, 2
mov edi, dword [sym.imp.SHLWAPI.dll_SHSetValueA]
jne 0x41fe6d
push 8
lea eax, [ebp - 0x18]
push eax
push 1
push 0x487527
push dword [ebp - 0x80]
push reloc.OLEAUT32.dll_SysReAllocString
call edi
test esi, esi
je 0x41fe8b
push 8
lea eax, [ebp - 0x18]
push eax
push 1
push 0x487527
push dword [ebp - 0x84]
push reloc.OLEAUT32.dll_SysReAllocString
call edi
mov edi, dword [ebp - 0x88]
push ebx
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp dword [ebp - 0x94], 0
mov dword [ebp - 0x88], eax
je 0x41feb7
push dword [ebp - 0x80]
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHDeleteKeyA]
test esi, esi
je 0x41fecc
push dword [ebp - 0x84]
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHDeleteKeyA]
mov ecx, dword [ebp - 0x84]
lea ecx, [ecx - 0x10]
call fcn.00406c57
mov ecx, dword [ebp - 0x80]
mov byte [ebp - 4], bl
lea ecx, [ecx - 0x10]
call fcn.00406c57
cmp dword [ebp - 0x88], 0
jne 0x41feff
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService___failed._Error:__d
jmp 0x41ff39
mov esi, dword [ebp - 0x90]
mov eax, dword [ebp - 0x8c]
add eax, 2
mov dword [ebp - 0x84], eax
lea eax, [ebp - 0x98]
push eax
push 0x24
lea eax, [ebp - 0x3c]
push eax
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x41ff75
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx___failed._Error:__d
lea eax, [ebp - 0x78]
push eax
call fcn.00406b1a
mov esi, dword [ebp - 0x78]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x41ff5c
push dword [esi - 0xc]
lea ecx, [ebp - 0x78]
call fcn.00406aae
mov esi, dword [ebp - 0x78]
push 7
push esi
mov ecx, 0x493f4c
call fcn.0040c5b8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4200c0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x8c], ecx
mov ecx, dword [ebp - 0x84]
mov dword [ebp - 0x80], eax
cmp dword [ebp - 0x38], ecx
jne 0x420011
mov esi, dword [ebp - 0x8c]
mov eax, dword [ebp - 0x24]
xor edx, edx
push 0xa
pop ecx
div ecx
mov ecx, 0x3e8
cmp eax, ecx
jae 0x41ffaf
mov eax, ecx
jmp 0x41ffb9
mov ecx, 0x2710
cmp eax, ecx
cmova eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x98]
push eax
push 0x24
lea eax, [ebp - 0x3c]
push eax
push ebx
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x42000b
cmp dword [ebp - 0x28], esi
jbe 0x41ffec
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, dword [ebp - 0x28]
mov dword [ebp - 0x80], eax
jmp 0x420000
cmp dword [ebp - 0x24], 0
je 0x420000
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x24]
ja 0x42000b
mov eax, dword [ebp - 0x84]
cmp dword [ebp - 0x38], eax
je 0x41ff98
mov esi, dword [ebp - 0x90]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov cl, byte [ebp - 0x79]
mov eax, dword [ebp - 0x38]
test cl, cl
je 0x42002f
cmp eax, 4
jne 0x42006e
push esi
push str._s_has_been_started.
jmp 0x42003a
cmp eax, 1
jne 0x42006e
push esi
push str._s_has_been_stopped.
lea eax, [ebp - 0x78]
push eax
call fcn.00406b1a
mov esi, dword [ebp - 0x78]
add esp, 0xc
cmp dword [esi - 4], 1
jle 0x42005d
push dword [esi - 0xc]
lea ecx, [ebp - 0x78]
call fcn.00406aae
mov esi, dword [ebp - 0x78]
push 4
push esi
mov ecx, 0x493f4c
call fcn.0040c5b8
mov bl, 1
jmp 0x4200c0
push dword [ebp - 0x24]
test cl, cl
mov edx, str.stopped
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
push eax
mov eax, str.started
cmove eax, edx
push eax
lea eax, [ebp - 0x78]
push str.Service_not__s:_r_n_tCurrent_State:__d_r_n_tExit_Code:__d_r_n_tService_Specific_Exit_Code:__d_r_n_tCheck_Point:__d_r_n_tWait_Hint:__d
push eax
call fcn.00406b1a
add esp, 0x20
mov esi, dword [ebp - 0x78]
cmp dword [esi - 4], 1
jle 0x4200b3
push dword [esi - 0xc]
lea ecx, [ebp - 0x78]
call fcn.00406aae
mov esi, dword [ebp - 0x78]
push 7
push esi
mov ecx, 0x493f4c
call fcn.0040c5b8
lea ecx, [esi - 0x10]
call fcn.00406c57
mov al, bl
call fcn.0042dbb5
ret