Function at 0x8019304
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [ebp + 0x1c]
and dword [ebp - 0x64], 0
mov dword [ebp - 8], eax
mov eax, dword [ecx + 0x74]
push edi
mov edi, dword [ebp + 0x14]
cmp edi, 1
mov dword [ebp - 0x28], eax
mov eax, dword [ecx + 0x78]
mov dword [ebp - 0x10], ecx
mov ecx, dword [ecx + 0x90]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x4c], ecx
jl 0x8019b39
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
add ebx, 2
add eax, edi
test ecx, ecx
push esi
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x68], eax
je 0x801936a
xor eax, eax
inc eax
sub eax, dword [ebp + 0x10]
mov byte [ebp + 0x17], 1
cdq
idiv dword [ebp - 0x18]
mov byte [ebp - 1], 1
lea esi, [edi + 2]
mov dword [ebp - 0x24], edx
jmp 0x80193b3
mov eax, dword [ebp + 0x24]
mov ecx, dword [ebp - 0x18]
lea esi, [edi + eax - 1]
mov eax, dword [ebp + 0x10]
cdq
idiv ecx
mov eax, dword [ebp - 0x68]
mov dword [ebp - 0x1c], esi
test edx, edx
setne byte [ebp - 1]
cdq
idiv ecx
test edx, edx
setne byte [ebp + 0x17]
cmp byte [ebp - 1], 0
je 0x80193a7
mov eax, dword [ebp + 0x10]
neg eax
cdq
idiv ecx
inc esi
mov dword [ebp - 0x1c], esi
inc edx
mov dword [ebp - 0x24], edx
jmp 0x80193ac
mov edx, ecx
mov dword [ebp - 0x24], ecx
cmp byte [ebp + 0x17], 0
je 0x80193b6
inc esi
mov dword [ebp - 0x1c], esi
test edx, edx
jg 0x80193c0
add edx, dword [ebp - 0x18]
mov dword [ebp - 0x24], edx
cmp edx, esi
jle 0x80193c7
mov dword [ebp - 0x24], esi
lea eax, [esi + 2]
imul eax, ebx
push eax
push dword [ebp + 8]
call fcn.080192d6
mov eax, dword [ebp + 8]
mov eax, dword [eax]
dec edi
imul edi, dword [ebp + 0xc]
add edi, eax
inc esi
imul esi, ebx
pop ecx
add esi, eax
cmp byte [ebp + 0x17], 0
pop ecx
je 0x80193f8
lea eax, [ebx + ebx]
sub esi, ebx
push eax
jmp 0x80193f9
push ebx
push 0
push esi
call sub.MSVCR80.dll_memset
mov eax, dword [ebp - 0x68]
add esp, 0xc
sub esi, ebx
dec eax
mov dword [ebp + 0x14], eax
jmp 0x8019450
push dword [ebp + 0xc]
lea eax, [esi + 1]
push edi
push eax
mov byte [esi], 0
call sub.MSVCR80.dll_memcpy
sub edi, dword [ebp + 0xc]
mov byte [ebx + esi - 1], 0
add esp, 0xc
sub esi, ebx
cmp dword [ebp - 0x4c], 0
jne 0x801944a
mov eax, dword [ebp + 0x14]
cdq
idiv dword [ebp - 0x18]
test edx, edx
jne 0x801944a
push ebx
push edx
push esi
call sub.MSVCR80.dll_memset
add esp, 0xc
sub esi, ebx
dec dword [ebp + 0x14]
mov eax, dword [ebp + 0x14]
cmp eax, dword [ebp + 0x10]
jge 0x801940f
cmp dword [ebp - 0x4c], 0
jne 0x8019461
cmp byte [ebp - 1], 0
je 0x8019472
lea eax, [ebx + ebx]
push eax
push 0
sub esi, ebx
push esi
call sub.MSVCR80.dll_memset
add esp, 0xc
mov eax, dword [ebp + 8]
mov eax, dword [eax]
add eax, ebx
cmp dword [ebp + 0x28], 0x20
push 2
mov dword [ebp - 0x3c], eax
pop ebx
jne 0x80194cd
cmp byte [ebp + 0x2c], 0
mov dword [ebp - 0x34], 1
je 0x80194c8
cmp dword [ebp - 0x28], 6
je 0x80194a3
push str.unsupported_XRatio_for_ColorDDR
call fcn.0809d433
pop ecx
mov esi, dword [ebp + 0x20]
imul esi, dword [ebp + 0x24]
mov edi, dword [ebp + 0x1c]
shl esi, 2
push esi
push 0
push edi
mov dword [ebp - 0x38], ebx
call sub.MSVCR80.dll_memset
lea eax, [esi + edi - 4]
add esp, 0xc
mov dword [ebp - 0x64], eax
jmp 0x80194d8
mov eax, dword [ebp - 0x28]
jmp 0x80194d5
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x34], ebx
add eax, eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp - 0x28]
cdq
idiv ecx
xor edi, edi
cmp edx, edi
mov dword [ebp + 0xc], edx
jge 0x80194ed
add dword [ebp + 0xc], ecx
mov esi, dword [ebp + 0x34]
cmp dword [esi], edi
mov dword [ebp - 0x14], edi
je 0x8019508
cmp dword [ebp + 0x28], 0x20
je 0x8019510
push str.Downsample_filter_pad_requires_32_bit_pixel_format
call fcn.0809d433
pop ecx
xor edi, edi
cmp dword [ebp + 0x28], 0x20
jne 0x8019548
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
sub eax, dword [ecx + 0x8c]
mov edx, dword [esi]
mov esi, eax
sub esi, edx
js 0x8019528
mov eax, esi
jmp 0x801952e
sub eax, edx
sub eax, dword [ecx + 0x74]
inc eax
mov ecx, dword [ecx + 0x74]
cdq
idiv ecx
mov edx, eax
mov eax, dword [ebp + 0xc]
imul edx, ecx
sub eax, edx
cdq
idiv dword [ebp - 0x38]
mov dword [ebp + 0xc], edx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x28]
push 4
pop esi
sub eax, esi
mov dword [ebp - 0x50], ebx
je 0x801962f
sub eax, ebx
je 0x80195d9
sub eax, ebx
je 0x801956b
push str.unsupported_grid_ratio
jmp 0x8019627
cmp dword [ebp + 0xc], edi
jne 0x8019579
mov dword [ebp + 0xc], 0x10
jmp 0x801957d
add dword [ebp + 0xc], 8
mov eax, dword [ebp + 0xc]
shl eax, 0xa
add eax, 0x81a1250
cmp dword [ebp - 0x18], edi
mov dword [ebp - 0x2c], eax
jle 0x80195bb
cmp dword [ebp - 0x18], ebx
jle 0x80195ab
cmp dword [ebp - 0x18], 8
jne 0x80195bb
mov dword [ebp - 0x44], 0x81a5678
mov dword [ebp - 0x40], 0x81a56c0
jmp 0x80195c6
mov dword [ebp - 0x44], 0x81a5650
mov dword [ebp - 0x40], 0x81a5664
jmp 0x80195c6
push str.unsupported_anisotropic_ratio
call fcn.0809d433
pop ecx
mov dword [ebp + 0x14], 0x7f
mov dword [ebp - 0x30], 7
jmp 0x8019672
cmp byte [ebp + 0x2c], 0
je 0x8019622
mov eax, dword [ebp + 0xc]
shl eax, 0xa
add eax, 0x819f650
cmp dword [ebp + 0xc], edi
mov dword [ebp - 0x2c], eax
jne 0x80195fa
dec dword [ebp - 0x14]
push 3
pop eax
jmp 0x80195fc
mov eax, esi
cmp eax, dword [ebp - 0x14]
jle 0x801960c
sub eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x50], eax
jmp 0x8019612
sub dword [ebp - 0x14], eax
mov dword [ebp - 0x50], edi
mov dword [ebp + 0x14], 0x3f
mov dword [ebp - 0x30], 6
jmp 0x8019672
push str.unsupported_grid_ratio__6_
call fcn.0809d433
pop ecx
jmp 0x8019672
cmp dword [ebp - 0x18], esi
je 0x801963f
push str.unsupported_anisotropic_ratio
call fcn.0809d433
pop ecx
cmp dword [ebp + 0xc], 0
jne 0x8019648
mov dword [ebp + 0xc], esi
mov eax, dword [ebp + 0xc]
shl eax, 0xa
add eax, 0x819fe50
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x44], 0x81a5650
mov dword [ebp - 0x40], 0x81a5664
mov dword [ebp + 0x14], 0x1f
mov dword [ebp - 0x30], 5
cmp dword [ebp + 0x24], 0
jle 0x8019a9e
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x74], eax
cmp dword [ebp + 0x28], 0x20
mov edi, dword [ebp - 0x48]
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x60], edi
mov dword [ebp + 8], eax
jne 0x80196a0
cmp byte [ebp + 0x2c], 0
je 0x80196a0
shl eax, 2
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x50]
xor esi, esi
cmp ecx, esi
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x70], esi
mov dword [ebp - 0x6c], esi
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x5c], eax
je 0x80196d5
lea eax, [ecx + 2]
cdq
push 3
pop ebx
idiv ebx
add eax, ecx
add dword [ebp - 8], eax
sub dword [ebp + 8], eax
cmp edi, esi
je 0x801992e
xor eax, eax
inc eax
sub eax, edi
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x24]
dec dword [ebp - 0x60]
mov dword [ebp - 0x68], eax
xor eax, eax
cmp dword [ebp - 0x28], 8
mov dword [ebp + 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp + 0x18], eax
jne 0x801970c
mov eax, dword [ebp - 0x20]
shl eax, 0xa
add eax, 0x81a1250
jmp 0x801971d
cmp dword [ebp - 0x28], 4
jne 0x8019720
mov eax, dword [ebp - 0x20]
shl eax, 0xa
add eax, 0x819fe50
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x5c]
mov esi, dword [ebp + 0x10]
movzx edx, byte [ecx]
movzx eax, byte [ecx - 1]
movzx edi, byte [ecx + 1]
mov ebx, dword [ebp - 0x2c]
shr edi, 7
shl eax, 6
or eax, edx
add eax, eax
or eax, edi
mov edi, edx
shr edi, 1
or eax, edi
mov dword [ebp + 0x10], edx
not dword [ebp + 0x10]
mov edi, dword [ebp + 0x10]
and edi, eax
and edi, 0xff
add esi, dword [ebx + edi*4]
mov edi, dword [ebp - 0x48]
lea ebx, [ecx + edi]
mov edi, dword [ebp - 0x78]
movzx ecx, byte [ecx + edi - 1]
movzx edi, byte [ebx]
or ecx, edi
mov edi, dword [ebp + 0x18]
not eax
and ecx, eax
and ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x2c]
add edi, dword [eax + edx*4]
mov dword [ebp - 0x7c], ebx
mov ebx, dword [ebp - 0xc]
add ebx, dword [eax + ecx*4]
dec dword [ebp - 0x68]
mov ecx, dword [ebp - 0x7c]
mov dword [ebp - 0xc], ebx
mov dword [ebp + 0x18], edi
jne 0x8019726
add dword [ebp - 0x20], 8
add edi, dword [ebp - 0x58]
add ebx, dword [ebp - 0x6c]
add esi, dword [ebp - 0x70]
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x38]
mov dword [ebp + 0x18], edi
mov dword [ebp - 0xc], ebx
mov dword [ebp + 0x10], esi
jl 0x801990e
mov eax, dword [ebp + 8]
mov esi, dword [ebp - 8]
neg eax
mov dword [ebp + 0x18], eax
mov eax, dword [ebp - 0x34]
neg eax
mov dword [ebp - 0x68], eax
xor eax, eax
cmp dword [ebp + 8], eax
jle 0x80198f3
cmp dword [ebp - 0x54], eax
jle 0x80197f1
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
sub dword [ebp - 0x54], eax
imul ecx, eax
shr edi, cl
shr ebx, cl
shr dword [ebp + 0x10], cl
jmp 0x80198f3
cmp dword [ebp + 0x28], 4
jne 0x801980c
cmp edi, eax
jne 0x801980c
cmp ebx, eax
jne 0x801980c
cmp dword [ebp + 0x10], eax
jne 0x801980c
mov byte [esi], 0
jmp 0x80198e6
mov ecx, dword [ebp - 0x30]
mov eax, edi
and eax, dword [ebp + 0x14]
shr edi, cl
mov dword [ebp - 0x58], eax
mov eax, ebx
and eax, dword [ebp + 0x14]
shr ebx, cl
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
and eax, dword [ebp + 0x14]
shr dword [ebp + 0x10], cl
cmp dword [ebp + 0x28], 0x20
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
jne 0x801989f
cmp byte [ebp + 0x2c], 0
push eax
push dword [ebp - 8]
push dword [ebp - 0x58]
je 0x801988e
call fcn.08018d7d
mov ecx, dword [ebp + 0x18]
and ecx, 3
jne 0x801985b
dec dword [ebp + 8]
inc dword [ebp + 0x18]
inc esi
jmp 0x801985c
dec ecx
mov edx, esi
sub edx, ecx
shl ecx, 6
add ecx, eax
mov eax, dword [ebp + 0x34]
imul ecx, ecx, 0xc
add ecx, dword [eax + 4]
dec edx
mov eax, dword [ecx]
test eax, eax
je 0x8019878
add dword [edx - 4], eax
mov eax, dword [ecx + 4]
add dword [edx], eax
mov ecx, dword [ecx + 8]
test ecx, ecx
je 0x80198e6
cmp edx, dword [ebp - 0x64]
jae 0x80198e6
add dword [edx + 4], ecx
jmp 0x80198e6
call fcn.08086158
mov byte [esi], 0
inc esi
mov byte [esi], al
inc esi
mov byte [esi], al
inc esi
jmp 0x80198e4
mov eax, dword [ebp + 0x10]
and eax, dword [ebp + 0x14]
push eax
mov eax, ebx
and eax, dword [ebp + 0x14]
push eax
mov eax, edi
and eax, dword [ebp + 0x14]
push eax
call fcn.08086158
push dword [ebp - 0xc]
mov ecx, dword [ebp - 0x30]
push dword [ebp - 8]
shr dword [ebp + 0x10], cl
push dword [ebp - 0x58]
shr edi, cl
shr ebx, cl
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x7c], eax
call fcn.08086158
mov ecx, dword [ebp - 0x40]
mov al, byte [eax + ecx]
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x7c]
or al, byte [edx + ecx]
mov byte [esi], al
mov eax, dword [ebp - 0x34]
sub dword [ebp + 8], eax
mov eax, dword [ebp - 0x68]
inc esi
sub dword [ebp + 0x18], eax
mov eax, dword [ebp - 0x38]
sub dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], eax
jge 0x80197c9
mov dword [ebp - 8], esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0xc], ebx
mov dword [ebp + 0x18], edi
inc dword [ebp - 0x5c]
cmp dword [ebp + 8], 0
mov dword [ebp - 0x58], edi
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x70], esi
jle 0x8019a61
cmp dword [ebp - 0x60], 0
jne 0x80196e5
mov eax, dword [ebp + 8]
test eax, eax
jle 0x8019a61
neg eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x34]
neg eax
mov dword [ebp - 0x68], eax
cmp dword [ebp + 0x28], 4
jne 0x8019969
cmp dword [ebp + 0x18], 0
jne 0x8019969
cmp dword [ebp - 0xc], 0
jne 0x8019969
cmp dword [ebp + 0x10], 0
jne 0x8019969
mov eax, dword [ebp - 8]
mov byte [eax], 0
jmp 0x8019a47
mov ecx, dword [ebp - 0x30]
mov esi, dword [ebp + 0x18]
mov edi, dword [ebp - 0xc]
mov ebx, dword [ebp + 0x10]
shr dword [ebp + 0x18], cl
shr dword [ebp - 0xc], cl
shr dword [ebp + 0x10], cl
and esi, dword [ebp + 0x14]
and edi, dword [ebp + 0x14]
and ebx, dword [ebp + 0x14]
cmp dword [ebp + 0x28], 0x20
mov ecx, dword [ebp - 0x10]
jne 0x80199ff
cmp byte [ebp + 0x2c], 0
push ebx
push edi
push esi
je 0x80199e5
call fcn.08018d7d
mov ecx, dword [ebp - 0x20]
and ecx, 3
jne 0x80199b1
dec dword [ebp + 8]
inc dword [ebp - 0x20]
inc dword [ebp - 8]
jmp 0x80199b2
dec ecx
mov edx, dword [ebp - 8]
sub edx, ecx
shl ecx, 6
add ecx, eax
mov eax, dword [ebp + 0x34]
imul ecx, ecx, 0xc
add ecx, dword [eax + 4]
dec edx
mov eax, dword [ecx]
test eax, eax
je 0x80199cf
add dword [edx - 4], eax
mov eax, dword [ecx + 4]
add dword [edx], eax
mov ecx, dword [ecx + 8]
test ecx, ecx
je 0x8019a47
cmp edx, dword [ebp - 0x64]
jae 0x8019a47
add dword [edx + 4], ecx
jmp 0x8019a47
call fcn.08086158
mov ecx, dword [ebp - 8]
mov byte [ecx], 0xff
inc ecx
mov byte [ecx], al
inc ecx
mov byte [ecx], al
inc ecx
mov byte [ecx], al
inc ecx
mov dword [ebp - 8], ecx
jmp 0x8019a4a
mov eax, dword [ebp + 0x10]
and eax, dword [ebp + 0x14]
push eax
mov eax, dword [ebp - 0xc]
and eax, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x18]
and eax, dword [ebp + 0x14]
push eax
call fcn.08086158
mov ecx, dword [ebp - 0x30]
shr dword [ebp + 0x18], cl
shr dword [ebp - 0xc], cl
shr dword [ebp + 0x10], cl
mov ecx, dword [ebp - 0x10]
push ebx
push edi
push esi
mov dword [ebp - 0x7c], eax
call fcn.08086158
mov ecx, dword [ebp - 0x40]
mov al, byte [eax + ecx]
mov ecx, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x44]
or al, byte [ecx + edx]
mov ecx, dword [ebp - 8]
mov byte [ecx], al
inc dword [ebp - 8]
mov eax, dword [ebp + 8]
sub eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x68]
sub dword [ebp - 0x20], ecx
test eax, eax
mov dword [ebp + 8], eax
jg 0x8019946
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x48]
mov edx, ecx
imul edx, eax
add dword [ebp - 0x3c], edx
cmp dword [ebp - 0x4c], 0
jne 0x8019a78
add dword [ebp - 0x3c], eax
sub dword [ebp - 0x1c], ecx
cmp dword [ebp - 0x4c], 0
jne 0x8019a84
dec dword [ebp - 0x1c]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
jle 0x8019a95
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
dec dword [ebp - 0x74]
jne 0x8019682
cmp dword [ebp + 0x28], 0x20
jne 0x8019b37
cmp byte [ebp + 0x2c], 0
mov ecx, dword [ebp + 0x1c]
je 0x8019abf
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp + 0x34]
mov eax, dword [eax + 0x78]
mov esi, dword [edx + 8]
jmp 0x8019ac8
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x78]
mov esi, dword [edx + 0x74]
imul esi, eax
cmp eax, 1
jne 0x8019ad2
add esi, esi
mov eax, esi
cdq
sub eax, edx
mov edi, eax
mov eax, dword [ebp + 0x24]
sar edi, 1
test eax, eax
jle 0x8019b37
mov dword [ebp + 0x2c], eax
cmp dword [ebp + 0x20], 0
jle 0x8019b32
mov ebx, dword [ebp + 0x20]
cmp dword [ecx], 0
jne 0x8019af8
add ecx, 4
jmp 0x8019b2f
mov byte [ecx], 0xff
inc ecx
movzx eax, byte [ecx]
imul eax, eax, 0xff
add eax, edi
cdq
idiv esi
mov byte [ecx], al
inc ecx
movzx eax, byte [ecx]
imul eax, eax, 0xff
add eax, edi
cdq
idiv esi
mov byte [ecx], al
inc ecx
movzx eax, byte [ecx]
imul eax, eax, 0xff
add eax, edi
cdq
idiv esi
mov byte [ecx], al
inc ecx
dec ebx
jne 0x8019aee
dec dword [ebp + 0x2c]
jne 0x8019ae5
pop esi
pop ebx
pop edi
leave
ret 0x30