Function at 0x407180
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4886e0
push eax
mov eax, dword [ebp + 8]
mov dword fs:[0], esp
sub esp, 0x144
cmp dword [eax], 0x100
push ebx
push esi
push edi
mov edi, ecx
jg 0x407682
cmp dword [ebp + 0x38], 0
je 0x4071c5
cmp byte [edi + 0x825], 1
je 0x407682
xor ebx, ebx
mov byte [ebp - 0x15], bl
cmp byte [ebp + 0x28], bl
jne 0x40723f
lea eax, [ebx + 8]
call fcn.004622b0
mov eax, dword [ebp + 0x20]
mov ebx, esp
push 0
sub esp, 8
mov dword [ebp - 0x24], ebx
mov ecx, esp
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call fcn.00408bd0
cmp eax, 0xffffffff
je 0x407227
mov ecx, dword [edi + 0x334]
imul edx, eax, 0x7f2
mov ecx, dword [edx + ecx + 0x7ee]
cmp ecx, 1
je 0x407227
cmp ecx, 2
je 0x407227
cmp ecx, 3
je 0x407227
mov dword [ebx], eax
mov ebx, 1
jmp 0x40729d
cmp dword [edi + 0x826], 0
je 0x407682
mov byte [ebp - 0x15], 1
mov ebx, 1
jmp 0x40729d
movzx esi, word [edi + 7]
lea eax, [esi*4]
call fcn.00461c50
xor ecx, ecx
mov dword [ebp - 0x24], esp
test esi, esi
je 0x407682
xor esi, esi
nop
mov edx, dword [edi + 0x334]
cmp byte [edx + esi], 0
je 0x407286
mov eax, dword [edx + esi + 1]
cmp eax, dword [ebp + 0x20]
jne 0x407280
mov ax, word [edx + esi + 5]
cmp ax, word [ebp + 0x24]
je 0x407286
mov eax, esp
mov dword [eax + ebx*4], ecx
inc ebx
movzx eax, word [edi + 7]
inc ecx
add esi, 0x7f2
cmp ecx, eax
jb 0x407260
test ebx, ebx
je 0x407682
lea eax, [ebp - 0x13b]
mov dword [ebp - 0x14c], 0
mov dword [ebp - 0x148], 0x800
mov dword [ebp - 0x144], 0
mov dword [ebp - 0x140], eax
mov byte [ebp - 0x13c], 1
mov eax, dword [ebp + 0x18]
mov dword [ebp - 4], 0
mov dword [ebp - 0x20], 0
test ebx, ebx
je 0x40751d
cmp byte [ebp + 0x2c], 0
mov esi, dword [ebp + 0x10]
mov byte [ebp - 0x14], 0x14
mov dword [ebp - 0x28], esi
je 0x407442
mov byte [ebp - 0x1c], 0x28
nop
push 1
push 8
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x14c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402210
cmp byte [0x5bc6ac], 0
jne 0x407338
push 0x5bc6b0
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov byte [0x5bc6ac], 1
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x3e8
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
call fcn.00461c80
push dword [0x5bc6b4]
push dword [0x5bc6b0]
push edx
push eax
call fcn.00485cd0
push 1
mov dword [ebp + 0x2c], eax
lea ecx, [ebp - 0x14c]
push 0x20
lea eax, [ebp + 0x2c]
push eax
call fcn.00402210
push 1
push 8
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402210
mov ecx, dword [ebp + 8]
push 1
push 8
mov al, byte [ecx]
lea ecx, [ebp - 0x14c]
mov byte [ebp + 0x2c], al
lea eax, [ebp + 0x2c]
push eax
call fcn.00402210
push ecx
push 0x20
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022b0
test esi, esi
je 0x4073d4
push 0
push esi
push dword [ebp + 0xc]
lea ecx, [ebp - 0x14c]
call fcn.00402210
jmp 0x4073ed
push ecx
push 0x20
lea eax, [ebp + 0x2c]
mov dword [ebp + 0x2c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022b0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov esi, dword [edi]
push 0
sub esp, 8
imul edx, dword [ecx + eax*4], 0x7f2
mov ecx, esp
push dword [ebp + 0x1c]
add edx, dword [edi + 0x334]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
mov eax, dword [edx + 1]
mov dword [ecx], eax
mov ax, word [edx + 5]
mov word [ecx + 4], ax
lea eax, [ebp - 0x14c]
push eax
mov ecx, edi
call dword [esi + 0x30]
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp + 0x10]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, ebx
jb 0x407300
jmp 0x40751a
mov dword [ebp - 0x20], 0
nop dword [eax]
push 1
push 8
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.00402210
mov ecx, dword [ebp + 8]
push 1
push 8
mov al, byte [ecx]
lea ecx, [ebp - 0x14c]
mov byte [ebp + 0x2c], al
lea eax, [ebp + 0x2c]
push eax
call fcn.00402210
push ecx
push 0x20
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022b0
test esi, esi
je 0x4074b1
push 0
push esi
push dword [ebp + 0xc]
lea ecx, [ebp - 0x14c]
call fcn.00402210
jmp 0x4074ca
push ecx
push 0x20
lea eax, [ebp + 0x2c]
mov dword [ebp + 0x2c], 0
push eax
lea ecx, [ebp - 0x14c]
call fcn.004022b0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov esi, dword [edi]
push 0
sub esp, 8
imul edx, dword [ecx + eax*4], 0x7f2
mov ecx, esp
push dword [ebp + 0x1c]
add edx, dword [edi + 0x334]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
mov eax, dword [edx + 1]
mov dword [ecx], eax
mov ax, word [edx + 5]
mov word [ecx + 4], ax
lea eax, [ebp - 0x14c]
push eax
mov ecx, edi
call dword [esi + 0x30]
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp + 0x10]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, ebx
jb 0x407450
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x38]
test ecx, ecx
je 0x407659
mov dx, word [ebp + 0x24]
mov ebx, dword [ebp + 0x28]
mov byte [edi + 0x825], 1
mov dword [edi + 0x81a], ecx
mov ecx, dword [ebp + 0x20]
mov dword [edi + 0x81e], ecx
mov word [edi + 0x822], dx
mov byte [edi + 0x824], bl
cmp eax, 6
jne 0x4075a0
cmp ecx, 0xffffffff
jne 0x407576
mov eax, 0xffff
cmp dx, ax
jne 0x407576
call fcn.004030f0
lea ebx, [eax + 0x5dc]
mov eax, dword [ebp + 0x18]
jmp 0x4075a3
mov eax, dword [edi]
sub esp, 8
mov ecx, esp
mov edx, dword [eax + 0x7c]
mov eax, dword [ebp + 0x20]
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call edx
lea ebx, [eax + eax*2]
call fcn.004030f0
add ebx, eax
mov eax, dword [ebp + 0x18]
jmp 0x4075a3
mov ebx, dword [ebp + 0x2c]
cmp byte [edi + 0x825], 0
je 0x407652
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 8
je 0x407613
cmp eax, 9
je 0x407613
cmp eax, 0xa
je 0x407613
cmp byte [0x5bc6ac], 0
jne 0x4075e0
push 0x5bc6b0
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov byte [0x5bc6ac], 1
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push 0
push 0x3e8
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
call fcn.00461c80
push dword [0x5bc6b4]
push dword [0x5bc6b0]
push edx
push eax
call fcn.00485cd0
cmp eax, ebx
jae 0x407652
push 0x1e
call esi
cmp byte [ebp - 0x15], 0
jne 0x40763d
push dword [ebp + 0x28]
mov eax, dword [ebp + 0x20]
sub esp, 8
mov ecx, esp
mov dword [ecx], eax
mov ax, word [ebp + 0x24]
mov word [ecx + 4], ax
mov ecx, edi
call fcn.0040a3d0
test al, al
je 0x40764e
cmp byte [edi + 0x825], 0
je 0x407652
mov eax, dword [ebp + 0x18]
jmp 0x4075b6
xor bl, bl
jmp 0x40765b
mov byte [edi + 0x825], 0
mov bl, 1
cmp byte [ebp - 0x13c], 0
je 0x40767e
cmp dword [ebp - 0x148], 0x800
jle 0x40767e
push dword [ebp - 0x140]
call fcn.004684df
add esp, 4
mov al, bl
jmp 0x407684
xor al, al
lea esp, [ebp - 0x15c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x34