Function at 0x6a76a9
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
and dword [ebp - 0x28], 0
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov esi, ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x20], esi
mov eax, dword [edi]
mov dword [ebp - 0xc], eax
mov al, byte [ecx + 0x15]
test al, al
jg 0x6a78f0
mov cl, byte [ecx + 0x14]
jne 0x6a76e1
test cl, cl
jns 0x6a78f0
mov eax, dword [edi + 4]
xor ebx, ebx
mov dword [ebp - 0x30], eax
test eax, eax
je 0x6a78ec
mov eax, dword [ebp + 0x14]
add eax, 0x795
mov dword [ebp - 0x34], eax
mov edx, dword [ebp + 0xc]
mov ecx, esi
push eax
call fcn.006dc39a
pop ecx
test eax, eax
js 0x6a78e5
xor dword [ebp - 0x28], eax
jne 0x6a78b8
mov ecx, dword [ebp + 0x10]
lea edi, [ebx - 2]
and dword [ebp - 0x1c], 0
lea esi, [edi + 1]
and dword [ebp - 8], 0
and dword [ebp - 4], 0
imul esi, dword [ecx + 8]
imul edi, dword [ecx + 8]
push 8
pop eax
mov dword [ebp - 0x14], eax
mov eax, dword [ecx + 8]
add esi, dword [ecx + 0xc]
add edi, dword [ecx + 0xc]
imul eax, ebx
mov dword [ebp - 0x18], esi
add eax, dword [ecx + 0xc]
mov dword [ebp - 0x24], eax
test ebx, ebx
je 0x6a779d
movzx edx, byte [esi]
mov eax, dword [ebp - 0xc]
shl edx, 8
inc esi
mov dword [ebp - 8], edx
mov dword [ebp - 0x18], esi
cmp eax, 8
jbe 0x6a7779
movzx eax, byte [esi]
or edx, eax
mov eax, dword [ebp - 0xc]
inc esi
mov dword [ebp - 8], edx
mov dword [ebp - 0x18], esi
cmp ebx, 1
jbe 0x6a779d
movzx ecx, byte [edi]
shl ecx, 8
inc edi
mov dword [ebp - 4], ecx
cmp eax, 8
jbe 0x6a779d
movzx eax, byte [edi]
or ecx, eax
inc edi
xor eax, eax
mov dword [ebp - 4], ecx
mov dword [ebp - 0x10], eax
jmp 0x6a77ab
xor eax, eax
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0xc], eax
je 0x6a78c3
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0xc], 0
je 0x6a77cb
mov ecx, dword [ecx + 0x10]
mov edx, eax
push ebx
call fcn.0068175c
pop ecx
test eax, eax
je 0x6a77c8
xor ecx, ecx
jmp 0x6a782c
mov ecx, dword [ebp + 8]
movsx eax, byte [ecx + 0x15]
movsx edx, byte [ecx + 0x14]
add eax, ebx
add edx, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x10]
push eax
call fcn.0068175c
mov edx, dword [ebp - 8]
mov esi, eax
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x1c]
and ecx, 0x1e000
shr edx, 5
and eax, 7
and edx, 0x1f00
shl esi, 3
or edx, ecx
shr edx, 4
or esi, edx
mov edx, dword [ebp + 0xc]
or esi, eax
mov eax, dword [ebp + 0x14]
add eax, esi
mov esi, dword [ebp - 0x20]
push eax
mov ecx, esi
call fcn.006dc39a
pop ecx
pop ecx
mov ecx, eax
test ecx, ecx
js 0x6a78d7
mov esi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 8]
add eax, eax
shl dword [ebp - 4], 1
or eax, ecx
mov ecx, dword [ebp - 0x14]
add edx, edx
dec ecx
mov dword [ebp - 0x1c], eax
shl al, cl
mov dword [ebp - 0x14], ecx
cmp dword [ebp - 0x14], 0
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 8], edx
mov byte [ecx], al
jne 0x6a788a
push 8
pop eax
mov dword [ebp - 0x14], eax
inc ecx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x24], ecx
add eax, 9
mov ecx, dword [ebp - 0xc]
cmp eax, ecx
jae 0x6a788d
test ebx, ebx
je 0x6a788d
movzx eax, byte [esi]
or edx, eax
inc esi
mov dword [ebp - 8], edx
mov dword [ebp - 0x18], esi
cmp ebx, 1
jbe 0x6a788d
movzx eax, byte [edi]
or dword [ebp - 4], eax
inc edi
jmp 0x6a788d
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x10], eax
cmp eax, ecx
jb 0x6a77ab
mov eax, dword [ebp - 0x14]
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp + 0x10]
cmp eax, 8
je 0x6a78c9
mov ecx, eax
mov eax, dword [ebp - 0x1c]
shl al, cl
mov ecx, dword [ebp - 0x24]
mov byte [ecx], al
jmp 0x6a78c9
mov edx, ebx
mov ecx, edi
call fcn.006a6fb4
jmp 0x6a78c9
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp + 0x10]
inc ebx
cmp ebx, dword [ebp - 0x30]
jae 0x6a78ec
mov eax, dword [ebp - 0x34]
jmp 0x6a76fc
push str.failed_to_decode_arithmetic_code_when_handling_generic_template1_TPGDON2
mov eax, dword [ebp - 0x2c]
push dword [eax]
push 2
jmp 0x6a78f9
push str.failed_to_decode_arithmetic_code_when_handling_generic_template1_TPGDON1
jmp 0x6a78dc
xor eax, eax
jmp 0x6a7902
push str.adaptive_template_pixel_is_out_of_field
push dword [edx]
push 3
push esi
call fcn.00630eb2
add esp, 0x10
pop edi
pop esi
pop ebx
leave
ret