Function at 0x1005b7f2
Capabilities:
Check for time delay via gettickcount
Check for time delay via queryperformancecounter

Disassembly:
sub esp, 0x268
cmp dword [esp + 0x26c], 0
jne 0x1005be5a
call fcn.10059ea3
test al, al
jne 0x1005be5a
push ebx
mov ebx, dword [esp + 0x278]
push ebp
push esi
push edi
mov edi, dword [ebx]
mov dword [esp + 0x28], edi
call fcn.10059edb
mov ecx, dword [ebx + 4]
mov ebp, dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov byte [esp + 0x13], al
xor eax, eax
inc eax
cmp ecx, dword [0x100d2cf8]
jne 0x1005b89b
cmp byte [0x100d2da8], 0
je 0x1005b879
lea ecx, [esp + 0x2f]
call fcn.10057552
mov esi, eax
mov ecx, esi
call fcn.100543bd
call ebp
xor ecx, ecx
cmp dword [0x100d2fd8], ecx
push eax
setne cl
push ecx
push esi
push 4
call fcn.100546cc
xor eax, eax
add esp, 0x10
inc eax
mov ecx, eax
mov edx, 0x100d2fe4
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x1005b88f
call fcn.1005a22b
push dword [0x100d300c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [ebx + 4]
cmp eax, 0x100
je 0x1005bbd3
cmp eax, 0x101
je 0x1005bbd3
cmp eax, 0x201
je 0x1005b905
cmp eax, 0x203
je 0x1005b905
cmp eax, 0x20b
je 0x1005b905
cmp eax, 0x20d
je 0x1005b905
cmp eax, 0x202
je 0x1005b905
cmp eax, 0xa1
je 0x1005b905
cmp eax, 0xa2
je 0x1005b905
cmp eax, 0xa3
je 0x1005b905
cmp eax, 0x20a
je 0x1005b905
cmp eax, 0x200
je 0x1005b905
cmp eax, 0xa0
jne 0x1005be2b
lea ecx, [esp + 0x18]
call fcn.10035ef3
push 0x53a
lea ecx, [esp + 0x1c]
call fcn.100364ff
call ebp
push eax
lea ecx, [esp + 0x1c]
call fcn.100364f3
cmp dword [0x100cca7c], 0
mov esi, 0x100cca6c
je 0x1005b94b
push 0x100baf2c
mov ecx, esi
call fcn.100031fd
mov byte [esp + 0x14], 1
test al, al
je 0x1005b950
mov byte [esp + 0x14], 0
cmp byte [esp + 0x13], 0
je 0x1005b969
push edi
push dword [esp + 0x18]
lea eax, [esp + 0x20]
push eax
call fcn.1005a719
add esp, 0xc
cmp byte [esp + 0x14], 0
je 0x1005b988
cmp dword [0x100cca80], 0x10
lea ecx, [esp + 0x18]
cmovae esi, dword [0x100cca6c]
push esi
call fcn.100363e7
push 6
xor eax, eax
lea edi, [esp + 0x34]
pop ecx
rep stosd dword es:[edi], eax
mov eax, dword [ebx + 4]
mov esi, 0x201
mov ebp, 0x3e8
sub eax, esi
je 0x1005b9bf
dec eax
sub eax, 1
je 0x1005b9bf
sub eax, 8
je 0x1005b9b5
dec eax
sub eax, 1
jne 0x1005ba19
mov dword [esp + 0x34], 0x2001
jmp 0x1005b9e3
cmp dword [0x100d2fec], 0
je 0x1005b9db
cmp dword [ebx + 4], esi
jne 0x1005b9db
call fcn.10049c98
test al, al
jne 0x1005b9db
call fcn.1004720d
mov dword [esp + 0x34], 0x2000
mov dword [esp + 0x30], 0x405
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0
mov dword [esp + 0x3c], eax
lea ecx, [esp + 0x1c]
push 0x18
lea eax, [esp + 0x38]
push eax
call fcn.1003640d
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
mov ecx, dword [ebx + 4]
mov eax, 0x200
cmp ecx, eax
ja 0x1005bb43
je 0x1005bb37
mov eax, ecx
sub eax, 0xa0
je 0x1005bb37
sub eax, 1
je 0x1005ba4f
sub eax, 1
je 0x1005ba4f
sub eax, 1
jne 0x1005be22
mov eax, dword [ebx + 0xc]
xorps xmm0, xmm0
and dword [esp + 0x44], 0
mov dword [esp + 0x38], eax
lea eax, [esp + 0x40]
push eax
movlpd qword [esp + 0x40], xmm0
mov dword [esp + 0x34], 0x424
mov dword [esp + 0x38], ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x18
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x24]
call fcn.1003640d
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
cmp dword [ebx + 4], 0xa1
je 0x1005baad
cmp dword [ebx + 4], esi
jne 0x1005bb20
push dword [esp + 0x28]
call fcn.1004a65e
mov edi, 0x104
lea eax, [esp + 0x6c]
push edi
push 0
push eax
call fcn.1007f880
add esp, 0x10
mov dword [esp + 0x60], 0x421
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [esp + 0x64], eax
lea eax, [esp + 0x68]
push edi
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x54a
lea ecx, [esp + 0x1c]
call fcn.100364ff
push 0
push 0x10c
lea eax, [esp + 0x68]
push eax
lea ecx, [esp + 0x24]
call fcn.1003640d
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
call fcn.100398dc
test eax, eax
je 0x1005be22
call fcn.10039955
jmp 0x1005be22
push ebx
call fcn.1004a67d
pop ecx
jmp 0x1005be22
mov eax, ecx
sub eax, esi
je 0x1005ba4f
sub eax, 1
je 0x1005ba4f
sub eax, 1
je 0x1005ba4f
sub eax, 7
jne 0x1005be22
push dword [esp + 0x28]
call fcn.1004a719
mov edi, 0x104
lea eax, [esp + 0x178]
push edi
push 0
push eax
call fcn.1007f880
add esp, 0x10
mov dword [esp + 0x16c], 0x425
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [esp + 0x170], eax
lea eax, [esp + 0x174]
push edi
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x54a
lea ecx, [esp + 0x1c]
call fcn.100364ff
push 0
push 0x10c
lea eax, [esp + 0x174]
jmp 0x1005be06
lea ecx, [esp + 0x18]
call fcn.10035ef3
call fcn.10050730
push 0x53a
lea ecx, [esp + 0x1c]
mov edi, eax
call fcn.100364ff
call ebp
push eax
lea ecx, [esp + 0x1c]
call fcn.100364f3
cmp dword [0x100cca7c], 0
mov esi, 0x100cca6c
je 0x1005bc20
push 0x100baf2c
mov ecx, esi
call fcn.100031fd
mov byte [esp + 0x14], 1
test al, al
je 0x1005bc25
mov byte [esp + 0x14], 0
cmp byte [esp + 0x13], 0
je 0x1005bc41
push dword [esp + 0x28]
lea eax, [esp + 0x1c]
push dword [esp + 0x18]
push eax
call fcn.1005a719
add esp, 0xc
cmp byte [esp + 0x14], 0
je 0x1005bc62
cmp dword [0x100cca80], 0x10
lea ecx, [esp + 0x18]
mov eax, esi
cmovae eax, dword [0x100cca6c]
push eax
call fcn.100363e7
mov ecx, edi
call fcn.1005072c
mov ebp, 0x3e8
test al, al
je 0x1005bce5
cmp dword [ebx + 0xc], 0
jl 0x1005bce5
mov eax, dword [ebx + 8]
cmp eax, 8
je 0x1005bc8f
cmp eax, 0xd
je 0x1005bc8f
cmp eax, 0x20
je 0x1005bc8f
cmp eax, 0x74
jne 0x1005bce5
and dword [esp + 0x5c], 0
xorps xmm0, xmm0
movlpd qword [esp + 0x54], xmm0
mov dword [esp + 0x48], 0x405
mov dword [esp + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0
mov dword [esp + 0x54], eax
lea ecx, [esp + 0x1c]
push 0x18
lea eax, [esp + 0x50]
push eax
call fcn.1003640d
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
call fcn.100398dc
test eax, eax
je 0x1005bce5
call fcn.10039955
mov ecx, dword [ebx + 0xc]
test ecx, ecx
js 0x1005bdd2
call fcn.1004a641
lea ecx, [esp + 0x30]
call fcn.10035ef3
mov edi, 0x104
lea eax, [esp + 0x68]
push edi
push 0
push eax
call fcn.1007f880
add esp, 0xc
mov dword [esp + 0x60], 0x420
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [esp + 0x64], eax
lea eax, [esp + 0x68]
push edi
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x54a
lea ecx, [esp + 0x34]
call fcn.100364ff
push 0
push 0x10c
lea eax, [esp + 0x68]
push eax
lea ecx, [esp + 0x3c]
call fcn.1003640d
cmp dword [0x100cca7c], 0
je 0x1005bd74
push 0x100baf2c
mov ecx, esi
call fcn.100031fd
mov byte [esp + 0x14], 1
test al, al
je 0x1005bd79
mov byte [esp + 0x14], 0
cmp byte [esp + 0x13], 0
je 0x1005bd95
push dword [esp + 0x28]
lea eax, [esp + 0x34]
push dword [esp + 0x18]
push eax
call fcn.1005a719
add esp, 0xc
cmp byte [esp + 0x14], 0
je 0x1005bdb4
cmp dword [0x100cca80], 0x10
lea ecx, [esp + 0x30]
cmovae esi, dword [0x100cca6c]
push esi
call fcn.100363e7
lea eax, [esp + 0x30]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
lea ecx, [esp + 0x30]
call fcn.10015fd0
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
xorps xmm0, xmm0
and dword [esp + 0x5c], 0
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x58]
push eax
movlpd qword [esp + 0x58], xmm0
mov dword [esp + 0x4c], 0x423
mov dword [esp + 0x54], ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x18
lea eax, [esp + 0x50]
push eax
lea ecx, [esp + 0x24]
call fcn.1003640d
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.1003b2ce
mov ecx, eax
call fcn.1005ee31
lea ecx, [esp + 0x18]
call fcn.10015fd0
xor ecx, ecx
xor eax, eax
inc ecx
mov edx, 0x100d2fe4
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x1005be42
call fcn.1005a22b
push ebx
push dword [esp + 0x284]
push 0
push 0
call dword [sym.imp.USER32.dll_CallNextHookEx]
pop edi
pop esi
pop ebp
pop ebx
jmp 0x1005be77
push dword [esp + 0x274]
push dword [esp + 0x274]
push dword [esp + 0x274]
push 0
call dword [sym.imp.USER32.dll_CallNextHookEx]
add esp, 0x268
ret 0xc