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

Disassembly:
sub esp, 0x54
mov al, byte [0x4dbffe]
or al, byte [0x4dbebf]
push ebx
push ebp
mov ebp, dword [0x4dbfec]
push esi
push edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x30], ebp
mov byte [esp + 0x15], al
jne 0x4086e6
xor dl, dl
xor cl, cl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
jmp fcn.00409310
mov esi, dword [0x4dd674]
test esi, esi
jne 0x408838
push 0x1400
call fcn.00493fda
add esp, 4
mov dword [0x4dd674], eax
push 0x2800
call fcn.00493fda
add esp, 4
mov dword [0x4dd678], eax
push 0x20000
call fcn.00493fda
add esp, 4
mov dword [0x4dd668], eax
push 0x40000
call fcn.00493fda
mov dword [0x4dd66c], eax
add esp, 4
mov eax, dword [0x4dbff0]
add eax, eax
push eax
call fcn.00497ab4
mov ebx, eax
add esp, 4
mov dword [0x4dd670], ebx
test ebx, ebx
je 0x40882c
push 0x1400
push esi
mov esi, dword [0x4dd674]
push esi
call fcn.004956d0
mov edi, dword [0x4dd678]
add esp, 0xc
push 0x2800
push 0
push edi
call fcn.004956d0
mov byte [esi + 0x15c], 3
add esp, 0xc
mov byte [esi + 0xcb0], 1
mov byte [esi + 0xcc4], 2
mov byte [esi + 0x170], 0xc
mov byte [esi + 0xcd8], 4
mov byte [esi + 0xcec], 8
mov byte [esi + 0x148], 0x30
mov byte [esi + 0xc88], 0x10
mov byte [esi + 0xc9c], 0x20
mov byte [esi + 0x724], 0x40
mov byte [esi + 0x738], 0x80
mov byte [edi + 0x24c], 1
mov byte [edi + 0x164c], 2
mov byte [edi + 0x468], 4
mov byte [edi + 0x1868], 8
mov byte [edi + 0x350], 0x10
mov byte [edi + 0x1840], 0x20
mov byte [edi + 0x1b24], 0x40
mov byte [edi + 0x1b38], 0x80
mov dword [esi + 0xb54], 0x4d7d44
mov dword [esi + 0x190], 0x4d7d48
mov dword [esi + 0xb40], 0x4d7d4c
jmp 0x408844
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
jmp fcn.00409940
mov edi, dword [0x4dd678]
mov ebx, dword [0x4dd670]
mov edx, 0x7fff
lea eax, [esi + 9]
mov ecx, 0x100
mov dword [esp + 0x40], edx
and byte [eax + 3], 8
lea eax, [eax + 0x14]
mov word [eax - 0x17], dx
mov word [eax - 0x14], 0
mov byte [eax - 0x12], 0
mov byte [eax - 0xa], 0
sub ecx, 1
jne 0x408855
lea eax, [edi + 9]
mov ecx, 0x200
nop dword [eax + eax]
and byte [eax + 3], 8
lea eax, [eax + 0x14]
mov word [eax - 0x17], dx
mov word [eax - 0x14], 0
mov byte [eax - 0x12], 0
mov byte [eax - 0xa], 0
sub ecx, 1
jne 0x408880
mov ecx, 0x4d78dc
mov esi, 0x1fe
nop dword [eax + eax]
movzx edx, word [ecx]
lea eax, [edx - 1]
cmp ax, si
ja 0x4088c5
mov eax, edx
lea eax, [eax + eax*4]
mov byte [edi + eax*4 + 0x13], 1
add ecx, 8
cmp ecx, 0x4d7944
jl 0x4088b0
mov edi, dword [0x4dd668]
mov eax, 0x7fff7fff
mov ecx, 0x8000
rep stosd dword es:[edi], eax
mov edi, dword [0x4dd66c]
mov ecx, 0x10000
rep stosd dword es:[edi], eax
xor eax, eax
cmp dword [0x4dbff0], eax
jle 0x40890d
mov ecx, 0x7fff
nop
mov word [ebx + eax*2], cx
inc eax
cmp eax, dword [0x4dbff0]
jl 0x408900
movzx eax, word [0x4dbffc]
xor ecx, ecx
mov edx, 0xc
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00493fda
mov dword [esp + 0x38], eax
add esp, 4
xor eax, eax
mov dword [esp + 0x28], 0
mov dword [esp + 0x18], eax
cmp dword [esp + 0x24], eax
jle 0x408fbc
mov ecx, dword [esp + 0x34]
mov edx, 0x1ff
mov ebx, dword [0x4dd674]
add ecx, 6
mov edi, dword [0x4dd678]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x24]
nop dword [eax]
mov esi, dword [ebp + eax*4]
mov al, byte [esi + 0x12]
test al, al
je 0x408a21
cmp al, 4
jae 0x408a21
cmp byte [0x4dbea0], 0
je 0x4089bd
cmp word [esi + 6], 0
jne 0x408a21
mov eax, dword [esi + 0x20]
test eax, eax
je 0x408a21
cmp byte [eax + 0x21], 0
jne 0x4089b1
mov eax, dword [eax + 0xc]
test eax, eax
jne 0x4089a2
jmp 0x408a21
lea eax, [esi + 6]
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x20]
jmp 0x408a10
cmp word [esi + 6], 0
lea ecx, [esi + 6]
mov dword [esp + 0x2c], ecx
je 0x408a01
cmp byte [esi + 0x19], 0
je 0x408a1d
mov al, byte [esi + 0x10]
test al, al
jne 0x4089df
cmp word [esi + 8], 0
je 0x408a1d
movzx ecx, word [esi + 8]
cmp cx, dx
ja 0x408a1d
test al, al
jne 0x408afc
mov eax, ecx
lea eax, [eax + eax*4]
lea ebp, [edi + eax*4]
mov byte [ebp + 0x13], 1
jmp 0x408bdd
mov eax, dword [esi + 0x20]
mov dword [esp + 0x2c], ecx
test eax, eax
je 0x408a1d
nop dword [eax]
cmp byte [eax + 0x20], 0
jne 0x4089d1
mov eax, dword [eax + 0xc]
test eax, eax
jne 0x408a10
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x18], eax
cmp eax, ecx
jl 0x408970
test esi, esi
je 0x408fbc
mov ebx, dword [esp + 0x34]
push 0x408350
push 0xc
push esi
push ebx
call fcn.00497fb0
add esp, 0x10
test esi, esi
jle 0x408fbc
mov ecx, dword [0x4dd668]
mov ebp, ebx
mov eax, dword [0x4dd66c]
mov esi, 0x7ff9
mov edx, dword [0x4dd674]
mov ebx, dword [0x4dd670]
mov dword [esp + 0x54], eax
add eax, 0x270
mov dword [esp + 0x44], eax
lea eax, [ecx + 0x14a]
mov dword [esp + 0x48], eax
mov eax, 0xfffffeb6
sub eax, ecx
mov dword [esp + 0x58], ecx
mov ecx, dword [0x4dd678]
mov dword [esp + 0x50], eax
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x60], edx
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x38], ebx
nop word [eax + eax]
movzx edi, word [ebp + 0xa]
mov ax, di
and edi, 0x7fff
shr ax, 0xf
mov word [esp + 0x16], ax
mov dword [esp + 0x2c], edi
cmp di, si
ja 0x408db4
mov al, byte [ebp + 6]
test al, al
je 0x408d48
movzx eax, al
lea eax, [eax + eax*4]
lea esi, [edx + eax*4]
jmp 0x408d52
movzx ecx, al
lea eax, [ecx + ecx*4]
lea ebp, [ebx + eax*4]
sub ecx, 0x10
je 0x408b9f
sub ecx, 1
je 0x408b5f
sub ecx, 1
jne 0x408bdd
mov byte [ebx + 0xcda], 1
mov byte [ebx + 0xcee], 1
mov byte [edi + 0x46a], 1
mov byte [edi + 0x186a], 1
cmp byte [esi + 0x16], cl
je 0x408bdd
mov byte [ebx + 0xcdb], 1
mov byte [ebx + 0xcef], 1
mov byte [edi + 0x46b], 1
mov byte [edi + 0x186b], 1
jmp 0x408bdd
mov byte [ebx + 0xcb2], 1
mov byte [ebx + 0xcc6], 1
mov byte [edi + 0x24e], 1
mov byte [edi + 0x164e], 1
cmp byte [esi + 0x16], 0
je 0x408bdd
mov byte [ebx + 0xcb3], 1
mov byte [ebx + 0xcc7], 1
mov byte [edi + 0x24f], 1
mov byte [edi + 0x164f], 1
jmp 0x408bdd
mov byte [ebx + 0xc8a], 1
mov byte [ebx + 0xc9e], 1
mov byte [edi + 0x352], 1
mov byte [edi + 0x1842], 1
cmp byte [esi + 0x16], 0
je 0x408bdd
mov byte [ebx + 0xc8b], 1
mov byte [ebx + 0xc9f], 1
mov byte [edi + 0x353], 1
mov byte [edi + 0x1843], 1
mov byte [ebp + 0xa], 1
cmp byte [esi + 0x16], 0
movzx edx, word [esi + 4]
mov dword [esp + 0x20], edx
je 0x408bfd
or edx, 0x8000
mov byte [ebp + 0xb], 1
mov dword [esp + 0x20], edx
mov cl, byte [esi + 0x11]
test cl, cl
jne 0x408c0f
cmp word [esi + 0xa], 0
jne 0x408c0f
xor al, al
jmp 0x408c11
mov al, 1
cmp byte [ebp + 8], 0
je 0x408caf
cmp byte [esi + 0xf], 0
jne 0x408caf
test al, al
jne 0x408cb3
test byte [esi + 0x13], 2
jne 0x408c48
mov dx, word [esi + 8]
mov cl, byte [esi + 0x10]
push 0
call fcn.004084c0
mov edx, dword [esp + 0x24]
add esp, 4
cmp byte [esi + 0xf], 0
jne 0x408c58
test byte [esi + 0x13], 2
je 0x408c58
or byte [ebp + 0xc], 1
mov eax, dword [esp + 0x2c]
movzx eax, word [eax]
test ax, ax
jne 0x408c67
movzx eax, dx
mov ecx, dword [esp + 0x1c]
mov edx, 0x1ff
mov ebp, dword [esp + 0x30]
mov word [ecx + 4], ax
mov al, byte [esi + 0x10]
mov byte [ecx], al
mov ax, word [esi + 8]
mov word [ecx + 2], ax
mov eax, dword [esi]
mov dword [ecx - 6], eax
mov al, byte [esi + 0xe]
mov byte [ecx - 2], al
mov al, byte [esi + 0x15]
mov esi, dword [esp + 0x28]
mov byte [ecx - 1], al
inc esi
add ecx, 0xc
mov dword [esp + 0x28], esi
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x24]
jmp 0x408a25
test al, al
je 0x408c48
test cl, cl
je 0x408ced
movzx eax, cl
lea eax, [eax + eax*4]
cmp byte [ebx + eax*4 + 8], 0
lea eax, [ebx + eax*4]
je 0x408cd5
push 1
xor edx, edx
call fcn.004084c0
add esp, 4
jmp 0x408d2a
mov byte [eax + 9], 1
test byte [esi + 0x13], 1
je 0x408d2a
movzx eax, byte [esi + 0x11]
lea eax, [eax + eax*4]
or byte [ebx + eax*4 + 0xc], 1
jmp 0x408d2a
movzx ecx, word [esi + 0xa]
lea eax, [ecx + ecx*4]
cmp byte [edi + eax*4 + 8], 0
lea eax, [edi + eax*4]
je 0x408d08
lea eax, [ecx + ecx*4]
mov byte [edi + eax*4 + 9], 1
jmp 0x408d2a
mov byte [eax + 9], 1
test byte [esi + 0x13], 1
je 0x408d1e
movzx eax, word [esi + 0xa]
lea eax, [eax + eax*4]
or byte [edi + eax*4 + 0xc], 1
movzx eax, word [esi + 0xa]
lea eax, [eax + eax*4]
mov byte [edi + eax*4 + 0x13], 1
movzx eax, word [ebp + 6]
mov edx, 0x1ff
mov word [esi + 0xc], ax
movzx eax, word [esi + 4]
mov word [ebp + 6], ax
mov ebp, dword [esp + 0x30]
jmp 0x408a1d
movzx eax, word [ebp + 8]
lea eax, [eax + eax*4]
lea esi, [ecx + eax*4]
movzx eax, word [esi + 6]
add esi, 6
mov ecx, eax
mov edx, eax
cmp ax, word [esp + 0x40]
je 0x408da3
mov ebx, dword [esp + 0x30]
mov edi, ecx
mov ebp, 0x7fff
nop
movzx ecx, di
mov eax, dword [ebx + ecx*4]
cmp byte [eax + 0x11], 0
jne 0x408d85
cmp word [eax + 0xa], 0
mov edx, ecx
je 0x408d97
movzx ecx, word [eax + 0xc]
lea esi, [eax + 0xc]
mov eax, ecx
mov edi, ecx
mov edx, eax
cmp cx, bp
jne 0x408d70
mov ebp, dword [esp + 0x3c]
mov ebx, dword [esp + 0x38]
mov edi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
movzx eax, di
mov eax, dword [ecx + eax*4]
mov word [eax + 0xc], dx
mov word [esi], di
mov ah, byte [ebp + 4]
mov ecx, dword [ebp]
mov edi, ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x3c], ecx
mov byte [esp + 0x14], ah
test ah, ah
je 0x408e08
mov al, ah
and al, 0xc0
movzx ecx, al
mov al, ah
neg ecx
sbb ecx, ecx
and ecx, 8
mov edx, ecx
or edx, 1
and al, 0xc
mov al, ah
cmove edx, ecx
mov esi, edx
or esi, 4
and al, 0x30
mov al, ah
cmove esi, edx
mov ecx, esi
or ecx, 2
and al, 3
cmove ecx, esi
or edi, ecx
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x3c], edi
cmp byte [ebp + 5], 0
je 0x408e12
xor cl, cl
jmp 0x408e60
mov ebx, ecx
and bl, 8
neg bl
sbb bl, bl
and bl, 0xc0
mov al, bl
or al, 0xc
and cl, 1
mov ecx, dword [esp + 0x24]
movzx edx, al
movzx eax, bl
cmove edx, eax
mov al, dl
or al, 3
and cl, 2
movzx ebx, al
movzx eax, dl
mov edx, dword [esp + 0x24]
cmove ebx, eax
mov al, bl
or al, 0x30
and dl, 4
movzx ecx, al
movzx eax, bl
mov ebx, dword [esp + 0x38]
cmove ecx, eax
or cl, byte [esp + 0x14]
not cl
movzx ecx, cl
xor eax, eax
mov dword [esp + 0x4c], ecx
mov edx, eax
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
nop word [eax + eax]
test dword [esp + 0x4c], eax
jne 0x408f6e
and al, 0xc0
movzx ecx, al
mov al, byte [esp + 0x1c]
neg ecx
sbb ecx, ecx
and ecx, 8
mov edx, ecx
or edx, 1
and al, 0xc
cmove edx, ecx
mov ecx, dword [esp + 0x1c]
mov al, cl
mov esi, edx
or esi, 4
and al, 0x30
mov al, cl
cmove esi, edx
mov ecx, esi
or ecx, 2
and al, 3
cmove ecx, esi
and ecx, dword [esp + 0x3c]
cmp dword [esp + 0x3c], ecx
jne case.0x4090d5.19
mov al, byte [ebp + 4]
test al, al
je 0x408ef2
movzx ecx, al
mov eax, ecx
and eax, dword [esp + 0x1c]
cmp ecx, eax
jne case.0x4090d5.19
mov al, byte [ebp + 6]
test al, al
jne 0x40904c
movzx eax, word [ebp + 8]
add eax, dword [esp + 0x24]
add eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
movzx edx, word [ecx + eax*2]
lea esi, [ecx + eax*2]
mov eax, 0x7fff
cmp dx, ax
je 0x408f57
mov ax, dx
shr ax, 0xf
cmp byte [esp + 0x16], 0
je 0x408f44
test al, al
jne 0x40902e
mov ax, word [ebp + 0xa]
and edx, 0x7fff
mov word [ebx + edx*2], ax
jmp case.0x4090d5.19
test al, al
je 0x40902e
mov eax, dword [esp + 0x2c]
movzx eax, ax
mov word [ebx + eax*2], dx
mov ax, word [ebp + 0xa]
mov word [esi], ax
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
add edx, 0x100
inc eax
add ecx, 0x200
mov dword [esp + 0x1c], eax
add esi, 0x400
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], esi
cmp edx, 0xff00
jle 0x408e90
mov ecx, dword [esp + 0x5c]
add ebp, 0xc
sub dword [esp + 0x28], 1
mov esi, 0x7ff9
mov edx, dword [esp + 0x60]
mov dword [esp + 0x3c], ebp
jne 0x408ac0
push dword [esp + 0x34]
call fcn.00493fe3
mov esi, dword [0x4dd674]
add esp, 4
cmp byte [esi + 0x14a], 0
je 0x408fe8
push 0xa1
mov dl, 0xa0
mov cl, 0x10
call fcn.00409270
add esp, 4
cmp byte [esi + 0x15e], 0
je 0x409002
push 0xa3
mov dl, 0xa2
mov cl, 0x11
call fcn.00409270
add esp, 4
cmp byte [esi + 0x172], 0
je 0x40901c
push 0xa5
mov dl, 0xa4
mov cl, 0x12
call fcn.00409270
add esp, 4
mov cl, byte [esp + 0x15]
xor dl, dl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
jmp fcn.00409310
mov eax, dword [esp + 0x2c]
and edx, 0x7fff
movzx ecx, ax
movzx eax, word [ebx + edx*2]
mov word [ebx + ecx*2], ax
movzx eax, word [ebp + 0xa]
jmp 0x408f5b
mov ecx, dword [esp + 0x58]
movzx eax, al
add eax, dword [esp + 0x20]
movzx edx, word [ecx + eax*2]
lea esi, [ecx + eax*2]
mov eax, 0x7fff
cmp dx, ax
je 0x4090b3
mov ax, dx
shr ax, 0xf
cmp byte [esp + 0x16], 0
je 0x40908d
test al, al
jne 0x40909e
mov ax, word [ebp + 0xa]
and edx, 0x7fff
mov word [ebx + edx*2], ax
jmp case.0x4090d5.19
test al, al
je 0x40909e
mov eax, dword [esp + 0x2c]
movzx eax, ax
mov word [ebx + eax*2], dx
jmp 0x4090b3
mov eax, dword [esp + 0x2c]
and edx, 0x7fff
movzx ecx, ax
mov ax, word [ebx + edx*2]
mov word [ebx + ecx*2], ax
lea eax, [ebp + 0xa]
mov ax, word [eax]
mov word [esi], ax
movzx eax, byte [ebp + 6]
add eax, 0xfffffff0
cmp eax, 0x95
ja case.0x4090d5.19
movzx eax, byte [eax + 0x4091d4]
jmp dword [eax*4 + 0x4091b8]
mov ecx, dword [esp + 0x24]
movzx eax, word [ebp + 0xa]
mov edx, dword [esp + 0x18]
mov word [ecx - 2], ax
movzx eax, word [ebp + 0xa]
mov word [edx - 0x200], ax
cmp byte [ebp + 6], 0xa4
je 0x408f62
movzx eax, word [ebp + 0xa]
mov word [ecx], ax
movzx eax, word [ebp + 0xa]
mov word [edx], ax
jmp 0x408f62
mov ecx, dword [esp + 0x24]
movzx eax, word [ebp + 0xa]
mov edx, dword [esp + 0x18]
mov word [ecx], ax
movzx eax, word [ebp + 0xa]
mov word [edx], ax
jmp 0x408f62
mov ecx, dword [esp + 0x24]
movzx eax, word [ebp + 0xa]
mov edx, dword [esp + 0x18]
mov word [ecx - 0xa], ax
movzx eax, word [ebp + 0xa]
mov word [edx - 0x21c], ax
cmp byte [ebp + 6], 0xa0
je 0x408f62
jmp 0x40915e
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x18]
movzx eax, word [ebp + 0xa]
mov word [ecx - 8], ax
movzx eax, word [ebp + 0xa]
mov word [edx - 4], ax
jmp 0x408f62
mov ecx, dword [esp + 0x24]
movzx eax, word [ebp + 0xa]
mov edx, dword [esp + 0x18]
mov word [ecx - 6], ax
movzx eax, word [ebp + 0xa]
mov word [edx - 0x236], ax
cmp byte [ebp + 6], 0xa2
je 0x408f62
jmp 0x4091a2
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x18]
movzx eax, word [ebp + 0xa]
mov word [ecx - 4], ax
movzx eax, word [ebp + 0xa]
mov word [edx - 0x36], ax
jmp 0x408f62