Function at 0x405031
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], 0x42c2c8
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], 0x42cd48
mov byte [ebp - 1], cl
call fcn.0040dfc6
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x405383
lea eax, [ebp - 0x1c]
push str.D:_A__GA___SY__A__GA___BA__A__0x80100000___BU_
push eax
call fcn.0040dfc6
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x405383
mov eax, dword [ebp - 0x20]
and dword [ebp - 0x38], ebx
push 0x42b608
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 0x4050e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405383
mov eax, dword [ebp - 0x18]
mov ecx, eax
call fcn.00410496
mov esi, eax
cmp esi, 0x80070102
je 0x405383
test esi, esi
js 0x405383
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 0x405154
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405383
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 0x405186
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405383
mov eax, dword [ebp - 0x10]
mov ecx, eax
call fcn.004021ce
mov esi, eax
test esi, esi
js 0x405383
push ecx
push ecx
lea edx, [ebp - 0x34]
call fcn.0041110b
mov esi, eax
test esi, esi
js 0x405383
mov eax, dword [ebp - 0x24]
xor esi, esi
test eax, eax
je 0x4051ec
test edi, edi
je 0x4051ec
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 0x4051ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405350
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 [0x430280], ebx
je 0x405213
mov esi, 0x8000ffff
jmp 0x405350
mov al, byte [ebp - 8]
or dword [0x430284], 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 0x405251
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405350
xor esi, esi
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jne 0x40527d
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 0x405292
call fcn.00405432
push dword [ebp - 8]
push ebx
push 4
push esi
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x4301ec], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 8]
mov edi, eax
test ebx, ebx
je 0x4052b2
push 2
mov dword [ebp - 0x28], ebx
pop edi
push eax
push 0xea60
push esi
lea eax, [ebp - 0x2c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjectsEx]
mov ecx, eax
mov eax, dword [ebp - 8]
cmp ecx, 0xc0
je 0x4052b2
cmp ecx, 0x102
jne 0x4052fe
call dword [sym.imp.KERNEL32.dll_GetTickCount]
imul ecx, dword [0x4301f8], 0xea60
mov edx, eax
mov esi, dword [0x4301ec]
sub edx, esi
cmp edx, ecx
jae 0x40533b
mov eax, dword [ebp - 8]
xor esi, esi
jmp 0x4052b2
test ecx, ecx
je 0x405350
cmp ecx, 0x80
je 0x405350
mov eax, dword [ebp - 8]
test ebx, ebx
je 0x4052b2
lea eax, [edi - 1]
cmp eax, ecx
mov eax, dword [ebp - 8]
jne 0x4052b2
mov ecx, dword [ebp - 0xc]
call fcn.00405432
push dword [ebp - 8]
push ebx
push 4
push esi
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegNotifyChangeKeyValue]
mov eax, dword [ebp - 8]
jmp 0x4052b2
sub eax, esi
push eax
push str.Shutting_down__timed_out_after__d_ticks
push dword [ebp - 8]
call fcn.00410af9
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 0x405378
inc edi
cmp edi, 2
jl 0x405352
cmp byte [ebp - 1], 0
je 0x405383
call fcn.0040e6f7
mov ecx, dword [0x4301e8]
test ecx, ecx
je 0x4053b1
mov eax, dword [ecx]
push ecx
call dword [eax + 0x28]
mov ecx, dword [0x4301e8]
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 [0x4301e8], 0
cmp dword [ebp - 0xc], 0
je 0x4053c0
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x4053cd
push ebx
call edi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4053d7
push eax
call edi
mov ebx, dword [ebp - 0x14]
test ebx, ebx
je 0x4053e8
push ebx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push ebx
call edi
mov ebx, dword [ebp - 0x18]
test ebx, ebx
je 0x4053ff
cmp byte [ebp - 8], 0
je 0x4053fc
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
call edi
mov eax, dword [ebp - 0x1c]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x40541a
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x405429
push eax
push 0
call ebx
push eax
call edi
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret