Function at 0x408518
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x421ba0]
xor ecx, ecx
push ebx
push esi
mov dword [ebp - 0x30], eax
mov eax, dword [0x421b9c]
push edi
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x18]
mov edi, ecx
push 0x401900
push eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], ecx
mov ebx, ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 0x20], edi
mov dword [ebp - 4], ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x1c], ecx
call fcn.00416c9e
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x408861
lea eax, [ebp - 0x14]
push 0x401938
push eax
call fcn.00416c9e
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x408861
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x34], ebx
push 0x4017f8
mov dword [ebp - 0x38], eax
push edi
lea eax, [ebp - 0x3c]
push eax
mov dword [ebp - 0x3c], 0xc
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x4085d3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4085ca
and esi, 0xffff
or esi, 0x80070000
test esi, esi
js 0x408861
mov eax, dword [ebp - 0x10]
push 0x2710
push eax
call fcn.00419c20
mov esi, eax
cmp esi, 0x80070102
je 0x408861
test esi, esi
js 0x408861
mov eax, dword [ebp - 0x14]
push 0x401998
xor esi, esi
xor ebx, ebx
push esi
inc ebx
mov dword [ebp - 0x38], eax
push ebx
lea eax, [ebp - 0x3c]
push eax
mov dword [ebp - 0x3c], 0xc
mov dword [ebp - 0x34], esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x408643
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40863b
and esi, 0xffff
or esi, 0x80070000
test esi, esi
js 0x408861
xor esi, esi
push esi
push esi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 8], eax
test eax, eax
jne 0x408677
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40866e
and esi, 0xffff
or esi, 0x80070000
test esi, esi
js 0x408861
mov eax, dword [ebp - 8]
push 0x421e3c
push eax
call fcn.0040480f
mov esi, eax
test esi, esi
js 0x408861
push 0x4019dc
push 2
lea eax, [ebp - 0x30]
push eax
push 0x4018c8
call fcn.004178fc
mov esi, eax
test esi, esi
js 0x408861
cmp dword [ebp + 8], edi
je 0x4086ef
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4086ef
and dword [eax + 0xc], edi
push eax
push dword [ebp + 8]
mov dword [eax + 4], 4
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
test eax, eax
jne 0x4086ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4086e9
and esi, 0xffff
or esi, 0x80070000
test esi, esi
js 0x408849
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
push ebx
call fcn.00419c6b
mov esi, eax
test esi, esi
js 0x408849
xor esi, esi
push esi
push esi
push esi
push esi
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
jne 0x40874f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x408747
and esi, 0xffff
or esi, 0x80070000
test esi, esi
js 0x408849
xor esi, esi
mov eax, dword [ebp - 4]
test eax, eax
jne 0x40877b
push esi
lea eax, [ebp - 4]
push eax
push esi
push 0x20019
push esi
push esi
push esi
push 0x401a08
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov eax, dword [ebp - 4]
test eax, eax
je 0x408794
push 0x421e38
push eax
call fcn.004089fb
push ebx
push edi
push 4
push esi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x421e34], eax
mov eax, dword [ebp - 8]
mov esi, ebx
mov dword [ebp - 0x28], eax
mov dword [ebp + 8], esi
test edi, edi
je 0x4087b7
push 2
pop esi
mov dword [ebp - 0x24], edi
mov dword [ebp + 8], esi
push ebx
push 0xea60
push 0
lea eax, [ebp - 0x28]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
mov ecx, eax
cmp ecx, 0xc0
je 0x4087b7
cmp ecx, 0x102
jne 0x408801
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [0x421e44]
mov esi, dword [0x421e34]
imul ecx, ecx, 0xea60
mov edx, eax
sub edx, esi
cmp edx, ecx
jae 0x408836
mov esi, dword [ebp + 8]
jmp 0x4087b7
test ecx, ecx
je 0x408847
cmp ecx, 0x80
je 0x408847
test edi, edi
je 0x4087b7
lea eax, [esi - 1]
cmp eax, ecx
jne 0x4087b7
push 0x421e38
push dword [ebp - 4]
call fcn.004089fb
push ebx
push edi
push 4
push 0
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
jmp 0x4087b7
sub eax, esi
push eax
push 0x401a7c
push ebx
call fcn.004196b7
add esp, 0xc
xor esi, esi
push 0
push 2
lea eax, [ebp - 0x30]
push eax
call fcn.00417987
cmp dword [ebp - 0x1c], 0
je 0x408861
call fcn.00419ca3
mov ecx, dword [0x421e3c]
test ecx, ecx
je 0x40888f
mov eax, dword [ecx]
push ecx
call dword [eax + 0x28]
mov ecx, dword [0x421e3c]
mov eax, dword [ecx + 4]
mov eax, dword [eax + 4]
add ecx, 4
add eax, ecx
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
and dword [0x421e3c], 0
cmp dword [ebp - 4], 0
je 0x40889e
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x4088ad
push dword [ebp - 0x20]
call edi
mov eax, dword [ebp - 8]
test eax, eax
je 0x4088b7
push eax
call edi
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x4088cb
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0xc]
push eax
call edi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4088e3
test ebx, ebx
je 0x4088e0
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x10]
push eax
call edi
cmp dword [ebp - 0x14], 0
je 0x4088f1
push dword [ebp - 0x14]
call fcn.00416d57
cmp dword [ebp - 0x18], 0
je 0x4088ff
push dword [ebp - 0x18]
call fcn.00416d57
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 8