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

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0xd
push 0
push 0
dec ecx
jne 0x512b90
push ebx
push esi
push edi
mov dword [ebp - 0x14], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x513008
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 0x316]
sub al, 2
jae 0x512bd9
lea edx, [ebp - 0x40]
mov eax, dword [ebp - 4]
call fcn.004f0364
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 4]
add eax, 0x310
call fcn.00408aec
jmp 0x512c0d
call sub.kernel32.dll_GetTickCount
mov edx, dword [ebp - 4]
sub eax, dword [edx + 0x30c]
mov edx, dword [ebp - 4]
cmp eax, dword [edx + 0x334]
jb 0x512bff
mov eax, dword [ebp - 4]
add eax, 0x310
call fcn.0040870c
call sub.kernel32.dll_GetTickCount
mov edx, dword [ebp - 4]
mov dword [edx + 0x30c], eax
mov eax, dword [ebp - 0x14]
movzx eax, word [eax]
sub ax, 8
je 0x512c5c
dec ax
je 0x512c2d
sub ax, 0x12
jne 0x512e00
jmp 0x512fbe
mov eax, dword [ebp - 4]
cmp byte [eax + 0x309], 0
je 0x512fbe
mov eax, dword [ebp - 4]
call fcn.005110c4
test al, al
je 0x512fbe
xor edx, edx
mov eax, dword [ebp - 4]
call fcn.005110e8
jmp 0x512fbe
push ebp
lea edx, [ebp - 0x1c]
lea eax, [ebp - 0x18]
call fcn.00512aa0
pop ecx
test al, al
je 0x512c7f
push ebp
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
call fcn.00512ae4
pop ecx
jmp 0x512de7
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 0x316]
sub al, 2
jae 0x512cab
lea edx, [ebp - 0x44]
mov eax, dword [ebp - 4]
call fcn.004f0364
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x512ca4
sub eax, 4
mov eax, dword [eax]
test eax, eax
setg al
jmp 0x512cad
xor eax, eax
test al, al
je 0x512d99
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.004f0364
mov ebx, dword [ebp - 0x18]
jmp 0x512cc6
dec ebx
mov edx, ebx
mov eax, dword [ebp - 0xc]
call fcn.00427588
cmp al, 2
je 0x512cc5
lea eax, [ebp - 8]
push eax
mov ecx, ebx
dec ecx
mov edx, 1
mov eax, dword [ebp - 0xc]
call fcn.00409be4
push 0
push 0xffffffffffffffff
push 0x14e
mov eax, dword [ebp - 4]
call fcn.004f93b0
push eax
call sub.user32.dll_SendMessageW
lea eax, [ebp - 0x4c]
push eax
mov edx, dword [ebp - 0x1c]
inc edx
mov ecx, 0x7fffffff
mov eax, dword [ebp - 0xc]
call fcn.00409be4
mov ecx, dword [ebp - 0x4c]
lea eax, [ebp - 0x48]
mov edx, dword [ebp - 8]
call fcn.00409a14
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 4]
call fcn.004f03b8
mov esi, ebx
dec esi
movzx esi, si
mov eax, esi
shl esi, 0x10
or eax, esi
push eax
push 0
push 0x142
mov eax, dword [ebp - 4]
call fcn.004f93b0
push eax
call sub.user32.dll_SendMessageW
lea edx, [ebp - 0x50]
mov eax, dword [ebp - 4]
call fcn.004f0364
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 4]
add eax, 0x310
call fcn.00408aec
jmp 0x512de7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
mov dword [ebp - 0x20], eax
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x512d85
sub esi, 4
mov esi, dword [esi]
mov eax, dword [ebp - 4]
add eax, 0x310
mov ecx, 1
mov edx, esi
call fcn.00409c2c
mov eax, dword [ebp - 4]
mov edi, dword [eax + 0x310]
mov ebx, edi
test ebx, ebx
je 0x512dad
sub ebx, 4
mov ebx, dword [ebx]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
mov edx, ebx
call fcn.00427588
cmp al, 2
je 0x512d6d
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
test eax, eax
je 0x512dd3
sub eax, 4
mov eax, dword [eax]
mov edx, dword [ebp - 4]
add edx, 0x310
mov ecx, 1
xchg edx, eax
call fcn.00409c2c
mov eax, dword [ebp - 0x14]
mov word [eax], 0
mov eax, dword [ebp - 4]
mov si, 0xffac
call fcn.00406ce8
jmp 0x512fbe
push ebp
lea edx, [ebp - 0x1c]
lea eax, [ebp - 0x18]
call fcn.00512aa0
pop ecx
mov eax, dword [ebp - 4]
cmp byte [eax + 0x316], 2
jae 0x512e33
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
test eax, eax
je 0x512e2b
sub eax, 4
mov eax, dword [eax]
cmp eax, dword [ebp - 0x18]
setg al
jmp 0x512e35
xor eax, eax
test al, al
je 0x512edf
xor edx, edx
push ebp
push 0x512ed8
push dword fs:[edx]
mov dword fs:[edx], esp
xor eax, eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x54]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
mov ecx, dword [ebp - 0x18]
mov edx, 1
call fcn.00409be4
mov eax, dword [ebp - 0x54]
push eax
lea eax, [ebp - 0x58]
mov edx, dword [ebp - 0x14]
movzx edx, word [edx]
call fcn.004097e8
mov ecx, dword [ebp - 0x58]
lea eax, [ebp - 0x10]
pop edx
call fcn.00409a14
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
mov ebx, eax
test ebx, ebx
je 0x512e9c
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 0x5c]
push eax
mov edx, dword [ebp - 0x1c]
inc edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x310]
mov ecx, ebx
call fcn.00409be4
mov ecx, dword [ebp - 0x5c]
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x10]
call fcn.00409a14
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x512f01
lea eax, [ebp - 0x10]
call fcn.0040870c
ret
lea eax, [ebp - 0x60]
mov edx, dword [ebp - 0x14]
movzx edx, word [edx]
call fcn.004097e8
mov ecx, dword [ebp - 0x60]
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x310]
lea eax, [ebp - 0xc]
call fcn.00409a14
mov eax, dword [ebp - 4]
cmp byte [eax + 0x309], 0
je 0x512f23
mov eax, dword [ebp - 4]
call fcn.005110c4
test al, al
jne 0x512f23
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.005110e8
mov eax, dword [ebp - 0x14]
cmp word [eax], 0xd800
jb 0x512fa7
mov eax, dword [ebp - 0x14]
cmp word [eax], 0xdfff
ja 0x512fa7
push 0
push 0
push 0
mov eax, dword [ebp - 4]
call fcn.004f93b0
push eax
lea eax, [ebp - 0x3c]
push eax
call sub.user32.dll_PeekMessageW
test eax, eax
je 0x512fbe
cmp dword [ebp - 0x38], 0x102
jne 0x512fbe
lea eax, [ebp - 0x68]
movzx edx, word [ebp - 0x34]
call fcn.004097e8
mov ecx, dword [ebp - 0x68]
lea eax, [ebp - 0x64]
mov edx, dword [ebp - 0xc]
call fcn.00409a14
mov edx, dword [ebp - 0x64]
mov eax, dword [ebp - 4]
call fcn.00513018
test al, al
je 0x512fbe
push 1
push 0
push 0
mov eax, dword [ebp - 4]
call fcn.004f93b0
push eax
lea eax, [ebp - 0x3c]
push eax
call sub.user32.dll_PeekMessageW
mov eax, dword [ebp - 0x14]
mov word [eax], 0
jmp 0x512fbe
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.00513018
test al, al
je 0x512fbe
mov eax, dword [ebp - 0x14]
mov word [eax], 0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51300f
lea eax, [ebp - 0x68]
mov edx, 6
call fcn.0040876c
lea eax, [ebp - 0x50]
call fcn.0040870c
lea eax, [ebp - 0x4c]
mov edx, 2
call fcn.0040876c
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.0040876c
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.0040876c
ret