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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x42e7e0]
xor ecx, ecx
push ebx
push esi
mov dword [ebp - 0x30], eax
mov ebx, ecx
mov eax, dword [0x42e7dc]
push edi
mov dword [ebp - 0x2c], eax
mov edi, ecx
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], ecx
push str.D:_A__GA___SY__A__GA___BA_
push eax
mov dword [ebp - 0x14], 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.0040df15
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4054d3
lea eax, [ebp - 0x14]
push str.D:_A__GA___SY__A__GA___BA__A__0x80100000___BU_
push eax
call fcn.0040df15
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4054d3
mov eax, dword [ebp - 0x18]
and dword [ebp - 0x34], ebx
push str.GlobalOfficeSourceEngineMutex
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x3c]
push edi
push eax
mov dword [ebp - 0x3c], 0xc
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x405257
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4054d3
mov eax, dword [ebp - 0x10]
push 0x2710
push eax
call fcn.004103ae
mov esi, eax
cmp esi, 0x80070102
je 0x4054d3
test esi, esi
js 0x4054d3
mov eax, dword [ebp - 0x14]
xor esi, esi
push str.GlobalOfficeSourceEngineRunning
xor ebx, ebx
mov dword [ebp - 0x38], eax
push esi
inc ebx
mov dword [ebp - 0x3c], 0xc
push ebx
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x34], esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x4052c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4054d3
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 0x4052f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4054d3
mov eax, dword [ebp - 8]
push 0x42e880
push eax
call fcn.004024b9
mov esi, eax
test esi, esi
js 0x4054d3
push 0x4259ec
push 2
lea eax, [ebp - 0x30]
push eax
push str.HeavyH2O_SourceEngine_V1_0
call fcn.004112e3
mov esi, eax
test esi, esi
js 0x4054d3
cmp dword [ebp + 8], edi
je 0x405367
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x405367
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 0x405367
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4054bb
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.0040e9ad
mov esi, eax
test esi, esi
js 0x4054bb
xor esi, esi
mov dword [ebp - 0x1c], ebx
push esi
push esi
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, eax
mov dword [ebp - 0x20], edi
test edi, edi
jne 0x4053c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4054bb
xor esi, esi
mov eax, dword [ebp - 4]
test eax, eax
jne 0x4053ef
push esi
lea eax, [ebp - 4]
push eax
push esi
push 0x20019
push esi
push esi
push esi
push str.SOFTWAREMicrosoftOfficeDeliverySourceEngineSettings
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov eax, dword [ebp - 4]
test eax, eax
je 0x405408
push 0x42e87c
push eax
call fcn.00404ea2
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 [0x42e8a8], eax
mov esi, ebx
mov eax, dword [ebp - 8]
mov dword [ebp - 0x28], eax
mov dword [ebp + 8], esi
test edi, edi
je 0x40542b
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 0x40542b
cmp ecx, 0x102
jne 0x405473
call dword [sym.imp.KERNEL32.dll_GetTickCount]
imul ecx, dword [0x42e888], 0xea60
mov edx, eax
mov esi, dword [0x42e8a8]
sub edx, esi
cmp edx, ecx
jae 0x4054a8
mov esi, dword [ebp + 8]
jmp 0x40542b
test ecx, ecx
je 0x4054b9
cmp ecx, 0x80
je 0x4054b9
test edi, edi
je 0x40542b
lea eax, [esi - 1]
cmp eax, ecx
jne 0x40542b
push 0x42e87c
push dword [ebp - 4]
call fcn.00404ea2
push ebx
push edi
push 4
push 0
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
jmp 0x40542b
sub eax, esi
push eax
push str.Shutting_down__timed_out_after__d_ticks
push ebx
call fcn.00410f86
add esp, 0xc
xor esi, esi
push 0
push 2
lea eax, [ebp - 0x30]
push eax
call fcn.00411371
cmp dword [ebp - 0x1c], 0
je 0x4054d3
call fcn.0040e9e5
mov ecx, dword [0x42e880]
test ecx, ecx
je 0x405501
mov eax, dword [ecx]
push ecx
call dword [eax + 0x28]
mov ecx, dword [0x42e880]
mov eax, dword [ecx + 4]
add ecx, 4
mov eax, dword [eax + 4]
add eax, ecx
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
and dword [0x42e880], 0
cmp dword [ebp - 4], 0
je 0x405510
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x40551f
push dword [ebp - 0x20]
call edi
mov eax, dword [ebp - 8]
test eax, eax
je 0x405529
push eax
call edi
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x40553d
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 0x405555
test ebx, ebx
je 0x405552
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [ebp - 0x10]
push eax
call edi
cmp dword [ebp - 0x14], 0
je 0x405563
push dword [ebp - 0x14]
call fcn.0040dfcc
cmp dword [ebp - 0x18], 0
je 0x405571
push dword [ebp - 0x18]
call fcn.0040dfcc
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8