Function at 0x403c84
Capabilities:
Check for time delay via gettickcount
Query service configuration
Query service status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x90
push edi
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x20], 0
mov al, byte [0x40992c]
mov byte [ebp - 0x6c], al
mov ecx, 7
xor eax, eax
lea edi, [ebp - 0x6b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov cl, byte [0x409930]
mov byte [ebp - 0x4c], cl
mov ecx, 7
xor eax, eax
lea edi, [ebp - 0x4b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dword [ebp - 0x70], 0x270f
cmp dword [ebp + 0xc], 0
je 0x403ce9
mov edx, dword [ebp + 0xc]
movsx eax, byte [edx]
test eax, eax
jne 0x403cf0
xor eax, eax
jmp 0x404133
push 5
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x4040dc
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x7c], 0
lea eax, [ebp - 0x74]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
cmp dword [ebp - 0x74], 0
je 0x403d51
mov edx, dword [ebp - 0x74]
mov dword [ebp - 0x78], edx
mov eax, dword [ebp - 0x78]
shl eax, 1
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x7c], 0
je 0x403e69
lea ecx, [ebp - 0x74]
push ecx
mov edx, dword [ebp - 0x78]
push edx
mov eax, dword [ebp - 0x7c]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
je 0x403e69
mov edx, dword [ebp - 0x7c]
mov eax, dword [edx + 4]
mov dword [ebp - 0x84], eax
cmp dword [ebp - 0x84], 4
ja case.default.0x403d94
mov ecx, dword [ebp - 0x84]
jmp dword [ecx*4 + 0x404138]
push str.BOOT
lea edx, [ebp - 0x4c]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e13
push str.SYSTEM
lea eax, [ebp - 0x4c]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e13
push str.AUTO
lea ecx, [ebp - 0x4c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e13
push str.DEMAND
lea edx, [ebp - 0x4c]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e13
push str.DISABLED
lea eax, [ebp - 0x4c]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403e13
mov ecx, dword [ebp - 0x7c]
mov edx, dword [ecx + 4]
push edx
push 0x408fd4
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
push 0x1c
push 0
lea ecx, [ebp - 0x1c]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
mov ecx, dword [ebp - 0x7c]
cmp dword [ecx + 4], 4
jne 0x403e41
mov dword [ebp - 0x2c], 1
mov edx, dword [ebp - 0x7c]
cmp dword [edx + 4], 3
jne 0x403e5d
cmp dword [ebp - 0x18], 1
je 0x403e56
cmp dword [ebp - 0x18], 3
jne 0x403e5d
mov dword [ebp - 0x2c], 1
mov eax, dword [ebp - 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x403e70
mov dword [ebp - 0x2c], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x24], eax
jmp 0x403e86
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x1c
push 0
lea ecx, [ebp - 0x1c]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x4040bb
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x88], ecx
mov edx, dword [ebp - 0x88]
sub edx, 1
mov dword [ebp - 0x88], edx
cmp dword [ebp - 0x88], 6
ja case.default.0x403ed7
mov eax, dword [ebp - 0x88]
jmp dword [eax*4 + 0x40414c]
push str.STOPPED
lea ecx, [ebp - 0x6c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.START_PENDING
lea edx, [ebp - 0x6c]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.STOP_PENDING
lea eax, [ebp - 0x6c]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.RUNNING
lea ecx, [ebp - 0x6c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.CONTINUE_PENDING
lea edx, [ebp - 0x6c]
push edx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.PAUSE_PENDING
lea eax, [ebp - 0x6c]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
push str.PAUSED
lea ecx, [ebp - 0x6c]
push ecx
call sub.MSVCRT.dll_strcpy
add esp, 8
jmp 0x403f7c
mov edx, dword [ebp - 0x18]
push edx
push str.OTHER__d
lea eax, [ebp - 0x6c]
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x70]
je 0x404044
cmp dword [ebp - 0x18], 4
jne 0x403fac
lea edx, [ebp - 0x6c]
push edx
lea eax, [ebp - 0x4c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push str.__20.20s__service_is__s__s__OK_
call fcn.004027ab
add esp, 0x10
jmp 0x40403e
cmp dword [ebp - 0x2c], 0
je 0x403fcd
lea edx, [ebp - 0x6c]
push edx
lea eax, [ebp - 0x4c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push str.__20.20s__service_is__s__s__ignore_
call fcn.004027ab
add esp, 0x10
jmp 0x40403e
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, dword [ebp - 0x24]
jb 0x403fe9
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x24]
mov dword [ebp - 0x8c], eax
jmp 0x403fff
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [ebp - 0x24]
sub edx, eax
or eax, 0xffffffff
sub eax, edx
mov dword [ebp - 0x8c], eax
mov ecx, dword [ebp - 0x8c]
cmp ecx, dword [ebp + 0x10]
jb 0x404025
lea edx, [ebp - 0x6c]
push edx
lea eax, [ebp - 0x4c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push str.__20.20s__service_is__s__s__timeout_
call fcn.004027ab
add esp, 0x10
jmp 0x40403e
lea edx, [ebp - 0x6c]
push edx
lea eax, [ebp - 0x4c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push str.__20.20s__service_is__s__s__waiting_
call fcn.004027ab
add esp, 0x10
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x70], edx
cmp dword [ebp - 0x18], 1
je 0x404062
cmp dword [ebp - 0x18], 3
je 0x404062
cmp dword [ebp - 0x18], 7
je 0x404062
cmp dword [ebp - 0x18], 6
je 0x404062
cmp dword [ebp - 0x18], 4
jne 0x40406b
mov dword [ebp - 0x28], 1
jmp 0x4040da
cmp dword [ebp - 0x2c], 0
je 0x40407a
mov dword [ebp - 0x28], 1
jmp 0x4040da
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp eax, dword [ebp - 0x24]
jb 0x404096
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x24]
mov dword [ebp - 0x90], eax
jmp 0x4040ac
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x24]
sub ecx, eax
or edx, 0xffffffff
sub edx, ecx
mov dword [ebp - 0x90], edx
mov eax, dword [ebp - 0x90]
cmp eax, dword [ebp + 0x10]
jb 0x4040b9
jmp 0x4040da
jmp 0x4040d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
push str.__20.20s__service_is_unknown__gla_d
call fcn.004027ab
add esp, 0xc
jmp 0x4040da
jmp 0x403e7b
jmp 0x404120
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x80], eax
cmp dword [ebp - 0x80], 0x424
jne 0x404108
mov edx, dword [ebp + 0xc]
push edx
push str.__20.20s__service_is_not_installed__ignore_
call fcn.004027ab
add esp, 8
mov dword [ebp - 0x28], 1
jmp 0x404120
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp + 0xc]
push eax
push str.__20.20s__services_could_not_be_opened__gla_d
call fcn.004027ab
add esp, 0xc
cmp dword [ebp - 0x20], 0
je 0x404130
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x28]
pop edi
mov esp, ebp
pop ebp
ret