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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff94
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x64], ecx
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x60], ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], edx
mov ebx, eax
xor eax, eax
push ebp
push 0x51d61d
push dword fs:[eax]
mov dword fs:[eax], esp
xor edx, edx
mov eax, dword [ebp - 0xc]
call fcn.004d605c
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x51cc66
mov edx, dword [ebp - 0xc]
mov si, 0xfff6
call fcn.004045d4
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [ebx + 4]
cmp eax, 0x3e8
jbe 0x51cc88
call sub.kernel32.dll_GetTickCount_1
mov dword [ebx + 4], eax
mov eax, dword [ebx + 8]
mov dword [ebx + 0xc], eax
xor eax, eax
mov dword [ebx + 8], eax
inc dword [ebx + 8]
mov eax, dword [0x55359c]
cmp dword [eax], 0
je 0x51d5f5
mov eax, dword [ebx + 0x14]
mov edx, dword [0x5530d0]
cmp eax, dword [edx]
jne 0x51d5f5
mov eax, dword [0x5530d0]
mov eax, dword [eax]
mov eax, dword [eax + 0x5a864]
mov eax, dword [eax + 8]
dec eax
test eax, eax
jl 0x51d310
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x14], 0
mov eax, dword [0x5530d0]
mov eax, dword [eax]
mov eax, dword [eax + 0x5a864]
mov edx, dword [ebp - 0x14]
call fcn.0041b4d4
mov ebx, eax
xor eax, eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebx + 0x1e8]
mov eax, dword [eax + 8]
cmp eax, dword [ebp - 0x20]
jle 0x51cdd4
mov edx, dword [ebp - 0x20]
mov eax, dword [ebx + 0x1e8]
call fcn.0041b4d4
mov esi, eax
cmp byte [esi + 0x21], 0
je 0x51ccea
movzx eax, byte [esi + 0x1c]
test eax, eax
jl 0x51cd8b
inc eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x10], 0
lea eax, [ebp - 0x1c]
push eax
lea ecx, [ebp - 0x18]
mov eax, dword [ebp - 0x10]
mov edx, dword [esi + eax*4]
mov eax, dword [0x553964]
mov eax, dword [eax]
call fcn.004dbacc
mov edi, eax
test edi, edi
je 0x51cd83
lea edx, [ebp - 0x4c]
mov eax, edi
call fcn.004d6110
lea eax, [ebp - 0x4c]
push eax
push edi
push 1
mov edx, dword [ebp - 0x18]
add edx, dword [ebx + 0xb0]
add edx, dword [esi + 0x1d]
mov eax, dword [ebp - 0x10]
add eax, eax
add eax, eax
add eax, eax
add edx, eax
mov ecx, dword [ebp - 0x1c]
add ecx, dword [ebx + 0xb4]
sub ecx, dword [esi + 0x1d]
sub ecx, 0x1e
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
inc dword [ebp - 0x10]
dec dword [ebp - 0x2c]
jne 0x51cd25
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [esi + 0x22]
cmp eax, 0x1e
jbe 0x51cda3
call sub.kernel32.dll_GetTickCount_1
mov dword [esi + 0x22], eax
inc dword [esi + 0x1d]
cmp dword [esi + 0x1d], 0x14
jle 0x51cdcc
mov byte [esi + 0x21], 0
mov edx, dword [ebp - 0x20]
mov eax, dword [ebx + 0x1e8]
call fcn.0041b3c8
mov edx, 0x26
mov eax, esi
call fcn.00402f34
jmp 0x51ccea
inc dword [ebp - 0x20]
jmp 0x51ccea
cmp byte [ebx + 0x16], 0
jne 0x51cde6
mov dword [ebx + 0x80], 6
jmp 0x51cdf0
mov dword [ebx + 0x80], 0x1a
mov eax, dword [0x553804]
cmp byte [eax + 1], 0
je 0x51ceec
cmp byte [ebx + 0x2c], 0
jne 0x51ceec
cmp word [ebx + 0x58], 0
jbe 0x51ceec
add dword [ebx + 0x80], 2
mov eax, dword [0x553230]
mov eax, dword [eax]
xor edx, edx
call fcn.004db7c4
mov edi, eax
test edi, edi
je 0x51ceec
lea edx, [ebp - 0x4c]
mov eax, edi
call fcn.004d6110
lea eax, [ebp - 0x4c]
push eax
push edi
push 1
mov eax, edi
call fcn.004d6304
sar eax, 1
jns 0x51ce52
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov ecx, dword [ebx + 0xb4]
sub ecx, dword [ebx + 0x80]
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
mov eax, dword [0x553964]
mov eax, dword [eax]
mov edx, 2
call fcn.004db7c4
mov edi, eax
test edi, edi
je 0x51ceec
lea edx, [ebp - 0x3c]
mov eax, edi
call fcn.004d6110
mov eax, dword [ebp - 0x34]
sub eax, dword [ebp - 0x3c]
mov dword [ebp - 0x50], eax
fild dword [ebp - 0x50]
movzx eax, word [ebx + 0x58]
mov dword [ebp - 0x54], eax
fild dword [ebp - 0x54]
fdivp st(1)
movzx eax, word [ebx + 0x54]
mov dword [ebp - 0x58], eax
fild dword [ebp - 0x58]
fmulp st(1)
call fcn.004035cc
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x3c]
push eax
push edi
push 1
mov eax, edi
call fcn.004d6304
sar eax, 1
jns 0x51ced0
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov ecx, dword [ebx + 0xb4]
sub ecx, dword [ebx + 0x80]
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
mov eax, dword [0x553804]
cmp byte [eax], 0
je 0x51d0aa
cmp byte [ebx + 0x2c], 0
jne 0x51d0aa
cmp word [ebx + 0x1a], 0x47
jne 0x51cf18
cmp dword [ebx + 0x17c], 0xb
je 0x51d0aa
mov dword [ebp - 0x24], 1
movzx eax, byte [ebx + 0x12]
sub al, 1
jb 0x51cf72
sub al, 0xb
je 0x51cf61
sub al, 0x26
jne 0x51cf83
movzx eax, word [ebx + 0x1a]
add eax, 0xffffffdf
sub ax, 0x12
jb 0x51cf5d
dec eax
sub ax, 0x12
jb 0x51cf5d
add eax, 0xfffffffe
sub ax, 4
jb 0x51cf5d
mov dword [ebp - 0x24], 3
mov esi, dword [0x553964]
mov esi, dword [esi]
jmp 0x51cf92
xor esi, esi
jmp 0x51cf92
mov dword [ebp - 0x24], 4
mov esi, dword [0x553964]
mov esi, dword [esi]
jmp 0x51cf92
mov dword [ebp - 0x24], 1
mov esi, dword [0x553230]
mov esi, dword [esi]
jmp 0x51cf92
mov dword [ebp - 0x24], 1
mov esi, dword [0x553230]
mov esi, dword [esi]
test esi, esi
je 0x51d0aa
add dword [ebx + 0x80], 6
cmp byte [ebx + 0x169], 0
je 0x51cfc4
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [ebx + 0x16c]
cmp eax, dword [ebx + 0x170]
jbe 0x51cfc4
mov byte [ebx + 0x169], 0
mov eax, dword [0x553230]
mov eax, dword [eax]
xor edx, edx
call fcn.004db7c4
mov edi, eax
test edi, edi
je 0x51d013
lea edx, [ebp - 0x4c]
mov eax, edi
call fcn.004d6110
lea eax, [ebp - 0x4c]
push eax
push edi
push 1
mov eax, edi
call fcn.004d6304
sar eax, 1
jns 0x51cff7
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov ecx, dword [ebx + 0xb4]
sub ecx, dword [ebx + 0x80]
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
mov edx, dword [ebp - 0x24]
mov eax, esi
call fcn.004db7c4
mov edi, eax
test edi, edi
jne 0x51d036
mov eax, dword [0x553230]
mov eax, dword [eax]
mov edx, 1
call fcn.004db7c4
mov edi, eax
test edi, edi
je 0x51d0aa
lea edx, [ebp - 0x3c]
mov eax, edi
call fcn.004d6110
movzx esi, word [ebx + 0x56]
cmp si, 2
jbe 0x51d079
mov eax, dword [ebp - 0x34]
sub eax, dword [ebp - 0x3c]
mov dword [ebp - 0x50], eax
fild dword [ebp - 0x50]
movzx eax, si
mov dword [ebp - 0x54], eax
fild dword [ebp - 0x54]
fdivp st(1)
movzx eax, word [ebx + 0x52]
mov dword [ebp - 0x58], eax
fild dword [ebp - 0x58]
fmulp st(1)
call fcn.004035cc
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x3c]
push eax
push edi
push 1
mov eax, edi
call fcn.004d6304
sar eax, 1
jns 0x51d08e
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov ecx, dword [ebx + 0xb4]
sub ecx, dword [ebx + 0x80]
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
push 1
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004813a8
push eax
call sub.gdi32.dll_SetBkMode
mov eax, dword [0x553804]
cmp byte [eax + 2], 0
je 0x51d1da
cmp word [ebx + 0x56], 1
jbe 0x51d1da
cmp byte [ebx + 0x2c], 0
jne 0x51d1da
cmp byte [ebx + 0x12], 0x32
je 0x51d1da
push 1
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004813a8
push eax
call sub.gdi32.dll_SetBkMode
add dword [ebx + 0x80], 0xc
lea edx, [ebp - 0x5c]
movzx eax, word [ebx + 0x52]
call fcn.00409cc4
push dword [ebp - 0x5c]
push 0x51d634
lea edx, [ebp - 0x60]
movzx eax, word [ebx + 0x56]
call fcn.00409cc4
push dword [ebp - 0x60]
lea eax, [ebp - 8]
mov edx, 3
call fcn.0040578c
cmp byte [ebx + 0x12], 0
jne 0x51d184
mov eax, dword [0x553804]
cmp byte [eax + 0x15], 0
je 0x51d184
cmp dword [ebp - 8], 0
je 0x51d15b
lea eax, [ebp - 8]
mov edx, dword [ebp - 8]
call fcn.00405474
push 0x51d640
lea edx, [ebp - 0x64]
movzx eax, word [ebx + 0x3c]
call fcn.00409cc4
push dword [ebp - 0x64]
push 0x51d650
push dword [ebp - 8]
lea eax, [ebp - 8]
mov edx, 4
call fcn.0040578c
push 0xffffff
push 0
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004813a8
lea ecx, [ebp - 0x6c]
mov edx, dword [ebp - 8]
call fcn.00534fc8
mov eax, dword [ebp - 0x6c]
sar eax, 1
jns 0x51d1b1
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov ecx, dword [ebx + 0xb4]
sub ecx, dword [ebx + 0x80]
mov eax, dword [ebp - 0xc]
call fcn.0052cd28
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004d54a8
mov eax, dword [0x553804]
cmp byte [eax + 0xc], 0
je 0x51d2f7
movzx eax, byte [ebx + 0x12]
test al, al
je 0x51d1f9
sub al, 0x32
jne 0x51d2f7
mov eax, dword [0x553654]
cmp ebx, dword [eax]
je 0x51d2f7
cmp word [ebx + 0x1a], 0x47
jne 0x51d21a
cmp dword [ebx + 0x17c], 0xb
je 0x51d2f7
push 1
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004813a8
push eax
call sub.gdi32.dll_SetBkMode
mov eax, dword [0x55359c]
cmp ebx, dword [eax]
jne 0x51d299
mov eax, dword [0x553600]
cmp byte [eax], 0
jne 0x51d2ea
mov eax, dword [0x553804]
cmp byte [eax + 0xd], 0
je 0x51d26b
push dword [ebx + 0x30]
push 0x51d65c
push dword [ebx + 0x34]
lea eax, [ebp - 4]
mov edx, 3
call fcn.0040578c
jmp 0x51d276
lea eax, [ebp - 4]
mov edx, dword [ebx + 0x34]
call fcn.00405474
mov eax, dword [ebx + 0x38]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebx + 0xb4]
add ecx, 0x1e
mov edx, dword [ebx + 0xb0]
mov eax, dword [ebp - 0xc]
call fcn.0051cb40
jmp 0x51d2ea
mov eax, dword [0x553804]
cmp byte [eax + 0xd], 0
je 0x51d2be
push dword [ebx + 0x30]
push 0x51d65c
push dword [ebx + 0x34]
lea eax, [ebp - 4]
mov edx, 3
call fcn.0040578c
jmp 0x51d2c9
lea eax, [ebp - 4]
mov edx, dword [ebx + 0x34]
call fcn.00405474
mov eax, dword [ebx + 0x38]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebx + 0xb4]
add ecx, 0x1e
mov edx, dword [ebx + 0xb0]
mov eax, dword [ebp - 0xc]
call fcn.0051cb40
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004d54a8
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004d54a8
inc dword [ebp - 0x14]
dec dword [ebp - 0x28]
jne 0x51ccce
push 1
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004813a8
push eax
call sub.gdi32.dll_SetBkMode
mov eax, dword [0x553654]
cmp dword [eax], 0
je 0x51d3a3
mov edx, dword [0x553654]
mov edx, dword [edx]
mov eax, dword [0x5530d0]
mov eax, dword [eax]
call fcn.005256b8
test al, al
je 0x51d3a3
mov eax, dword [0x553654]
mov eax, dword [eax]
push dword [eax + 0x30]
push 0x51d65c
mov eax, dword [0x553654]
mov eax, dword [eax]
push dword [eax + 0x34]
lea eax, [ebp - 4]
mov edx, 3
call fcn.0040578c
mov eax, dword [0x553654]
mov eax, dword [eax]
mov eax, dword [eax + 0x38]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
mov eax, dword [0x553654]
mov eax, dword [eax]
mov ecx, dword [eax + 0xb4]
add ecx, 0x1e
mov eax, dword [0x553654]
mov eax, dword [eax]
mov edx, dword [eax + 0xb0]
mov eax, dword [ebp - 0xc]
call fcn.0051cb40
mov eax, dword [0x553600]
cmp byte [eax], 0
je 0x51d409
mov eax, dword [0x55359c]
mov eax, dword [eax]
push dword [eax + 0x30]
push 0x51d65c
mov eax, dword [0x55359c]
mov eax, dword [eax]
push dword [eax + 0x34]
lea eax, [ebp - 4]
mov edx, 3
call fcn.0040578c
mov eax, dword [0x55359c]
mov eax, dword [eax]
mov eax, dword [eax + 0x38]
push eax
push 0
mov eax, dword [ebp - 4]
push eax
mov eax, dword [0x55359c]
mov eax, dword [eax]
mov ecx, dword [eax + 0xb4]
add ecx, 0x1e
mov eax, dword [0x55359c]
mov eax, dword [eax]
mov edx, dword [eax + 0xb0]
mov eax, dword [ebp - 0xc]
call fcn.0051cb40
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
mov eax, dword [eax + 0xc]
mov edx, 0xffffff
call fcn.00480260
mov eax, dword [0x5530d0]
mov eax, dword [eax]
mov eax, dword [eax + 0x5a864]
mov eax, dword [eax + 8]
dec eax
test eax, eax
jl 0x51d557
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x14], 0
mov eax, dword [0x5530d0]
mov eax, dword [eax]
mov eax, dword [eax + 0x5a864]
mov edx, dword [ebp - 0x14]
call fcn.0041b4d4
mov ebx, eax
cmp dword [ebx + 0x84], 0
je 0x51d54b
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [ebx + 0xac]
cmp eax, 0xfa0
jae 0x51d540
mov eax, dword [ebx + 0xb8]
dec eax
test eax, eax
jl 0x51d54b
inc eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x10], 0
cmp byte [ebx + 0x2c], 0
je 0x51d4e8
push 0x808080
push 0
mov eax, dword [ebp - 0x10]
mov eax, dword [ebx + eax*4 + 0x84]
push eax
mov eax, dword [ebx + 0xb8]
shl eax, 4
mov ecx, dword [ebx + 0xb4]
sub ecx, eax
imul eax, dword [ebp - 0x10], 0xe
add ecx, eax
mov eax, dword [ebp - 0x10]
mov eax, dword [ebx + eax*4 + 0x98]
sar eax, 1
jns 0x51d4d6
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov eax, dword [ebp - 0xc]
call fcn.0052cd28
jmp 0x51d532
push 0xffffff
push 0
mov eax, dword [ebp - 0x10]
mov eax, dword [ebx + eax*4 + 0x84]
push eax
mov eax, dword [ebx + 0xb8]
shl eax, 4
mov ecx, dword [ebx + 0xb4]
sub ecx, eax
imul eax, dword [ebp - 0x10], 0xe
add ecx, eax
mov eax, dword [ebp - 0x10]
mov eax, dword [ebx + eax*4 + 0x98]
sar eax, 1
jns 0x51d522
adc eax, 0
mov edx, dword [ebx + 0xb0]
sub edx, eax
mov eax, dword [ebp - 0xc]
call fcn.0052cd28
inc dword [ebp - 0x10]
dec dword [ebp - 0x2c]
jne 0x51d496
jmp 0x51d54b
lea eax, [ebx + 0x84]
call fcn.004053dc
inc dword [ebp - 0x14]
dec dword [ebp - 0x28]
jne 0x51d442
mov eax, dword [0x553324]
test byte [eax], 4
je 0x51d579
push 0xffffff
push 0
push 0x51d668
xor ecx, ecx
xor edx, edx
mov eax, dword [ebp - 0xc]
call fcn.0052cd28
mov eax, dword [ebp - 0xc]
call fcn.004d60f0
call fcn.004d54a8
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov eax, 1
shr eax, cl
mov edx, dword [0x553324]
and eax, dword [edx]
je 0x51d5ec
mov edx, dword [ebp - 0x10]
add edx, 0x96
mov eax, dword [0x553778]
mov eax, dword [eax]
call fcn.004db7c4
mov edi, eax
test edi, edi
je 0x51d5ec
mov eax, edi
call fcn.004d6304
add dword [ebp - 0x14], eax
lea edx, [ebp - 0x4c]
mov eax, edi
call fcn.004d6110
lea eax, [ebp - 0x4c]
push eax
push edi
push 1
mov edx, 0x320
sub edx, dword [ebp - 0x14]
xor ecx, ecx
mov eax, dword [ebp - 0xc]
call fcn.004d5d54
inc dword [ebp - 0x10]
cmp dword [ebp - 0x10], 0x10
jne 0x51d590
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51d624
lea eax, [ebp - 0x64]
mov edx, 3
call fcn.00405400
lea eax, [ebp - 8]
mov edx, 2
call fcn.00405400
ret