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

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xffffff14
mov dword [esp], edx
mov esi, eax
mov eax, esi
cmp dword [eax + 0x3dc], 0
jg 0x50926c
mov byte [eax + 0x3d8], 1
mov edx, dword [eax + 0x3d0]
mov ecx, dword [eax + 0x200]
cmp edx, dword [ecx + 0xc]
jl 0x508d46
mov byte [eax + 0x3d8], 0
jmp 0x50926c
mov byte [esp + 0x28], 0
xor eax, eax
mov dword [esp + 0x34], eax
call sub.kernel32.dll_GetTickCount
add eax, 0x19
mov dword [esp + 0x2c], eax
mov ebx, esi
mov eax, dword [ebx + 0x310]
mov dword [esp + 0x14], eax
cmp dword [ebx + 0x390], 0
jne 0x508da3
mov eax, ebx
call fcn.0043d4f4
test al, al
je 0x508d94
mov eax, dword [ebx + 0x1f0]
mov dword [esp + 0x30], eax
mov eax, ebx
call fcn.00436a04
mov dword [esp + 0x10], eax
jmp 0x508db7
xor eax, eax
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0x38]
mov dword [esp + 0x10], eax
jmp 0x508db7
mov eax, dword [esi + 0x390]
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0x394]
mov dword [esp + 0x10], eax
lea ecx, [esp + 0x94]
mov edx, dword [ebx + 0x3d0]
mov eax, dword [ebx + 0x200]
call fcn.00505ecc
mov eax, dword [esp + 0xa4]
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x3d0]
mov dword [esp + 0x24], eax
jmp 0x50900d
mov edx, dword [ebx + 0x3d0]
mov eax, dword [ebx + 0x200]
call fcn.00505d04
mov edi, eax
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x10], eax
cmp word [ebx + 0x2e2], 0
je 0x508ebd
call sub.kernel32.dll_GetTickCount
sub eax, dword [ebx + 0x398]
cmp eax, dword [0x5a32cc]
jle 0x508ebd
imul eax, dword [ebx + 0x3d0], 0x64
mov edx, dword [ebx + 0x200]
mov ecx, dword [edx + 0xc]
cdq
idiv ecx
mov ecx, eax
mov dword [ebx + 0x24c], ecx
cmp ecx, 0x64
jne 0x508e58
mov dword [ebx + 0x24c], 0x63
cmp byte [esp + 0x28], 0
je 0x508e7e
cmp dword [esp + 0x30], 0
je 0x508e7e
mov eax, dword [esp + 0xc]
push eax
mov eax, dword [esp + 0x34]
call fcn.0041e6a8
push eax
call sub.gdi32.dll_SelectObject
mov dword [esp + 0xc], eax
mov edx, esi
mov eax, dword [esi + 0x2e4]
call dword [esi + 0x2e0]
cmp byte [esp + 0x28], 0
je 0x508eb2
cmp dword [esp + 0x30], 0
je 0x508eb2
mov eax, dword [esp + 0xc]
push eax
mov eax, dword [esp + 0x34]
call fcn.0041e6a8
push eax
call sub.gdi32.dll_SelectObject
mov dword [esp + 0xc], eax
call sub.kernel32.dll_GetTickCount
mov dword [esi + 0x398], eax
mov ebp, esi
mov eax, dword [ebp + 0x3d0]
mov dword [esp + 0x38], eax
cmp byte [edi + 0x54], 0
jne 0x508fb9
cmp byte [edi + 0x55], 0
jne 0x508ee2
mov edx, eax
mov eax, ebp
call fcn.0050fbd0
mov eax, dword [edi + 0x40]
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 4], eax
cmp dword [esp + 0x30], 0
je 0x508f05
mov eax, dword [esp + 0x30]
call fcn.0041e6a8
mov dword [esp + 0x34], eax
jmp 0x508f0b
xor eax, eax
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x10]
push eax
push edi
mov eax, dword [ebp + 0x3d0]
push eax
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x18]
push eax
push 1
lea eax, [esp + 0x24]
push eax
mov cl, byte [esp + 0x44]
xor cl, 1
mov edx, dword [esp + 0x50]
mov eax, ebp
mov ebx, dword [eax]
call dword [ebx + 0xb8]
mov byte [esp + 0x28], 1
mov eax, dword [edi + 0x40]
sub eax, dword [esp + 0x20]
add dword [esp + 0x18], eax
inc dword [ebp + 0x3d0]
lea ecx, [esp + 0x3c]
mov eax, dword [ebp + 0x200]
mov edx, dword [esp + 0x38]
call fcn.00505ecc
mov ebx, esi
mov eax, dword [ebx + 0x214]
call fcn.00504728
cmp eax, dword [esp + 0x38]
jg 0x508fbf
mov eax, ebx
call fcn.0050f338
mov edx, dword [esp + 0x4c]
sub edx, eax
mov eax, ebx
mov ecx, dword [eax]
call dword [ecx + 0xc8]
mov ebp, eax
mov eax, ebx
call fcn.00436a48
cmp ebp, eax
jge 0x508fbf
push 0
mov eax, dword [esp + 0x50]
mov ecx, eax
add ecx, dword [esp + 0x80]
dec ecx
mov edx, eax
mov eax, ebx
call fcn.0050ff70
jmp 0x508fbf
inc dword [ebp + 0x3d0]
mov eax, dword [edi + 0x40]
add dword [esp + 0x1c], eax
mov eax, esi
mov edx, dword [eax + 0x3d0]
mov eax, dword [eax + 0x200]
cmp edx, dword [eax + 0xc]
jge 0x50902c
mov ebx, esi
mov edi, dword [ebx + 0x3d0]
cmp edi, dword [ebx + 0x3d4]
jle 0x50900d
lea ecx, [esp + 0x94]
mov edx, edi
mov eax, dword [ebx + 0x200]
call fcn.00505ecc
cmp byte [esp + 0xe8], 0
jne 0x50900d
inc dword [ebx + 0x3d4]
mov ebx, esi
mov eax, dword [ebx + 0x3d0]
cmp eax, dword [ebx + 0x3d4]
jg 0x50902c
call sub.kernel32.dll_GetTickCount
cmp eax, dword [esp + 0x2c]
jl 0x508def
cmp byte [esp + 0x28], 0
je 0x5091c3
cmp dword [esp + 0x34], 0
je 0x509053
mov eax, dword [esp + 0xc]
push eax
mov eax, dword [esp + 0x38]
push eax
call sub.gdi32.dll_SelectObject
push eax
call sub.gdi32.dll_DeleteObject
mov eax, dword [esi + 0x30c]
mov ebx, dword [eax + 8]
dec ebx
test ebx, ebx
jl 0x5090a1
inc ebx
mov dword [esp + 0x10], 0
mov eax, dword [esi + 0x30c]
mov edx, dword [esp + 0x10]
call fcn.004133c4
cmp dword [eax + 0x18], 0
je 0x50909a
mov edx, dword [eax + 0x1c]
cmp edx, dword [esp + 0x24]
jl 0x50909a
mov edx, dword [eax + 0x1c]
cmp edx, dword [esi + 0x3d0]
jge 0x50909a
mov dword [eax + 0x28], 0x7fffffff
inc dword [esp + 0x10]
dec ebx
jne 0x50906a
cmp dword [esp + 0x18], 0
je 0x5090fd
mov edi, dword [esi + 0x3d0]
mov eax, dword [esi + 0x200]
mov ebx, dword [eax + 0xc]
dec ebx
sub ebx, edi
jl 0x5090d5
inc ebx
mov eax, dword [esi + 0x200]
mov edx, edi
call fcn.00505d04
mov edx, dword [esp + 0x18]
add dword [eax + 0x10], edx
inc edi
dec ebx
jne 0x5090bd
cmp byte [esi + 0x22c], 0
jne 0x5090f6
mov eax, dword [esi + 0x314]
cmp eax, dword [esi + 0x3d0]
jl 0x5090f6
mov eax, dword [esp + 0x18]
add dword [esi + 0x314], eax
mov eax, esi
call fcn.00515fb0
mov ebx, esi
mov eax, dword [ebx + 0x210]
cmp dword [eax + 0x28], 0x7fffffff
jne 0x509122
mov eax, ebx
call fcn.0043d4f4
test al, al
je 0x509122
xor edx, edx
mov eax, ebx
call fcn.0050f4c0
mov eax, dword [ebx + 0x214]
call fcn.00504914
mov ecx, eax
imul ecx, dword [ebx + 0x430]
mov eax, dword [ebx + 0x2a8]
cdq
idiv dword [esi + 0x430]
add ecx, edx
mov eax, ecx
cmp eax, dword [esi + 0x2a8]
je 0x50917d
mov dword [ebx + 0x2a8], eax
cmp byte [ebx + 0x22e], 0
je 0x50917d
push 0xffffffffffffffff
mov eax, dword [ebx + 0x2a8]
cdq
idiv dword [ebx + 0x378]
push eax
push 1
mov eax, ebx
call fcn.0043d1f8
push eax
call sub.user32.dll_SetScrollPos
mov ebx, esi
mov eax, dword [ebx + 0x310]
cmp eax, dword [esp + 0x14]
je 0x5091c3
cmp byte [ebx + 0x22c], 0
jne 0x5091c3
mov eax, ebx
call fcn.00515e7c
cmp byte [ebx + 0x22d], 0
je 0x5091c3
push 0xffffffffffffffff
mov eax, dword [ebx + 0x220]
cdq
idiv dword [ebx + 0x37c]
push eax
push 0
mov eax, ebx
call fcn.0043d1f8
push eax
call sub.user32.dll_SetScrollPos
mov eax, esi
mov edx, dword [eax + 0x3d0]
cmp edx, dword [eax + 0x3d4]
jg 0x509228
mov eax, dword [esp]
cmp dword [eax + 4], 0
je 0x50926c
mov eax, dword [0x5a5258]
mov eax, dword [eax]
call fcn.00455fac
cmp byte [esi + 0x25a], 2
jne 0x50926c
mov eax, dword [0x5a5258]
mov eax, dword [eax]
cmp byte [eax + 0x8c], 0
jne 0x50926c
mov eax, esi
call fcn.0043d4f4
test al, al
je 0x50926c
push 0
push 1
push 0x401
mov eax, esi
call fcn.0043d1f8
push eax
call sub.user32.dll_PostMessageA
jmp 0x50926c
mov byte [eax + 0x3d8], 0
mov dword [eax + 0x3d4], 0xffffffff
mov edx, dword [eax + 0x200]
mov edx, dword [edx + 0xc]
mov dword [eax + 0x3d0], edx
mov dword [eax + 0x24c], 0x64
cmp word [eax + 0x2e2], 0
je 0x50926c
mov ebx, eax
mov edx, esi
mov eax, dword [ebx + 0x2e4]
call dword [ebx + 0x2e0]
add esp, 0xec
pop ebp
pop edi
pop esi
pop ebx
ret