Function at 0x100040c4
Capabilities:
Check for time delay via gettickcount
Create service
Delete service
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
add eax, 0x4e20
push 0x6800
mov dword [ebp - 0x18], eax
call fcn.100066ac
mov edx, eax
mov edi, 0x400
mov esi, edi
mov dword [ebp - 0x14], edx
call fcn.1000674e
mov ebx, eax
mov dword [ebp - 4], ebx
call fcn.1000674e
mov esi, 0x4000
mov dword [ebp - 8], eax
call fcn.1000674e
mov esi, 0x2000
mov dword [ebp - 0x10], eax
call fcn.1000674e
push dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x2c]
call fcn.10006700
push edi
push eax
call fcn.100067b5
mov ebx, dword [ebp - 8]
lea eax, [ebp - 0x2c]
push edi
push eax
call fcn.100067b5
mov ebx, dword [ebp - 0x10]
lea eax, [ebp - 0x2c]
push 0x4000
push eax
call fcn.100067b5
add esp, 0x20
push 0xf003f
xor ebx, ebx
push ebx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, ebx
jne 0x10004189
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push str.Could_not_open_service_control_manager_on__s:__d
call fcn.10001093
add esp, 0xc
jmp 0x100042ae
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x10]
push ebx
push 3
push 0x10
push 0xf01ff
push ebx
push dword [ebp - 8]
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [ebp - 0x10], eax
cmp eax, ebx
jne 0x100041d3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push dword [ebp - 8]
push str.Could_not_create_service__s_on__s:__d
call fcn.10001093
add esp, 0x10
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x100042ae
push ebx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x100041ff
call edi
cmp eax, 0x41d
je 0x100041ff
call edi
push eax
push dword [ebp - 4]
push dword [ebp - 8]
push str.Could_not_start_service__s_on__s:__d
jmp 0x10004273
push dword [ebp - 4]
push dword [ebp - 8]
push str.Started_service__s_on__s
push esi
push dword [ebp - 0xc]
call fcn.10014523
mov eax, dword [ebp - 0xc]
add esp, 0x14
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x1000421c
sub eax, esi
push ebx
push eax
push dword [ebp - 0xc]
call section..text
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
add esp, 0xc
jmp 0x1000425c
lea eax, [ebp - 0x48]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x10004265
cmp dword [ebp - 0x44], 1
je 0x1000427b
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
call esi
cmp eax, dword [ebp - 0x18]
jb 0x1000423a
jmp 0x1000427b
call edi
push eax
push dword [ebp - 4]
push dword [ebp - 8]
push str.Could_not_query_service__s_on__s:__d
call fcn.10001093
add esp, 0x10
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x1000429e
call edi
push eax
push dword [ebp - 4]
push dword [ebp - 8]
push str.Could_not_delete_service__s_on__s:__d
call fcn.10001093
add esp, 0x10
push dword [ebp - 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x1c]
call esi
mov esi, dword [ebp - 0x14]
call fcn.100066ee
pop edi
pop esi
pop ebx
leave
ret