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

Disassembly:
sub esp, 0x3c
mov eax, dword [0x4afb18]
push ebx
mov dword [esp + 0x28], eax
mov al, byte [0x4afb2a]
or al, byte [0x4afac3]
push ebp
push esi
push edi
mov dword [esp + 0x1c], edx
mov byte [esp + 0x13], al
jne 0x4092a5
xor dl, dl
xor cl, cl
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
jmp fcn.00409f70
mov esi, dword [0x4afae0]
test esi, esi
jne 0x409418
push 0x1400
call fcn.00486c6d
add esp, 4
mov dword [0x4afae0], eax
test eax, eax
je 0x40940c
push 0x2800
call fcn.00486c6d
add esp, 4
mov dword [0x4afadc], eax
test eax, eax
je 0x40940c
push 0x20000
call fcn.00486c6d
add esp, 4
mov dword [0x4afaec], eax
test eax, eax
je 0x40940c
push 0x40000
call fcn.00486c6d
mov ebp, eax
add esp, 4
mov dword [0x4afae8], ebp
test ebp, ebp
je 0x40940c
mov ecx, dword [0x4afb1c]
add ecx, ecx
push ecx
call fcn.00485a15
mov ebx, eax
add esp, 4
mov dword [0x4afae4], ebx
test ebx, ebx
je 0x40940c
push 0x1400
push esi
mov esi, dword [0x4afae0]
push esi
call fcn.0048fd00
mov edi, dword [0x4afadc]
push 0x2800
push 0
push edi
call fcn.0048fd00
mov byte [esi + 0x15c], 3
add esp, 0x18
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], 0x4ac1e8
mov dword [esi + 0x190], 0x4ac1ec
mov dword [esi + 0xb40], 0x4ac258
jmp 0x40942a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
jmp fcn.0040a660
mov edi, dword [0x4afadc]
mov ebp, dword [0x4afae8]
mov ebx, dword [0x4afae4]
lea eax, [esi + 9]
mov ecx, 0x100
mov esi, 0x7fff
jmp 0x409440
and byte [eax + 3], 8
lea eax, [eax + 0x14]
mov word [eax - 0x17], si
mov word [eax - 0x14], 0
mov byte [eax - 0x12], 0
mov byte [eax - 0xa], 0
dec ecx
jne 0x409440
lea eax, [edi + 9]
mov ecx, 0x200
and byte [eax + 3], 8
lea eax, [eax + 0x14]
mov word [eax - 0x17], si
mov word [eax - 0x14], 0
mov byte [eax - 0x12], 0
mov byte [eax - 0xa], 0
dec ecx
jne 0x409464
mov ecx, 0x4ac1f4
mov edx, 0x1ff
lea ebx, [ebx]
movzx eax, word [ecx]
test ax, ax
je 0x4094a5
cmp ax, dx
ja 0x4094a5
lea eax, [eax + eax*4]
mov byte [edi + eax*4 + 0x13], 1
add ecx, 8
cmp ecx, 0x4ac25c
jl 0x409490
mov edi, dword [0x4afaec]
mov eax, 0x7fff7fff
mov ecx, 0x8000
rep stosd dword es:[edi], eax
mov ecx, 0x10000
mov edi, ebp
rep stosd dword es:[edi], eax
xor eax, eax
cmp dword [0x4afb1c], eax
jle 0x4094e2
mov word [ebx + eax*2], si
inc eax
cmp eax, dword [0x4afb1c]
jl 0x4094d5
mov eax, dword [0x4ad8fc]
xor ecx, ecx
mov edx, 0xc
movzx eax, word [eax]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00486c6d
mov dword [esp + 0x30], eax
xor ebp, ebp
add esp, 4
mov dword [esp + 0x24], ebp
mov dword [eax], 0
xor eax, eax
mov dword [esp + 0x18], eax
cmp dword [esp + 0x1c], eax
jle 0x409c83
mov ecx, dword [esp + 0x2c]
mov edi, dword [0x4afae0]
add ecx, 6
mov ebx, dword [0x4afadc]
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x1c]
mov edi, edi
mov edx, dword [esp + 0x34]
mov esi, dword [edx + eax*4]
mov al, byte [esi + 0x12]
test al, al
je 0x409790
cmp al, 4
jae 0x409790
cmp byte [0x4af26f], 0
je 0x40957e
mov ecx, esi
call fcn.00405ea0
mov edi, dword [0x4afae0]
mov ebx, dword [0x4afadc]
test al, al
je 0x40978c
cmp word [esi + 6], 0
je 0x4095d5
cmp byte [esi + 0x19], 0
sete al
test al, al
jne 0x40978c
mov al, byte [esi + 0x10]
test al, al
jne 0x4095a6
cmp word [esi + 8], 0
je 0x40978c
cmp al, 0xff
ja 0x40978c
movzx ecx, word [esi + 8]
mov edx, 0x1ff
cmp cx, dx
ja 0x40978c
test al, al
jne 0x4095f2
mov eax, ecx
lea eax, [eax + eax*4]
lea ebp, [ebx + eax*4]
mov byte [ebp + 0x13], 1
jmp 0x4096cf
mov eax, dword [esi + 0x20]
test eax, eax
je 0x40978c
cmp byte [eax + 0x1c], 0
jne 0x409594
mov eax, dword [eax + 8]
test eax, eax
jne 0x4095e0
jmp 0x40978c
movzx ecx, al
lea eax, [ecx + ecx*4]
lea ebp, [edi + eax*4]
sub ecx, 0x10
je 0x409691
dec ecx
je 0x409651
dec ecx
jne 0x4096cf
mov byte [edi + 0xcda], 1
mov byte [edi + 0xcee], 1
mov byte [ebx + 0x46a], 1
mov byte [ebx + 0x186a], 1
cmp byte [esi + 0x16], cl
je 0x4096cf
mov byte [edi + 0xcdb], 1
mov byte [edi + 0xcef], 1
mov byte [ebx + 0x46b], 1
mov byte [ebx + 0x186b], 1
jmp 0x4096cf
mov byte [edi + 0xcb2], 1
mov byte [edi + 0xcc6], 1
mov byte [ebx + 0x24e], 1
mov byte [ebx + 0x164e], 1
cmp byte [esi + 0x16], 0
je 0x4096cf
mov byte [edi + 0xcb3], 1
mov byte [edi + 0xcc7], 1
mov byte [ebx + 0x24f], 1
mov byte [ebx + 0x164f], 1
jmp 0x4096cf
mov byte [edi + 0xc8a], 1
mov byte [edi + 0xc9e], 1
mov byte [ebx + 0x352], 1
mov byte [ebx + 0x1842], 1
cmp byte [esi + 0x16], 0
je 0x4096cf
mov byte [edi + 0xc8b], 1
mov byte [edi + 0xc9f], 1
mov byte [ebx + 0x353], 1
mov byte [ebx + 0x1843], 1
mov byte [ebp + 0xa], 1
cmp byte [esi + 0x16], 0
movzx edx, word [esi + 4]
mov dword [esp + 0x28], edx
je 0x4096ef
or edx, 0x8000
mov byte [ebp + 0xb], 1
mov dword [esp + 0x28], edx
mov cl, byte [esi + 0x11]
test cl, cl
jne 0x409701
cmp word [esi + 0xa], 0
jne 0x409701
xor al, al
jmp 0x409703
mov al, 1
cmp byte [ebp + 8], 0
je 0x409874
cmp byte [esi + 0xf], 0
jne 0x409874
test al, al
jne 0x40987c
test byte [esi + 0x13], 2
jne 0x40973a
mov dx, word [esi + 8]
mov cl, byte [esi + 0x10]
push 0
call fcn.00409120
mov edx, dword [esp + 0x2c]
add esp, 4
cmp byte [esi + 0xf], 0
jne 0x40974a
test byte [esi + 0x13], 2
je 0x40974a
or byte [ebp + 0xc], 1
movzx eax, word [esi + 6]
test ax, ax
jne 0x409756
movzx eax, dx
mov ecx, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
inc ebp
mov dword [esp + 0x24], ebp
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 byte [ecx - 1], al
add ecx, 0xc
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x18], eax
cmp eax, ecx
jl 0x409540
test ebp, ebp
je 0x409c83
mov ebx, dword [esp + 0x2c]
push 0x408fd0
push 0xc
push ebp
push ebx
call fcn.00486c80
add esp, 0x10
test ebp, ebp
jle 0x409c83
mov ecx, dword [0x4afaec]
lea edx, [ebx + 0xa]
mov esi, dword [0x4afae8]
mov ebp, dword [0x4afae4]
add esi, 0x270
mov dword [esp + 0x48], esi
lea eax, [ecx + 0x14a]
mov dword [esp + 0x30], 8
mov dword [esp + 0x3c], eax
mov eax, 0xfffffeb6
sub eax, ecx
mov dword [esp + 0x38], 0xc0
mov dword [esp + 0x44], eax
lea ebx, [ebx]
movzx eax, word [edx]
mov ebx, dword [edx - 0xa]
mov ecx, eax
shr ecx, 0xf
and eax, 0x7fff
and ecx, 0xffffff01
mov dword [esp + 0x28], eax
mov dword [esp + 0x34], ecx
mov edi, ebx
mov cl, byte [edx - 6]
mov dword [esp + 0x18], ebx
test cl, cl
je 0x409863
xor eax, eax
test cl, 0xc0
cmovne eax, dword [esp + 0x30]
test cl, 0xc
je 0x40984d
or eax, 1
test cl, 0x30
je 0x409855
or eax, 4
test cl, 3
je 0x40985d
or eax, 2
or edi, eax
mov dword [esp + 0x18], edi
cmp byte [edx - 5], 0
je 0x4099a7
xor cl, cl
jmp 0x4099cd
test al, al
je 0x40973a
test cl, cl
je 0x40994d
movzx eax, cl
lea eax, [eax + eax*4]
cmp byte [edi + eax*4 + 8], 0
lea eax, [edi + eax*4]
je 0x409935
mov al, cl
sub al, 0x10
cmp al, 2
movzx eax, cl
ja 0x40992b
sub eax, 0x10
je 0x409906
dec eax
je 0x4098de
dec eax
jne 0x40998e
mov byte [edi + 0x171], 2
mov byte [edi + 0xcd9], 2
mov byte [edi + 0xced], 2
mov byte [ebx + 0x469], 2
mov byte [ebx + 0x1869], 2
jmp 0x40998e
mov byte [edi + 0x15d], 2
mov byte [edi + 0xcb1], 2
mov byte [edi + 0xcc5], 2
mov byte [ebx + 0x24d], 2
mov byte [ebx + 0x164d], 2
jmp 0x40998e
mov byte [edi + 0x149], 2
mov byte [edi + 0xc89], 2
mov byte [edi + 0xc9d], 2
mov byte [ebx + 0x351], 2
mov byte [ebx + 0x1841], 2
jmp 0x40998e
lea eax, [eax + eax*4]
mov byte [edi + eax*4 + 9], 1
jmp 0x40998e
mov byte [eax + 9], 1
test byte [esi + 0x13], 1
je 0x40998e
movzx eax, byte [esi + 0x11]
lea eax, [eax + eax*4]
or byte [edi + eax*4 + 0xc], 1
jmp 0x40998e
movzx ecx, word [esi + 0xa]
mov eax, ecx
lea eax, [eax + eax*4]
cmp byte [ebx + eax*4 + 8], 0
lea eax, [ebx + eax*4]
je 0x40996c
mov eax, ecx
lea eax, [eax + eax*4]
mov byte [ebx + eax*4 + 9], 1
jmp 0x40998e
mov byte [eax + 9], 1
test byte [esi + 0x13], 1
je 0x409982
movzx eax, word [esi + 0xa]
lea eax, [eax + eax*4]
or byte [ebx + eax*4 + 0xc], 1
movzx eax, word [esi + 0xa]
lea eax, [eax + eax*4]
mov byte [ebx + eax*4 + 0x13], 1
movzx eax, word [ebp + 6]
mov word [esi + 0xc], ax
movzx eax, word [esi + 4]
mov word [ebp + 6], ax
mov ebp, dword [esp + 0x24]
jmp 0x40978c
xor al, al
test bl, 8
movzx eax, al
cmovne eax, dword [esp + 0x38]
test bl, 1
je 0x4099bb
or al, 0xc
test bl, 2
je 0x4099c2
or al, 3
test bl, 4
je 0x4099c9
or al, 0x30
or cl, al
not cl
movzx eax, cl
xor ebx, ebx
mov dword [esp + 0x14], esi
xor ecx, ecx
mov esi, dword [esp + 0x3c]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], esi
lea esp, [esp]
test dword [esp + 0x40], ebx
jne 0x409c48
xor eax, eax
test bl, 0xc0
cmovne eax, dword [esp + 0x30]
test bl, 0xc
je 0x409a0c
or eax, 1
test bl, 0x30
je 0x409a14
or eax, 4
test bl, 3
je 0x409a1c
or eax, 2
and eax, edi
cmp edi, eax
jne 0x409c44
mov al, byte [edx - 6]
test al, al
je 0x409a40
movzx ecx, al
mov eax, ecx
and eax, ebx
cmp ecx, eax
mov ecx, dword [esp + 0x20]
jne 0x409c44
mov al, byte [edx - 4]
test al, al
jne 0x409aec
movzx eax, word [edx - 2]
add eax, dword [esp + 0x44]
add eax, esi
mov esi, dword [0x4afae8]
lea edi, [esi + eax*2]
mov eax, 0x7fff
movzx esi, word [edi]
cmp si, ax
jne 0x409a7a
mov ax, word [edx]
mov word [edi], ax
mov esi, dword [esp + 0x1c]
jmp 0x409c40
mov eax, esi
shr eax, 0xf
and al, 1
cmp byte [esp + 0x34], 0
je 0x409aa3
test al, al
jne 0x409ac2
mov ax, word [edx]
and esi, 0x7fff
mov word [ebp + esi*2], ax
mov esi, dword [esp + 0x1c]
jmp 0x409c40
test al, al
je 0x409ac2
mov eax, dword [esp + 0x28]
movzx eax, ax
mov word [ebp + eax*2], si
mov ax, word [edx]
mov esi, dword [esp + 0x1c]
mov word [edi], ax
jmp 0x409c40
mov eax, dword [esp + 0x28]
and esi, 0x7fff
movzx ecx, ax
movzx eax, word [ebp + esi*2]
mov esi, dword [esp + 0x1c]
mov word [ebp + ecx*2], ax
movzx eax, word [edx]
mov ecx, dword [esp + 0x20]
mov word [edi], ax
jmp 0x409c40
mov esi, dword [0x4afaec]
movzx eax, al
add eax, ecx
lea edi, [esi + eax*2]
mov eax, 0x7fff
movzx esi, word [edi]
cmp si, ax
jne 0x409b0c
mov ax, word [edx]
jmp 0x409b40
mov eax, esi
shr eax, 0xf
and al, 1
cmp byte [esp + 0x34], 0
je 0x409b63
test al, al
je 0x409a8c
mov eax, dword [esp + 0x28]
and esi, 0x7fff
movzx ecx, ax
movzx eax, word [ebp + esi*2]
mov word [ebp + ecx*2], ax
movzx eax, word [edx]
mov ecx, dword [esp + 0x20]
mov word [edi], ax
movzx eax, byte [edx - 4]
add eax, 0xfffffff0
cmp eax, 0x95
ja case.0x409b5c.19
movzx eax, byte [eax + 0x409e14]
jmp dword [eax*4 + 0x409df8]
test al, al
je 0x409b22
mov eax, dword [esp + 0x28]
movzx eax, ax
mov word [ebp + eax*2], si
mov ax, word [edx]
jmp 0x409b40
mov esi, dword [esp + 0x1c]
movzx eax, word [edx]
mov edi, dword [esp + 0x14]
mov word [esi - 2], ax
movzx eax, word [edx]
mov word [edi - 0x200], ax
cmp byte [edx - 4], 0xa4
je 0x409c40
movzx eax, word [edx]
mov word [esi], ax
movzx eax, word [edx]
mov word [edi], ax
jmp 0x409c40
mov esi, dword [esp + 0x1c]
movzx eax, word [edx]
mov edi, dword [esp + 0x14]
mov word [esi], ax
movzx eax, word [edx]
mov word [edi], ax
jmp 0x409c40
mov esi, dword [esp + 0x1c]
movzx eax, word [edx]
mov edi, dword [esp + 0x14]
mov word [esi - 0xa], ax
movzx eax, word [edx]
mov word [edi - 0x21c], ax
cmp byte [edx - 4], 0xa0
je 0x409c40
movzx eax, word [edx]
mov word [esi - 8], ax
movzx eax, word [edx]
mov word [edi - 4], ax
jmp 0x409c40
mov esi, dword [esp + 0x1c]
movzx eax, word [edx]
mov edi, dword [esp + 0x14]
mov word [esi - 8], ax
movzx eax, word [edx]
mov word [edi - 4], ax
jmp 0x409c40
mov esi, dword [esp + 0x1c]
movzx eax, word [edx]
mov edi, dword [esp + 0x14]
mov word [esi - 6], ax
movzx eax, word [edx]
mov word [edi - 0x236], ax
cmp byte [edx - 4], 0xa2
je 0x409c40
jmp 0x409c32
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x14]
movzx eax, word [edx]
mov word [esi - 4], ax
movzx eax, word [edx]
mov word [edi - 0x36], ax
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
add ecx, 0x100
add esi, 0x200
add eax, 0x400
mov dword [esp + 0x20], ecx
inc ebx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x14], eax
cmp ecx, 0xff00
jle 0x4099f0
mov esi, dword [esp + 0x48]
add edx, 0xc
dec dword [esp + 0x24]
jne 0x409810
push dword [esp + 0x2c]
call fcn.00487087
mov ecx, dword [0x4afae0]
add esp, 4
mov ebx, 0x7fff
cmp byte [ecx + 0x14a], 0
je 0x409d04
movzx edi, word [ecx + 0x146]
cmp di, bx
je 0x409d04
movzx edx, word [ecx + 0xc86]
lea eax, [ecx + 0xc86]
cmp dx, bx
je 0x409cd8
mov esi, dword [0x4afb18]
movzx eax, dx
mov eax, dword [esi + eax*4]
add eax, 0xc
movzx edx, word [eax]
cmp dx, bx
jne 0x409cc7
mov word [eax], di
lea eax, [ecx + 0xc9a]
movzx edx, word [eax]
cmp dx, bx
je 0x409d01
mov esi, dword [0x4afb18]
nop
movzx eax, dx
mov eax, dword [esi + eax*4]
add eax, 0xc
movzx edx, word [eax]
cmp dx, bx
jne 0x409cf0
mov word [eax], di
cmp byte [ecx + 0x15e], 0
je 0x409d74
movzx edi, word [ecx + 0x15a]
cmp di, bx
je 0x409d74
movzx edx, word [ecx + 0xcae]
lea eax, [ecx + 0xcae]
cmp dx, bx
je 0x409d42
mov esi, dword [0x4afb18]
movzx eax, dx
mov eax, dword [esi + eax*4]
add eax, 0xc
movzx edx, word [eax]
cmp dx, bx
jne 0x409d31
mov word [eax], di
lea eax, [ecx + 0xcc2]
movzx edx, word [eax]
cmp dx, bx
je 0x409d71
mov esi, dword [0x4afb18]
lea esp, [esp]
movzx eax, dx
mov eax, dword [esi + eax*4]
add eax, 0xc
movzx edx, word [eax]
cmp dx, bx
jne 0x409d60
mov word [eax], di
cmp byte [ecx + 0x172], 0
je 0x409de4
movzx edi, word [ecx + 0x16e]
cmp di, bx
je 0x409de4
movzx edx, word [ecx + 0xcd6]
lea eax, [ecx + 0xcd6]
cmp dx, bx
je 0x409db2
mov esi, dword [0x4afb18]
movzx eax, dx
mov eax, dword [esi + eax*4]
add eax, 0xc
movzx edx, word [eax]
cmp dx, bx
jne 0x409da1
mov word [eax], di
lea eax, [ecx + 0xcea]
movzx ecx, word [eax]
cmp cx, bx
je 0x409de1
mov edx, dword [0x4afb18]
lea esp, [esp]
movzx eax, cx
mov eax, dword [edx + eax*4]
add eax, 0xc
movzx ecx, word [eax]
cmp cx, bx
jne 0x409dd0
mov word [eax], di
xor dl, dl
mov cl, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
jmp fcn.00409f70