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

Disassembly:
sub esp, 0x2c
mov eax, dword [esp + 0x30]
push ebx
mov ebx, dword [esp + 0x38]
cmp ebx, 0xffffffff
push esi
mov esi, dword [esp + 0x48]
mov dword [esp + 8], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], esi
je 0x5316c4
test ebx, ebx
je 0x5316c4
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x38], eax
xor ecx, ecx
test esi, esi
setne cl
push 0
push 0
lea edx, [esp + 0x18]
push edx
inc ecx
mov esi, ecx
push esi
mov dword [esp + 0x1c], esi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, esi
jb 0x531890
mov ecx, dword [esp + 0x40]
xor eax, eax
test ecx, ecx
setne al
push ebp
mov ebp, dword [esp + 0x48]
push edi
lea eax, [eax*8 + 0x40]
mov dword [esp + 0x50], eax
jmp 0x531710
mov ebx, dword [esp + 0x44]
lea esp, [esp]
cmp ebx, 0xa
jbe 0x53171a
mov ebx, 0xa
mov ecx, dword [esp + 0x50]
push ecx
push ebx
push 0
lea edx, [esp + 0x24]
push edx
push esi
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
mov edi, eax
cmp edi, esi
je 0x53174e
cmp edi, 0x102
jne 0x53181a
mov esi, dword [esp + 0x44]
cmp ebx, esi
je 0x53181a
jmp 0x531752
mov esi, dword [esp + 0x44]
mov ebx, dword [esp + 0x48]
test ebx, ebx
mov edi, dword [sym.imp.USER32.dll_PeekMessageA]
je 0x53178b
push 1
push ebp
push ebp
push ebx
lea eax, [esp + 0x30]
push eax
call edi
test eax, eax
je 0x53178b
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 1
push ebp
push ebp
push ebx
lea edx, [esp + 0x30]
push edx
call edi
test eax, eax
jne 0x531770
push 0
push 0
push 0
push 0
lea eax, [esp + 0x30]
push eax
call edi
cmp esi, 0xffffffff
je 0x5317c9
test esi, esi
je 0x5317c9
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [esp + 0x40]
mov ecx, eax
sub ecx, edi
cmp ecx, esi
jbe 0x5317bf
mov dword [esp + 0x44], 0
jmp 0x5317c5
sub esi, ecx
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x5317fc
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
cmp eax, 2
mov dword [esp + 0x4c], eax
jae 0x5317f4
push 2
call edi
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov dword [esp + 0x10], 1
mov esi, dword [esp + 0x14]
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov edi, eax
cmp edi, esi
jae 0x531708
mov eax, dword [esp + 0x10]
test eax, eax
je 0x53188c
mov edx, dword [esp + 0x4c]
push edx
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 0x53188c
mov eax, dword [0x5fe208]
test eax, eax
jne 0x531860
push str.AMUnblock
call dword [sym.imp.USER32.dll_RegisterWindowMessageA]
test eax, eax
mov dword [0x5fe208], eax
je 0x53187a
push 1
push eax
push eax
push 0xffffffffffffffff
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
mov eax, dword [0x5fe208]
jne 0x531860
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.USER32.dll_PostThreadMessageA]
mov eax, edi
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x2c
ret 0x14