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

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 4], edx
mov edi, dword [ebp + 8]
xor ebx, ebx
test esi, esi
je 0x51dab7
cmp byte [esi + 0x2b6], 0x32
jb 0x51dab7
cmp byte [esi + 0x2b6], 0
je 0x51daa7
mov eax, 4
sub eax, edi
call fcn.004034e0
test eax, eax
jne 0x51daa7
xor eax, eax
mov dword [esi + 0x410], eax
mov eax, dword [esi + 0x304]
cmp eax, dword [ebp - 4]
jne 0x51d804
lea eax, [edi + edi*4]
add eax, 0xa
imul edx, eax, 0x3e8
mov eax, esi
call fcn.006a9624
mov bl, 1
jmp 0x51dab7
mov eax, 2
call fcn.004034e0
test eax, eax
jne 0x51da90
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x34]
add eax, 2
cmp eax, dword [esi + 0x34]
jb 0x51daa3
mov eax, 3
call fcn.004034e0
test eax, eax
jne 0x51da6f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x34]
add eax, 0x14
lea edx, [edi + edi*4]
add eax, edx
call fcn.004034e0
cdq
push edx
push eax
mov eax, dword [0x7070f8]
mov eax, dword [eax + 0x64a4]
add eax, dword [esi + 0x34]
xor edx, edx
cmp edx, dword [esp + 4]
jne 0x51d873
cmp eax, dword [esp]
pop edx
pop eax
jae 0x51da40
jmp 0x51d87b
pop edx
pop eax
jge 0x51da40
cmp byte [esi + 0x2f0], 0
jne 0x51da1f
mov eax, dword [0x7070f8]
mov eax, dword [eax + 0x64a0]
cmp eax, dword [esi + 0x34]
jbe 0x51da1f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x318]
mov eax, dword [eax + 8]
mov edx, dword [0x7070f8]
cmp eax, dword [edx + 0x6550]
jge 0x51da1f
mov eax, dword [0x7070f8]
push dword [eax + 0x654c]
mov eax, dword [esi + 0x174]
pop edx
mov ecx, edx
xor edx, edx
div ecx
mov ebx, eax
cmp ebx, 2
jg 0x51d8e0
mov ebx, 2
jmp 0x51d8e2
add ebx, ebx
mov eax, dword [esi + 0x304]
cmp eax, dword [ebp - 4]
je 0x51da00
mov eax, ebx
call fcn.004034e0
test eax, eax
jne 0x51da00
mov eax, esi
call fcn.006a96b4
cmp dword [esi + 0x304], 0
je 0x51d925
mov ecx, 0xa
mov eax, dword [esi + 0x16c]
xor edx, edx
div ecx
mov dword [esi + 0x16c], eax
mov eax, dword [ebp - 4]
mov dword [esi + 0x304], eax
mov byte [esi + 0xd45], 0
push 0
push 0x3e8
push 0
push 0x3c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x34]
add eax, eax
call fcn.004034e0
cdq
push edx
push eax
mov eax, edi
add eax, eax
add eax, eax
lea eax, [eax + eax*4]
xor edx, edx
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
add eax, 0x14
adc edx, 0
call fcn.004067ec
call fcn.004067ec
mov ebx, eax
call sub.kernel32.dll_GetTickCount_1
add ebx, eax
mov dword [esi + 0x308], ebx
mov eax, edi
mov byte [esi + 0x315], al
cmp dword [esi + 0x30c], 0
jne 0x51d9a0
call sub.kernel32.dll_GetTickCount_1
mov dword [esi + 0x30c], eax
mov eax, esi
call fcn.006a965c
imul edx, edi, 0xc8
mov eax, 0x5dc
sub eax, edx
cmp eax, dword [esi + 0xcc8]
jae 0x51d9c2
mov dword [esi + 0xcc8], eax
mov eax, 0x7d0
sub eax, edx
cmp eax, dword [esi + 0xce0]
jae 0x51d9e4
imul eax, edi, 0xc8
mov edx, 0x7d0
sub edx, eax
mov dword [esi + 0xce0], edx
mov eax, esi
mov edx, dword [eax]
call dword [edx + 0x2c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x318]
mov edx, esi
call fcn.004208c0
jmp 0x51daa3
mov eax, 0xe
call fcn.004034e0
test eax, eax
jne 0x51daa3
xor eax, eax
mov dword [esi + 0x16c], eax
jmp 0x51daa3
cmp byte [esi + 0x2f0], 1
jne 0x51daa3
mov eax, 0x14
call fcn.004034e0
test eax, eax
jne 0x51daa3
xor eax, eax
mov dword [esi + 0x16c], eax
jmp 0x51daa3
cmp byte [esi + 0x2f0], 1
je 0x51daa3
mov eax, 0x14
call fcn.004034e0
test eax, eax
jne 0x51daa3
mov eax, 0x14
call fcn.004034e0
mov edx, eax
add edx, 0xa
mov eax, esi
call fcn.006a9678
jmp 0x51daa3
cmp byte [esi + 0x2f0], 1
je 0x51daa3
mov eax, 0x14
call fcn.004034e0
mov edx, eax
add edx, 0xa
mov eax, esi
call fcn.006a9678
jmp 0x51daa3
lea eax, [edi + edi*4]
add eax, 0xa
imul edx, eax, 0x3e8
mov eax, esi
call fcn.006a9624
mov bl, 1
jmp 0x51dab7
mov eax, 2
call fcn.004034e0
test eax, eax
jne 0x51dab7
mov bl, 1
mov eax, ebx
pop edi
pop esi
pop ebx
pop ecx
pop ebp
ret 0xc