Function at 0x46a26c
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x24
push esi
mov esi, ecx
cmp byte [esi + 4], 0
jne 0x46a281
mov eax, 0x70000005
pop esi
add esp, 0x24
ret 8
mov eax, dword [esi + 8]
cmp eax, 0x10
jne 0x46a2a6
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
push eax
push ecx
mov ecx, esi
call fcn.00469b99
mov eax, 0x6fffffff
pop esi
add esp, 0x24
ret 8
cdq
push ebx
and edx, 3
add eax, edx
push ebp
push edi
mov edi, eax
sar edi, 2
xor eax, eax
cmp edi, 4
je 0x46a2c4
cmp edi, 6
setne al
add eax, 1
shl eax, 5
test edi, edi
mov edx, dword [eax + 0x4a939c]
mov ebp, dword [eax + 0x4a93a4]
mov eax, dword [eax + 0x4a93ac]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x18], ebp
lea eax, [esi + 0x45c]
jle 0x46a348
lea ecx, [esi + 0x1f8]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x14], edi
movzx ebx, byte [ecx]
shl ebx, 0x18
mov dword [eax], ebx
movzx ebx, byte [ecx + 1]
add ecx, 1
shl ebx, 0x10
or dword [eax], ebx
add ecx, 1
xor ebx, ebx
mov bh, byte [ecx]
add ecx, 1
add ecx, 1
or dword [eax], ebx
movzx ebp, byte [ecx - 1]
or dword [eax], ebp
mov ebp, dword [esp + 0x10]
mov ebp, dword [ebp]
add dword [esp + 0x10], 4
mov ebx, eax
xor dword [ebx], ebp
add eax, 4
sub dword [esp + 0x14], 1
jne 0x46a301
mov ebp, dword [esp + 0x18]
mov eax, 1
cmp dword [esi + 0x3d8], eax
mov dword [esp + 0x1c], eax
jle 0x46a45b
lea eax, [esi + 0x218]
lea ebx, [esi + 0x43c]
mov dword [esp + 0x38], eax
test edi, edi
jle 0x46a41d
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov eax, ebp
mov ebp, dword [esp + 0x24]
sub eax, edx
sub ebp, edx
mov ecx, edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x10], edi
jmp 0x46a3a1
mov eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add eax, ecx
cdq
idiv edi
add ebx, 4
movzx eax, byte [esi + edx*4 + 0x45d]
mov dword [esp + 0x30], eax
lea eax, [ecx + ebp]
cdq
idiv edi
mov eax, dword [esp + 0x30]
mov ebp, dword [eax*4 + 0x4a7b70]
mov eax, ecx
add ecx, 1
mov edx, dword [esi + edx*4 + 0x45c]
and edx, 0xff
xor ebp, dword [edx*4 + 0x4a7f70]
cdq
idiv edi
movzx eax, byte [esi + edx*4 + 0x45e]
movzx edx, byte [ebx + 0x1f]
and eax, 0xff
xor ebp, dword [eax*4 + 0x4a7770]
mov eax, dword [esp + 0x14]
xor ebp, dword [edx*4 + 0x4a7370]
add eax, 4
xor ebp, dword [eax - 4]
sub dword [esp + 0x10], 1
mov dword [ebx - 4], ebp
mov dword [esp + 0x14], eax
jne 0x46a399
mov ebp, dword [esp + 0x18]
lea eax, [edi*4]
push eax
lea ebx, [esi + 0x43c]
lea eax, [esi + 0x45c]
push ebx
push eax
call fcn.00476e69
mov eax, dword [esp + 0x28]
add dword [esp + 0x44], 0x20
mov edx, dword [esp + 0x2c]
add eax, 1
add esp, 0xc
cmp eax, dword [esi + 0x3d8]
mov dword [esp + 0x1c], eax
jl 0x46a36d
test edi, edi
mov dword [esp + 0x38], 0
jle 0x46a53b
mov ecx, dword [esp + 0x3c]
lea eax, [esi + 0x45c]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x24]
sub edx, ebp
sub eax, ebp
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x3d8]
mov edx, dword [esp + 0x38]
lea eax, [edx + eax*8]
mov ebx, dword [esi + eax*4 + 0x1f8]
mov edx, dword [esp + 0x3c]
movzx eax, byte [edx + 3]
mov edx, ebx
sar edx, 0x18
xor dl, byte [eax + 0x4a6270]
mov eax, dword [esp + 0x30]
mov byte [ecx], dl
add eax, ebp
cdq
idiv edi
mov eax, ebx
sar eax, 0x10
add ecx, 1
add ecx, 1
add dword [esp + 0x3c], 4
add ecx, 1
add ecx, 1
movzx edx, byte [esi + edx*4 + 0x45e]
and edx, 0xff
xor al, byte [edx + 0x4a6270]
mov byte [ecx - 3], al
mov eax, ebp
cdq
idiv edi
mov eax, ebx
sar eax, 8
movzx edx, byte [esi + edx*4 + 0x45d]
xor al, byte [edx + 0x4a6270]
mov edx, dword [esp + 0x2c]
mov byte [ecx - 2], al
lea eax, [edx + ebp]
cdq
idiv edi
add ebp, 1
mov eax, dword [esi + edx*4 + 0x45c]
and eax, 0xff
movzx edx, byte [eax + 0x4a6270]
mov eax, dword [esp + 0x38]
xor dl, bl
add eax, 1
cmp eax, edi
mov byte [ecx - 1], dl
mov dword [esp + 0x38], eax
jl 0x46a489
pop edi
pop ebp
pop ebx
mov eax, 0x6fffffff
pop esi
add esp, 0x24
ret 8