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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x30
mov eax, dword [0x808040]
xor eax, ebp
mov dword [esp + 0x28], eax
mov eax, dword [0x80f374]
mov ecx, dword [0x80d580]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x54b681
movzx ebx, byte [ebp + 8]
mov edi, dword [0x80f370]
push edi
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x54b6cc
movzx esi, bl
dec esi
or esi, 1
add esi, dword [0x80f324]
mov dword [0x80f324], esi
mov ebx, 1
test byte [0x80f320], 1
je 0x54b677
test esi, esi
cmove ebx, esi
mov eax, dword [0x80f328]
cmp ebx, eax
je 0x54b5ab
test eax, eax
je 0x54b563
mov dword [esp + 0x10], edi
mov ecx, dword [0x80a57c]
cmp ecx, 0x54bb10
mov dword [esp + 0x14], ebx
je 0x54b5c7
call dword [0x8010bc]
lea edi, [esp + 0x20]
push edi
call ecx
add esp, 4
mov eax, dword [edi]
mov edx, dword [edi + 4]
sub eax, dword [0x80f378]
sbb edx, dword [0x80f37c]
seto bl
mov ecx, edx
sar ecx, 0x1f
test bl, bl
cmovne eax, ecx
add ecx, 0x80000000
test bl, bl
cmove ecx, edx
mov edx, eax
add edx, 1
mov edi, ecx
adc edi, 0x80000000
cmp edx, 2
sbb edi, 0
mov edx, dword [0x80f334]
mov edi, dword [0x80f330]
jb 0x54b6d8
add edi, eax
adc edx, ecx
seto bl
mov eax, edx
sar eax, 0x1f
lea ecx, [eax - 0x80000000]
test bl, bl
cmove eax, edi
test bl, bl
cmove ecx, edx
mov dword [0x80f330], eax
mov dword [0x80f334], ecx
push dword [0x80f328]
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
mov dword [0x80f328], ebx
test esi, esi
je 0x54b5ab
mov ecx, dword [0x80a57c]
cmp ecx, 0x54bb10
je 0x54b620
call dword [0x8010bc]
lea esi, [esp + 0x20]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov edx, dword [esi + 4]
mov dword [0x80f378], eax
mov dword [0x80f37c], edx
push dword [0x80f328]
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [esp + 0x28]
xor ecx, ebp
call fcn.005c6b46
mov al, 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
xor eax, eax
lea edi, [esp + 0x20]
mov dword [edi + 4], eax
mov dword [edi], eax
push edi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [edi]
mov edi, dword [edi + 4]
cmp eax, 0x7bd05af7
mov ecx, edi
sbb ecx, 0x863
jge 0x54b7aa
mov ecx, 0xf4240
mul ecx
imul ecx, edi, 0xf4240
add ecx, edx
push dword [0x80f38c]
push dword [0x80f388]
push ecx
push eax
call fcn.005f2060
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
jmp 0x54b4df
mov ebx, edi
xor eax, eax
lea esi, [esp + 0x20]
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [esi]
mov esi, dword [esi + 4]
cmp edi, 0x7bd05af7
mov eax, esi
sbb eax, 0x863
jge 0x54b71b
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x80f38c]
push dword [0x80f388]
push ecx
push eax
call fcn.005f2060
mov edi, ebx
jmp 0x54b594
mov ebx, 8
jmp 0x54b496
push 0x80f374
call fcn.005c580d
add esp, 4
cmp dword [0x80f374], 0xffffffff
jne 0x54b458
push 4
call fcn.005c5789
add esp, 4
mov esi, eax
mov dword [eax], 0
mov ecx, eax
call fcn.0054c5d0
mov dword [0x80f370], esi
push 0x80f374
call fcn.005c5887
add esp, 4
jmp 0x54b458
mov ecx, edi
call fcn.0054c5e0
jmp 0x54b471
mov dword [esp + 4], edi
xor ebx, ebx
inc ebx
add dword [esp + 4], ebx
mov ebx, edx
adc ebx, 0x80000000
mov dword [esp], ebx
mov dword [esp + 8], 0
xor ebx, ebx
inc ebx
cmp ebx, dword [esp + 4]
mov ebx, dword [esp + 8]
sbb ebx, dword [esp]
setb bl
xor edi, eax
xor edx, ecx
or edx, edi
sete dl
or dl, bl
jne 0x54b544
int3
mov eax, dword [0x80f388]
mov dword [esp + 0x10], eax
mov ecx, dword [0x80f38c]
mov dword [esp + 0x14], ecx
push ecx
push eax
push esi
push edi
call fcn.005f2060
mov dword [esp + 4], eax
mov dword [esp + 0xc], edx
mul dword [esp + 0x10]
mov dword [esp + 8], eax
mov ecx, dword [esp + 4]
imul ecx, dword [esp + 0x14]
add edx, ecx
mov eax, dword [esp + 0xc]
imul ecx, eax, 0xf4240
mov dword [esp], ecx
imul eax, dword [esp + 0x10]
add eax, edx
sub edi, dword [esp + 8]
sbb esi, eax
mov ecx, 0xf4240
mov eax, dword [esp + 4]
mul ecx
mov dword [esp + 4], eax
add edx, dword [esp]
mov dword [esp], edx
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 0x14]
push dword [esp + 0x14]
push edx
push eax
call fcn.005f2060
add eax, dword [esp + 4]
adc edx, dword [esp]
mov edi, ebx
jmp 0x54b594
mov ecx, dword [0x80f388]
mov dword [esp + 4], ecx
mov edx, dword [0x80f38c]
mov dword [esp + 8], edx
push edx
push ecx
push edi
push eax
mov dword [esp + 0x1c], eax
call fcn.005f2060
mov dword [esp], eax
mov ecx, edx
mov eax, dword [esp]
mul dword [esp + 4]
mov dword [esp + 0x18], eax
mov eax, edi
mov edi, dword [esp]
imul edi, dword [esp + 8]
add edx, edi
imul edi, ecx, 0xf4240
mov dword [esp + 0x1c], edi
imul ecx, dword [esp + 4]
add ecx, edx
mov edi, dword [esp + 0xc]
sub edi, dword [esp + 0x18]
sbb eax, ecx
mov ecx, eax
mov edx, 0xf4240
mov eax, dword [esp]
mul edx
mov dword [esp], eax
add edx, dword [esp + 0x1c]
mov dword [esp + 0xc], edx
mov eax, edi
mov edx, 0xf4240
mul edx
imul ecx, ecx, 0xf4240
add edx, ecx
push dword [esp + 8]
push dword [esp + 8]
push edx
push eax
call fcn.005f2060
add eax, dword [esp]
adc edx, dword [esp + 0xc]
jmp 0x54b613