Function at 0x402020
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x54
push ebx
mov dword [ebp - 4], 0
call fcn.00419550
push 0
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00411d40
push 0
call fcn.00401b30
push 0
push 0
push 1
push 0x20
push 0x17e
push 0x19d
call fcn.00404650
push 0
push 1
push 0xbf
push 0xcf
call fcn.004018c0
push 0x80000000
push 0
push 0
push 0x17e
push 0x19d
call fcn.00404a50
mov dword [0x4210a0], eax
push 0x80000000
push 0
push 0
push 0x17e
push 0x19d
call fcn.00404a50
mov dword [0x4210a4], eax
push 0x80000000
push 0
push 0
push 0xc0
push 0x150
call fcn.00404a50
mov dword [0x4210a8], eax
push 0x80000000
push 0
push 0
push 0xc0
push 0x150
call fcn.00404a50
mov dword [0x4210ac], eax
push 0
push dword [0x4210a0]
push 0x14
push str.PropsDisplayOff.bmp
call fcn.00411d70
push eax
call fcn.00406350
push 0
push dword [0x4210a4]
push 0x13
push str.PropsDisplayOn.bmp
call fcn.00411d70
push eax
call fcn.00406350
push 0
push dword [0x4210a8]
push 0x18
push str.PropsArea4x4Off_lit.bmp
call fcn.00411d70
push eax
call fcn.00406350
push 0
push dword [0x4210ac]
push 0x17
push str.PropsArea4x4On_lit.bmp
call fcn.00411d70
push eax
call fcn.00406350
push 0x80000000
push 0
push 0
push 0x30
push 0x54
call fcn.00404a50
mov dword [0x42307c], eax
push 0
push dword [0x42307c]
push 0xd
push str.ImgCurio.bmp
call fcn.00411d70
push eax
call fcn.00406350
mov eax, dword [0x42307c]
add eax, 0x20
mov dword [ebp - 8], eax
call fcn.00411e00
mov dword [0x423078], eax
mov dword [ebp - 0x14], 0x80000000
lea eax, [ebp - 0x14]
push eax
mov dword [ebp - 0x10], 0x80000000
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0xc], 0x80000000
lea eax, [ebp - 0xc]
push eax
push 0x423080
push 2
call fcn.00402a30
push 0
push 0
push 0x401ca0
call fcn.00412010
mov dword [ebp - 0x18], eax
cmp dword [0x41b128], 0
je 0x4021e6
mov dword [ebp - 0x1c], 0x10
jmp 0x4021ed
mov dword [ebp - 0x1c], 0xb
mov eax, dword [ebp - 0x1c]
mov dword [0x41b120], eax
cmp dword [0x41b128], 0
je 0x4022e0
call fcn.00411f50
fsub qword [0x421058]
fabs
fcomp qword [0x41b2a0]
fnstsw ax
test ah, 0x41
jne 0x402221
call fcn.00401c20
push dword [0x423078]
call fcn.00411e80
call fcn.00411f50
fstp qword [0x421058]
push 2
call sub.KERNEL32.dll_GetCurrentThread
push eax
call sub.KERNEL32.dll_SetThreadPriority
push 1
push 0xf
call fcn.00411ee0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
shl eax, 2
mov ebx, dword [ebp - 8]
add ebx, eax
mov eax, dword [ebx]
and eax, 0xff
shr eax, 4
neg eax
add eax, 0xf
mov ebx, eax
add ebx, dword [0x41b120]
add ebx, 0xfffffff0
mov dword [ebp - 0x24], ebx
cmp dword [ebp - 0x24], 0
jge 0x402289
mov dword [ebp - 0x24], 0
mov ebx, dword [ebp - 0x24]
cmp dword [0x4210b0], ebx
jle 0x4022b1
mov ebx, dword [0x4210b0]
and ebx, 1
test ebx, ebx
setg bl
shr ebx, 1
sbb ebx, ebx
and ebx, 0xff
mov dword [ebp - 0x28], ebx
jmp 0x4022b8
mov dword [ebp - 0x28], 0xff
mov bl, byte [ebp - 0x28]
mov eax, dword [ebp - 0x20]
mov byte [eax + 0x4210f8], bl
inc dword [ebp - 0x20]
cmp dword [ebp - 0x20], 0xfbf
jle 0x402254
push dword [0x423078]
call fcn.00411eb0
jmp 0x4023d2
push dword [0x423078]
call fcn.00411e80
push 1
push 0xf
call fcn.00411ee0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov ebx, dword [ebp - 0x20]
shl ebx, 2
mov eax, dword [ebp - 8]
add eax, ebx
mov ebx, dword [eax]
and ebx, 0xff
mov ecx, 0x11
mov eax, ebx
xor edx, edx
div ecx
mov ebx, eax
mov eax, ebx
mov dword [ebp - 0x2c], eax
inc dword [ebp - 0x20]
cmp dword [ebp - 0x2c], 0xf
jl 0x402343
mov eax, dword [ebp - 0x20]
mov byte [eax + 0x4210f8], 0
jmp 0x4023a4
cmp dword [ebp - 0x2c], 0
jg 0x402355
mov eax, dword [ebp - 0x20]
mov byte [eax + 0x4210f8], 0xff
jmp 0x4023a4
push dword [0x41b2a8]
call fcn.00412200
fimul dword [0x41b120]
sub esp, 4
fnstcw word [esp]
mov eax, dword [esp]
and eax, 0xf3ff
or eax, 0x400
push eax
fldcw word [esp]
add esp, 4
frndint
fldcw word [esp]
add esp, 4
sub esp, 4
fistp dword [esp]
pop eax
cmp eax, dword [ebp - 0x2c]
setg al
shr eax, 1
sbb eax, eax
mov bl, al
mov eax, dword [ebp - 0x20]
mov byte [eax + 0x4210f8], bl
inc dword [ebp - 0x28]
cmp dword [ebp - 0x28], 0x53
jle 0x402309
inc dword [ebp - 0x24]
cmp dword [ebp - 0x24], 0x2f
jle 0x402302
push dword [0x423078]
call fcn.00411eb0
push 1
push 1
call fcn.00411ee0
push 0
push 0xffffffffffffffff
call fcn.00412810
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x28]
push eax
call fcn.00412b30
push 0xffffffffffffffff
lea eax, [ebp - 0x28]
push eax
call fcn.00412b70
test eax, eax
jne 0x402404
lea eax, [ebp - 0x28]
push eax
call fcn.00412bc0
jmp 0x402783
mov eax, dword [ebp - 0x28]
movzx ebx, byte [eax]
mov dword [ebp - 0x2c], ebx
cmp dword [ebp - 0x2c], 0xff
jne 0x402422
mov ebx, dword [ebp - 0x28]
movzx eax, byte [ebx + 1]
neg eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0x30
jb 0x402569
cmp dword [ebp - 0x2c], 0x39
ja 0x402569
push 0
push dword [0x42307c]
push 0xc
mov eax, dword [ebp - 0x2c]
add eax, 0xffffffd0
mov ebx, eax
imul ebx, ebx, 0xc
lea eax, [ebx + str.Umbreon.bmp]
push eax
push 5
push 0x41b270
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
lea eax, [ebp - 0x38]
push eax
call fcn.00412c00
push eax
call fcn.00406350
mov eax, dword [0x42307c]
add eax, 0x20
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x54], 0
mov eax, dword [ebp - 0x54]
shl eax, 2
mov ebx, dword [ebp - 0x3c]
add ebx, eax
mov eax, dword [ebx]
and eax, 0xff
mov ebx, dword [ebp - 0x40]
add ebx, eax
mov ecx, ebx
mov dword [ebp - 0x40], ecx
inc dword [ebp - 0x54]
cmp dword [ebp - 0x54], 0xfbf
jle 0x402496
mov ecx, 0xfc0
mov eax, dword [ebp - 0x40]
cdq
idiv ecx
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
add ecx, 0xffffff80
push ecx
mov ecx, 0x11
pop eax
cdq
idiv ecx
mov ecx, eax
add ecx, 0x10
mov dword [0x41b12c], ecx
cmp dword [0x41b128], 0
je 0x4024f9
mov dword [ebp - 0x44], 0x10
jmp 0x402502
mov ecx, dword [0x41b12c]
mov dword [ebp - 0x44], ecx
mov ecx, dword [ebp - 0x44]
mov dword [0x41b120], ecx
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
mov ecx, dword [0x41b120]
add ecx, 0xfffffff0
mov eax, ecx
push eax
call fcn.00412d70
push eax
push 0xb
push str.Contrast:
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
lea eax, [ebp - 0x50]
push eax
call fcn.00412c00
push eax
push 0x40
push 0x4210b8
call fcn.00412af0
call fcn.00401c20
mov dword [0x41b11c], 0x78
jmp 0x402775
cmp dword [ebp - 0x2c], 0x2b
je 0x402575
cmp dword [ebp - 0x2c], 0x3d
jne 0x4025e1
cmp dword [0x41b120], 0x18
jge 0x4025dc
inc dword [0x41b120]
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
mov eax, dword [0x41b120]
add eax, 0xfffffff0
mov ecx, eax
push ecx
call fcn.00412d70
push eax
push 0xb
push str.Contrast:
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
lea eax, [ebp - 0x38]
push eax
call fcn.00412c00
push eax
push 0x40
push 0x4210b8
call fcn.00412af0
mov dword [0x41b11c], 0x78
call fcn.00401c20
jmp 0x402775
cmp dword [ebp - 0x2c], 0x2d
je 0x4025ed
cmp dword [ebp - 0x2c], 0x5f
jne 0x402659
cmp dword [0x41b120], 8
jle 0x402654
dec dword [0x41b120]
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
mov eax, dword [0x41b120]
add eax, 0xfffffff0
mov ecx, eax
push ecx
call fcn.00412d70
push eax
push 0xb
push str.Contrast:
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
lea eax, [ebp - 0x38]
push eax
call fcn.00412c00
push eax
push 0x40
push 0x4210b8
call fcn.00412af0
mov dword [0x41b11c], 0x78
call fcn.00401c20
jmp 0x402775
cmp dword [ebp - 0x2c], 9
jne 0x4026a6
xor dword [0x41b124], 1
cmp dword [0x41b124], 0
je 0x402689
push 0
push 0
push 0x17e
push 0x19d
call fcn.004018c0
call fcn.00401c20
jmp 0x4026a1
push 0
push 0
push 0xbf
push 0xcf
call fcn.004018c0
call fcn.00401c20
jmp 0x402775
cmp dword [ebp - 0x2c], 8
jne 0x402741
xor dword [0x41b128], 1
push 0
push 0xffffffffffffffff
cmp dword [0x41b128], 0
je 0x4026da
push 0
push 0xd
push str.PWM:_Perfect
push 0xffffffffffffffff
lea eax, [ebp - 0x38]
push eax
call fcn.00412b30
jmp 0x4026ee
push 0
push 0xc
push str.PWM:_Random
push 0xffffffffffffffff
lea eax, [ebp - 0x38]
push eax
call fcn.00412b30
lea eax, [ebp - 0x38]
push eax
push 0x40
push 0x4210b8
call fcn.00412af0
lea eax, [ebp - 0x38]
push eax
call fcn.00412bc0
call fcn.00401c20
mov dword [0x41b11c], 0x78
cmp dword [0x41b128], 0
je 0x402735
mov eax, dword [0x41b120]
mov dword [0x41b12c], eax
mov dword [0x41b120], 0x10
jmp 0x40273f
mov eax, dword [0x41b12c]
mov dword [0x41b120], eax
jmp 0x402775
cmp dword [ebp - 0x2c], 0x20
jne 0x40275a
xor dword [0x41b110], 1
mov dword [0x41b118], 1
jmp 0x402775
cmp dword [ebp - 0x2c], 0x1b
jne 0x402775
mov dword [0x41b114], 1
lea eax, [ebp - 0x28]
push eax
call fcn.00412bc0
jmp 0x402788
lea eax, [ebp - 0x28]
push eax
call fcn.00412bc0
jmp 0x4023d2
jmp 0x4021f5
push dword [ebp - 0x18]
call fcn.004120c0
push 0
call fcn.00411d60
mov eax, dword [ebp - 4]
pop ebx
mov esp, ebp
pop ebp
ret