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

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0xf
push 0
push 0
dec ecx
jne 0x5108cd
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x1c]
call fcn.00405878
mov eax, dword [ebp + 0x18]
call fcn.00405878
xor eax, eax
push ebp
push 0x510e33
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
push ebp
push 0x510dd5
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov edx, dword [0x4dcdd8]
call fcn.00404588
mov esi, eax
push 1
mov eax, dword [ebp - 8]
call fcn.004d60f0
call fcn.004813a8
push eax
call sub.gdi32.dll_SetBkMode
movzx eax, word [ebp + 0x14]
mov dword [ebp - 0xc], eax
movzx eax, word [ebp + 0x10]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x20]
mov edx, dword [ebp + 0x1c]
call fcn.00405474
cmp dword [ebp - 0x20], 0
je 0x510d8c
push 0
lea eax, [ebp - 0x44]
push eax
mov byte [ebp - 0x48], 0x5c
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x24]
mov eax, dword [ebp - 0x20]
call fcn.004cffd4
mov edx, dword [ebp - 0x44]
lea eax, [ebp - 0x20]
call fcn.00405474
cmp dword [ebp - 0x24], 0
je 0x510d83
xor eax, eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x28]
call fcn.004053dc
jmp 0x510d3a
mov eax, dword [ebp - 0x24]
cmp byte [eax], 0x3c
je 0x5109c7
push 0
lea eax, [ebp - 0x4c]
push eax
mov byte [ebp - 0x48], 0x3c
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x28]
mov eax, dword [ebp - 0x24]
call fcn.004cffd4
mov ecx, dword [ebp - 0x4c]
lea eax, [ebp - 0x24]
mov edx, 0x510e4c
call fcn.00405710
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x50]
push eax
mov ecx, 0x510e58
mov edx, 0x510e4c
mov eax, dword [ebp - 0x24]
call fcn.004d03f4
mov edx, dword [ebp - 0x50]
lea eax, [ebp - 0x24]
call fcn.00405474
cmp dword [ebp - 0x2c], 0
je 0x510a48
lea edx, [ebp - 0x54]
mov eax, dword [ebp - 0x2c]
call fcn.00409640
mov eax, dword [ebp - 0x54]
mov edx, 0x510e64
call fcn.00405820
je 0x510d3a
lea edx, [ebp - 0x58]
mov eax, dword [ebp - 0x2c]
call fcn.00409640
mov eax, dword [ebp - 0x58]
mov edx, 0x510e70
call fcn.00405820
je 0x510d3a
push 0
lea eax, [ebp - 0x30]
push eax
mov byte [ebp - 0x48], 0x2f
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x2c]
mov eax, dword [ebp - 0x2c]
call fcn.004cffd4
jmp 0x510a68
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x47c]
xor edx, edx
call fcn.004de224
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x490]
xor edx, edx
call fcn.004de224
cmp dword [ebp - 0x28], 0
je 0x510a85
push ebp
push 0
lea eax, [ebp - 0x5c]
push eax
xor ecx, ecx
mov edx, 0xffffff
mov eax, dword [ebp - 0x28]
call fcn.005104ac
pop ecx
cmp dword [ebp - 0x2c], 0
je 0x510d3a
xor ebx, ebx
mov ecx, 6
mov edx, 0x510e7c
mov eax, dword [ebp - 0x30]
call fcn.004d05bc
test al, al
je 0x510ae1
mov bl, 1
push 0
lea eax, [ebp - 0x34]
push eax
mov byte [ebp - 0x48], 0x3d
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x38]
mov eax, dword [ebp - 0x30]
call fcn.004cffd4
mov edx, 0xff
mov eax, dword [ebp - 0x34]
call fcn.004cfdac
call fcn.005357d4
mov edx, eax
mov eax, esi
call fcn.004a8374
jmp 0x510b9b
mov ecx, 9
mov edx, 0x510e8c
mov eax, dword [ebp - 0x30]
call fcn.004d05bc
test al, al
je 0x510b9b
mov bl, 1
push 0
lea eax, [ebp - 0x34]
push eax
mov byte [ebp - 0x48], 0x3d
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x38]
mov eax, dword [ebp - 0x30]
call fcn.004cffd4
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0xd04]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0xd04]
push eax
mov eax, dword [ebp - 0x34]
call fcn.00405888
mov ecx, eax
mov edx, 0x510e98
mov eax, 0x510eb8
call fcn.0041b118
test eax, eax
jle 0x510b80
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0xd04]
mov edx, dword [eax]
call dword [edx + 0x14]
push eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 0xd08]
pop edx
mov ecx, edx
cdq
idiv ecx
mov dword [ebp - 0x1c], edx
lea ecx, [ebp - 0x34]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0xd04]
mov edx, dword [ebp - 0x1c]
mov edi, dword [eax]
call dword [edi + 0xc]
mov edx, 0xff
mov eax, dword [ebp - 0x34]
call fcn.004cfdac
call fcn.005357d4
mov edx, eax
mov eax, esi
call fcn.004a8374
test bl, bl
je 0x510bea
mov eax, dword [esi + 0x70]
push eax
push 0
mov eax, dword [ebp - 0x2c]
push eax
mov edx, dword [esi + 0x44]
add edx, dword [ebp - 0x14]
mov eax, esi
call fcn.004dd3f8
push eax
mov edx, dword [esi + 0x40]
add edx, dword [ebp - 0xc]
add edx, dword [ebp - 0x10]
mov eax, esi
call fcn.004dd3e4
mov edx, eax
mov eax, dword [ebp - 8]
pop ecx
call fcn.0052cd28
mov eax, dword [ebp - 8]
call fcn.004d60f0
mov edx, dword [ebp - 0x2c]
call fcn.004811dc
add dword [ebp - 0x10], eax
jmp 0x510d3a
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x510c86
cmp dword [ebp - 0x30], 0
je 0x510c86
mov edx, dword [0x5022ac]
mov eax, 0x14
call fcn.00406408
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x14]
add eax, 0xe
push eax
lea eax, [ebp - 0x6c]
push eax
push ebp
push 1
lea eax, [ebp - 0x70]
push eax
xor ecx, ecx
mov edx, 0xff
mov eax, dword [ebp - 0x2c]
call fcn.005104ac
pop ecx
mov eax, dword [ebp - 0x70]
push eax
mov eax, dword [ebp - 8]
call fcn.004d60f0
pop edx
call fcn.004811dc
mov ecx, eax
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x10]
add ecx, eax
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
call fcn.00419c18
mov eax, dword [ebp - 0x40]
push esi
lea esi, [ebp - 0x6c]
mov edi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
pop esi
mov eax, dword [ebp - 0x40]
add eax, 0x10
mov edx, dword [ebp - 0x30]
call fcn.00405430
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp + 0xc]
call fcn.0041b37c
cmp dword [ebp - 0x30], 0
jne 0x510ca8
push ebp
push 0
lea eax, [ebp - 0x74]
push eax
xor ecx, ecx
mov edx, 0xff
mov eax, dword [ebp - 0x2c]
call fcn.005104ac
pop ecx
jmp 0x510d3a
mov eax, dword [ebp - 8]
call fcn.004d60f0
mov eax, dword [eax + 0xc]
call fcn.004805e8
or al, byte [0x510ed8]
push eax
mov eax, dword [ebp - 8]
call fcn.004d60f0
mov eax, dword [eax + 0xc]
pop edx
call fcn.004805f4
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp - 0x30]
call fcn.00405820
jne 0x510cf6
push ebp
push 0
lea eax, [ebp - 0x78]
push eax
mov cl, 1
mov edx, 0xff
mov eax, dword [ebp - 0x2c]
call fcn.005104ac
pop ecx
jmp 0x510d0d
push ebp
push 0
lea eax, [ebp - 0x7c]
push eax
xor ecx, ecx
mov edx, 0xffff
mov eax, dword [ebp - 0x2c]
call fcn.005104ac
pop ecx
mov eax, dword [ebp - 8]
call fcn.004d60f0
mov eax, dword [eax + 0xc]
call fcn.004805e8
movzx edx, byte [0x510ed8]
not edx
and dl, al
push edx
mov eax, dword [ebp - 8]
call fcn.004d60f0
mov eax, dword [eax + 0xc]
pop edx
call fcn.004805f4
mov edx, dword [ebp - 0x24]
mov eax, 0x510e4c
call fcn.004059d4
test eax, eax
jle 0x510d66
mov edx, dword [ebp - 0x24]
mov eax, 0x510e58
call fcn.004059d4
test eax, eax
jle 0x510d66
cmp dword [ebp - 0x24], 0
jne 0x510997
cmp dword [ebp - 0x24], 0
je 0x510d83
push ebp
push 0
lea eax, [ebp - 0x80]
push eax
xor ecx, ecx
mov edx, 0xffffff
mov eax, dword [ebp - 0x24]
call fcn.005104ac
pop ecx
add dword [ebp - 0x14], 0x10
jmp 0x51094e
mov eax, dword [ebp - 8]
call fcn.004d60f0
call fcn.004d54a8
mov eax, dword [ebp + 8]
mov byte [eax], 0
call sub.kernel32.dll_GetTickCount_1
mov edx, dword [ebp - 0x18]
sub eax, dword [edx + 0xd0c]
cmp eax, 0x1f4
jbe 0x510dcb
call sub.kernel32.dll_GetTickCount_1
mov edx, dword [ebp - 0x18]
mov dword [edx + 0xd0c], eax
mov eax, dword [ebp - 0x18]
inc byte [eax + 0xd08]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x510de9
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x510e3a
lea eax, [ebp - 0x80]
mov edx, 5
call fcn.00405400
lea eax, [ebp - 0x5c]
mov edx, 5
call fcn.00405400
lea eax, [ebp - 0x44]
call fcn.004053dc
lea eax, [ebp - 0x38]
mov edx, 7
call fcn.00405400
lea eax, [ebp + 0x18]
mov edx, 2
call fcn.00405400
ret