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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x18]
xor ebx, ebx
cmp dword [ebp + 0xc], 0xffffffff
push edi
mov dword [ebp - 4], ebx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], esi
je 0x4af79d
cmp dword [ebp + 0xc], ebx
je 0x4af79d
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
mov dword [ebp + 0x18], eax
xor eax, eax
cmp esi, ebx
setne al
inc eax
push ebx
mov edi, eax
lea eax, [ebp - 0x18]
push ebx
push eax
push edi
mov dword [ebp - 0xc], edi
call dword [sym.imp.KERNEL32.DLL_WaitForMultipleObjects]
mov ebx, eax
cmp ebx, edi
jb 0x4af92d
mov eax, dword [ebp + 0x10]
mov esi, dword [sym.imp.USER32.dll_PeekMessageA]
neg eax
sbb eax, eax
and eax, 8
add eax, 0x40
mov dword [ebp - 8], eax
jmp 0x4af7dc
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
push 0xa
pop ecx
mov dword [ebp + 8], edx
cmp edx, ecx
jbe 0x4af7ec
mov dword [ebp + 8], ecx
push eax
lea eax, [ebp - 0x18]
push dword [ebp + 8]
push 0
push eax
push edi
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
mov ebx, eax
cmp ebx, edi
je 0x4af81b
cmp ebx, 0x102
jne 0x4af8bc
mov eax, dword [ebp + 8]
cmp eax, dword [ebp + 0xc]
je 0x4af8bc
xor ebx, ebx
cmp dword [ebp + 0x10], ebx
je 0x4af844
mov edi, dword [ebp + 0x14]
push 1
push edi
push edi
push dword [ebp + 0x10]
lea eax, [ebp - 0x34]
push eax
call esi
test eax, eax
je 0x4af844
lea eax, [ebp - 0x34]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 1
jmp 0x4af827
push ebx
push ebx
push ebx
lea eax, [ebp - 0x34]
push ebx
push eax
call esi
cmp dword [ebp + 0xc], 0xffffffff
je 0x4af874
cmp dword [ebp + 0xc], ebx
je 0x4af874
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
mov ecx, eax
sub ecx, dword [ebp + 0x18]
cmp ecx, dword [ebp + 0xc]
jbe 0x4af86e
mov dword [ebp + 0xc], ebx
jmp 0x4af871
sub dword [ebp + 0xc], ecx
mov dword [ebp + 0x18], eax
cmp dword [ebp - 4], ebx
jne 0x4af8a2
mov edi, dword [sym.imp.KERNEL32.DLL_GetCurrentThread]
call edi
push eax
call dword [sym.imp.KERNEL32.DLL_GetThreadPriority]
cmp eax, 2
mov dword [ebp - 0x10], eax
jae 0x4af89b
push 2
call edi
push eax
call dword [sym.imp.KERNEL32.DLL_SetThreadPriority]
mov dword [ebp - 4], 1
mov edi, dword [ebp - 0xc]
push ebx
lea eax, [ebp - 0x18]
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_WaitForMultipleObjects]
mov ebx, eax
cmp ebx, edi
jae 0x4af7d9
xor edi, edi
cmp dword [ebp - 4], edi
je 0x4af92d
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.DLL_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.DLL_SetThreadPriority]
push 8
call dword [sym.imp.USER32.dll_GetQueueStatus]
shr eax, 0x10
test al, 8
je 0x4af92d
mov eax, dword [0x507be8]
cmp eax, edi
jne 0x4af8ff
push str.AMUnblock
call dword [sym.imp.USER32.dll_RegisterWindowMessageA]
cmp eax, edi
mov dword [0x507be8], eax
je 0x4af91d
push 1
push eax
push eax
lea eax, [ebp - 0x34]
push 0xffffffffffffffff
push eax
call esi
test eax, eax
je 0x4af918
mov eax, dword [0x507be8]
push 1
jmp 0x4af901
mov eax, dword [0x507be8]
push edi
push edi
push eax
call dword [sym.imp.KERNEL32.DLL_GetCurrentThreadId]
push eax
call dword [sym.imp.USER32.dll_PostThreadMessageA]
pop edi
mov eax, ebx
pop esi
pop ebx
leave
ret 0x14