Function at 0x405076
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], 0x42c2c0
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], 0x42cd40
mov byte [ebp - 1], cl
call fcn.0040e3a4
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4053c8
lea eax, [ebp - 0x1c]
push str.D:_A__GA___SY__A__GA___BA__A__0x80100000___BU_
push eax
call fcn.0040e3a4
mov esi, eax
pop ecx
pop ecx
test esi, esi
js 0x4053c8
mov eax, dword [ebp - 0x20]
and dword [ebp - 0x38], ebx
push 0x42b628
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 0x40512e
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4053c8
mov eax, dword [ebp - 0x18]
mov ecx, eax
call fcn.0041083d
mov esi, eax
cmp esi, 0x80070102
je 0x4053c8
test esi, esi
js 0x4053c8
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 0x405199
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4053c8
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 0x4051cb
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4053c8
mov eax, dword [ebp - 0x10]
mov ecx, eax
call fcn.004021e8
mov esi, eax
test esi, esi
js 0x4053c8
push ecx
push ecx
lea edx, [ebp - 0x34]
call fcn.0041149e
mov esi, eax
test esi, esi
js 0x4053c8
mov eax, dword [ebp - 0x24]
xor esi, esi
test eax, eax
je 0x405231
test edi, edi
je 0x405231
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 0x405231
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405395
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 [0x4302b0], ebx
je 0x405258
mov esi, 0x8000ffff
jmp 0x405395
mov al, byte [ebp - 8]
or dword [0x4302b4], 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 0x405296
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x405395
xor esi, esi
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jne 0x4052c2
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 0x4052d7
call fcn.00405477
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 [0x43021c], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 8]
mov edi, eax
test ebx, ebx
je 0x4052f7
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 0x4052f7
cmp ecx, 0x102
jne 0x405343
call dword [sym.imp.KERNEL32.dll_GetTickCount]
imul ecx, dword [0x430228], 0xea60
mov edx, eax
mov esi, dword [0x43021c]
sub edx, esi
cmp edx, ecx
jae 0x405380
mov eax, dword [ebp - 8]
xor esi, esi
jmp 0x4052f7
test ecx, ecx
je 0x405395
cmp ecx, 0x80
je 0x405395
mov eax, dword [ebp - 8]
test ebx, ebx
je 0x4052f7
lea eax, [edi - 1]
cmp eax, ecx
mov eax, dword [ebp - 8]
jne 0x4052f7
mov ecx, dword [ebp - 0xc]
call fcn.00405477
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 0x4052f7
sub eax, esi
push eax
push str.Shutting_down__timed_out_after__d_ticks
push dword [ebp - 8]
call fcn.00410e8c
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 0x4053bd
inc edi
cmp edi, 2
jl 0x405397
cmp byte [ebp - 1], 0
je 0x4053c8
call fcn.0040ead5
mov ecx, dword [0x430218]
test ecx, ecx
je 0x4053f6
mov eax, dword [ecx]
push ecx
call dword [eax + 0x28]
mov ecx, dword [0x430218]
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 [0x430218], 0
cmp dword [ebp - 0xc], 0
je 0x405405
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x405412
push ebx
call edi
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40541c
push eax
call edi
mov ebx, dword [ebp - 0x14]
test ebx, ebx
je 0x40542d
push ebx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push ebx
call edi
mov ebx, dword [ebp - 0x18]
test ebx, ebx
je 0x405444
cmp byte [ebp - 8], 0
je 0x405441
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 0x40545f
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40546e
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