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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4c492c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x18d4
call fcn.004a91d0
mov eax, dword [0x508e4c]
push ebx
xor eax, ebp
push esi
mov esi, dword [ebp + 0xc]
mov ebx, ecx
mov dword [esp + 0x18d8], eax
mov eax, dword [ebx + 0x88]
push edi
mov edi, dword [ebp + 8]
push eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x14], esi
mov dword [esi], eax
call fcn.004a7989
add esp, 4
test eax, eax
mov dword [edi], eax
jne 0x46bec5
xor al, al
jmp 0x46c2b0
mov ecx, dword [esi]
mov esi, dword [ebx + 0x84]
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 0xec]
test eax, eax
jne 0x46bf1e
mov edi, dword [esp + 0x10]
mov eax, dword [edi]
xor ecx, ecx
test eax, eax
jle 0x46c2ae
mov edx, dword [esp + 0x1c]
mov eax, dword [edx]
mov bl, byte [edi]
lea esi, [eax + ecx]
mov al, cl
mov dl, 0x21
imul dl
add al, bl
mov bl, byte [esi]
add al, 0x7a
xor bl, al
mov byte [esi], bl
mov eax, dword [edi]
inc ecx
cmp ecx, eax
jl 0x46bef7
jmp 0x46c2ae
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov edx, dword [esp + 0x1c]
mov edi, dword [edx]
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [ebx + 0xf0]
push eax
call fcn.004a7989
mov ecx, dword [ebx + 0xf0]
mov esi, dword [ebx + 0xec]
mov edx, ecx
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebx + 0xf0]
xor esi, esi
add esp, 4
xor ecx, ecx
cmp edi, esi
mov dword [esp + 0x24], eax
jle 0x46bfa9
jmp 0x46bf80
mov edx, dword [ebx + 0xec]
movzx edx, byte [edx + ecx]
lea edi, [esi + edi + 0x3f]
and edi, 0xff
xor edx, edi
mov byte [ecx + eax], dl
mov edi, dword [ebx + 0xf0]
inc ecx
add esi, 0x21
cmp ecx, edi
jl 0x46bf80
xor esi, esi
mov ecx, dword [ebx + 0xf0]
push ecx
push eax
call fcn.00474cc0
mov edi, eax
call fcn.004746b0
push esi
push esi
lea edx, [esp + 0x24]
push edx
push edi
mov dword [esp + 0x2c], eax
call fcn.00474c10
mov edx, eax
mov eax, dword [ebx + 0x84]
mov dword [esp + 0x28], eax
mov byte [esp + 0x10f0], 0
xor eax, eax
mov ecx, 0x1ff
lea edi, [esp + 0x10f1]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push edx
mov dword [esp + 0x30], edx
stosb byte es:[edi], al
call fcn.00474410
mov ecx, dword [ebx + 0x88]
mov edi, eax
mov eax, ecx
cdq
idiv edi
add ecx, edi
push ecx
mov dword [esp + 0x4c], edi
mov dword [esp + 0x48], eax
call fcn.004a7989
add esp, 0x20
lea ecx, [esp + 0x50]
mov dword [esp + 0x20], eax
xor ebx, ebx
call fcn.00471eb0
mov dword [esp + 0x18ec], esi
mov dword [esp + 0x10d4], 0xf
mov dword [esp + 0x10d0], esi
mov byte [esp + 0x10c0], bl
mov ecx, dword [esp + 0x24]
add ecx, 0x30
push 0x20
push ecx
lea ecx, [esp + 0x10c4]
mov byte [esp + 0x18f4], 1
call fcn.004016f0
cmp dword [esp + 0x10d4], 0x10
mov eax, dword [esp + 0x10c0]
jae 0x46c084
lea eax, [esp + 0x10c0]
push eax
lea ecx, [esp + 0x54]
call fcn.004721a0
mov edx, dword [esp + 0x14]
push edx
call fcn.00474410
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x2c]
add esp, 4
cmp eax, esi
mov dword [esp + 0x18], esi
jle 0x46c15a
mov esi, dword [esp + 0x10]
mov dword [esp + 0x10], esi
jmp 0x46c0c1
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
cdq
mov ecx, 0x30
idiv ecx
lea eax, [esp + 0x10d8]
test edx, edx
jne 0x46c0ec
mov edx, dword [esp + 0x14]
push 4
push edx
push eax
push esi
push edi
call fcn.00474450
add esp, 0x14
jmp 0x46c115
mov ecx, edi
mov edx, ecx
shr ecx, 2
lea edi, [esp + 0x10d8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x30]
push esi
push eax
lea ecx, [esp + 0x58]
call fcn.00471f40
lea eax, [esi - 0x2a]
mov edx, dword [esp + 0x20]
lea edi, [ebx + edx]
mov ecx, eax
mov edx, ecx
shr ecx, 2
lea esi, [esp + 0x10d8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x2c]
add ebx, eax
mov eax, dword [esp + 0x18]
add edx, ecx
mov ecx, dword [esp + 0x28]
inc eax
cmp eax, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], edx
jl 0x46c0b9
xor esi, esi
mov edi, 0xf
mov dword [esp + 0x10b8], edi
mov dword [esp + 0x10b4], esi
mov byte [esp + 0x10a4], 0
mov edx, dword [esp + 0x20]
push ebx
push edx
lea ecx, [esp + 0x10a8]
mov byte [esp + 0x18f4], 2
call fcn.004016f0
lea eax, [esp + 0x10a0]
push eax
lea ecx, [esp + 0x38]
push ecx
call fcn.0046a7a0
add esp, 8
push 0xffffffffffffffff
push esi
push eax
lea ecx, [esp + 0x10ac]
mov byte [esp + 0x18f8], 3
call fcn.00401280
mov eax, dword [esp + 0x4c]
mov ebx, 0x10
cmp eax, ebx
jb 0x46c1d6
mov edx, dword [esp + 0x38]
push edx
call fcn.004a7e92
add esp, 4
cmp dword [esp + 0x10b8], ebx
mov dword [esp + 0x48], esi
mov esi, dword [esp + 0x10a4]
mov dword [esp + 0x4c], edi
mov byte [esp + 0x38], 0
jae 0x46c1fa
lea esi, [esp + 0x10a4]
mov ecx, dword [esp + 0x10b4]
mov eax, dword [esp + 0x1c]
mov edi, dword [eax]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x14]
push eax
call fcn.004742c0
mov ecx, dword [esp + 0x28]
push ecx
call fcn.004a8b23
mov eax, dword [esp + 0x10c0]
mov ebx, 0x10
add esp, 8
cmp eax, ebx
jb 0x46c24c
mov edx, dword [esp + 0x10a4]
push edx
call fcn.004a7e92
add esp, 4
mov eax, dword [esp + 0x10d4]
xor edi, edi
cmp eax, ebx
mov esi, 0xf
mov dword [esp + 0x10b8], esi
mov dword [esp + 0x10b4], edi
mov byte [esp + 0x10a4], 0
jb 0x46c284
mov eax, dword [esp + 0x10c0]
push eax
call fcn.004a7e92
add esp, 4
lea ecx, [esp + 0x50]
mov dword [esp + 0x10d4], esi
mov dword [esp + 0x10d0], edi
mov byte [esp + 0x10c0], 0
mov dword [esp + 0x18ec], 0xffffffff
call fcn.0046ea90
mov al, 1
mov ecx, dword [esp + 0x18e4]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x18dc]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004a8b15
mov esp, ebp
pop ebp
ret 8