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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
push edi
mov dword [ebp - 0x24], ecx
lea eax, [ebp - 0x20]
xor ecx, ecx
mov dword [ebp - 0x34], 0x42b2e8
push str.D:_A__GA___SY__A__GA___BA_
push eax
mov edi, edx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
mov ebx, ecx
mov byte [ebp - 8], cl
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x30], 0x42bd68
mov byte [ebp - 1], cl
call fcn.0040de26
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4052d7
lea eax, [ebp - 0x1c]
push str.D:_A__GA___SY__A__GA___BA__A__0x80100000___BU_
push eax
call fcn.0040de26
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4052d7
mov eax, dword [ebp - 0x20]
and dword [ebp - 0x38], ebx
push 0x42a628
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x40]
push ebx
push eax
mov dword [ebp - 0x40], 0xc
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x405057
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4052d7
mov eax, dword [ebp - 0x18]
mov ecx, eax
call fcn.00410239
mov esi, eax
test esi, esi
js 0x4052d7
mov ecx, dword [ebp - 0x1c]
xor eax, eax
push str.GlobalOfficeSourceEngineRunning
inc eax
mov dword [ebp - 0x40], 0xc
xor esi, esi
mov dword [ebp - 8], eax
push esi
push eax
lea eax, [ebp - 0x40]
mov dword [ebp - 0x3c], ecx
push eax
mov dword [ebp - 0x38], esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x4050b6
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4052d7
xor esi, esi
push esi
push esi
push dword [ebp - 8]
push esi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x4050e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4052d7
mov eax, dword [ebp - 0x10]
mov ecx, eax
call fcn.004021a4
mov esi, eax
test esi, esi
js 0x4052d7
push ecx
push ecx
lea edx, [ebp - 0x34]
call fcn.00410e6e
mov esi, eax
test esi, esi
js 0x4052d7
mov eax, dword [ebp - 0x24]
xor esi, esi
test eax, eax
je 0x40514e
test edi, edi
je 0x40514e
push edi
push eax
mov dword [edi + 0xc], esi
mov dword [edi + 4], 4
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
test eax, eax
jne 0x40514e
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4052a4
xor esi, esi
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
cmp dword [0x42f3a0], ebx
je 0x405175
mov esi, 0x8000ffff
jmp 0x4052a4
mov al, byte [ebp - 8]
or dword [0x42f3a4], 0xf0000040
push esi
push esi
push esi
push esi
mov byte [ebp - 1], al
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov ebx, eax
test ebx, ebx
jne 0x4051b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4052a4
xor esi, esi
mov ecx, dword [ebp - 0xc]
mov edi, dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
test ecx, ecx
jne 0x4051e5
push esi
lea eax, [ebp - 0xc]
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 ecx, dword [ebp - 0xc]
test ecx, ecx
je 0x4051f6
call fcn.00405376
push dword [ebp - 8]
push ebx
push 4
push esi
push dword [ebp - 0xc]
call edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x42f30c], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 8]
mov esi, eax
test ebx, ebx
je 0x405216
push 2
mov dword [ebp - 0x28], ebx
pop esi
push eax
push 0xea60
push 0
lea eax, [ebp - 0x2c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
mov ecx, eax
mov eax, dword [ebp - 8]
cmp ecx, 0xc0
je 0x405216
cmp ecx, 0x102
jne 0x40525d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
imul ecx, dword [0x42f318], 0xea60
sub eax, dword [0x42f30c]
cmp eax, ecx
jae 0x405291
mov eax, dword [ebp - 8]
jmp 0x405216
test ecx, ecx
je 0x4052a2
cmp ecx, 0x80
je 0x4052a2
mov eax, dword [ebp - 8]
test ebx, ebx
je 0x405216
lea eax, [esi - 1]
cmp eax, ecx
mov eax, dword [ebp - 8]
jne 0x405216
mov ecx, dword [ebp - 0xc]
call fcn.00405376
push dword [ebp - 8]
push ebx
push 4
push 0
push dword [ebp - 0xc]
call edi
jmp 0x405258
push eax
push str.Shutting_down__timed_out_after__d_ticks
push dword [ebp - 8]
call fcn.00410882
add esp, 0xc
xor esi, esi
xor edi, edi
push 0
push 0
push dword [ebp + edi*4 - 0x34]
call dword [sym.imp.RPCRT4.dll_RpcServerUnregisterIf]
movzx ecx, ax
or ecx, 0x80070000
test eax, eax
cmovle ecx, eax
test ecx, ecx
js 0x4052cc
inc edi
cmp edi, 2
jl 0x4052a6
cmp byte [ebp - 1], 0
je 0x4052d7
call fcn.0040e513
mov ecx, dword [0x42f308]
test ecx, ecx
je 0x405305
mov eax, dword [ecx]
push ecx
call dword [eax + 0x28]
mov ecx, dword [0x42f308]
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 [0x42f308], 0
cmp dword [ebp - 0xc], 0
je 0x405314
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x405321
push ebx
call edi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40532b
push eax
call edi
mov ebx, dword [ebp - 0x14]
test ebx, ebx
je 0x40533c
push ebx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push ebx
call edi
mov ebx, dword [ebp - 0x18]
test ebx, ebx
je 0x405353
cmp byte [ebp - 8], 0
je 0x405350
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
call edi
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x405361
mov ecx, eax
call fcn.00411025
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40536f
mov ecx, eax
call fcn.00411025
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret