Function at 0x406334
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0xc], edx
push edi
xor edi, edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x14], edi
inc dword [esi + 0x404]
lea eax, [esi + 0x504]
lea ecx, [esi + 4]
mov dword [ebp - 8], eax
mov edx, eax
call fcn.00405b32
mov ecx, esi
call fcn.00405d15
imul ebx, dword [esi + 0x97a4], 3
lea eax, [esi + 0x91f0]
mov dword [ebp - 4], eax
add ebx, 0xe
xor edx, edx
movzx eax, byte [edx + 0x407580]
movzx ecx, byte [esi + edx + 0x923c]
add ecx, eax
mov eax, dword [ebp - 4]
imul ecx, dword [eax]
add eax, 4
mov dword [ebp - 4], eax
add ebx, ecx
inc edx
cmp edx, 0x13
jb 0x40637f
lea edx, [esi + 4]
xor ecx, ecx
mov edi, edx
movzx eax, byte [esi + ecx + 0xa04]
imul eax, dword [edi]
lea edi, [edi + 4]
add ebx, eax
inc ecx
cmp ecx, 0x100
jb 0x4063ab
mov edi, dword [ebp - 0x14]
mov ecx, 0x90
mov eax, dword [edx]
lea edx, [edx + 4]
lea edi, [edi + eax*8]
sub ecx, 1
jne 0x4063cc
push 0x70
lea ecx, [esi + 0x244]
pop edx
imul eax, dword [ecx], 9
lea ecx, [ecx + 4]
add edi, eax
sub edx, 1
jne 0x4063e2
movzx eax, byte [esi + 0xb04]
mov edx, 0x101
add ebx, eax
add edi, 7
lea eax, [esi + 0x408]
mov dword [ebp - 4], eax
mov eax, 0x407140
sub eax, edx
mov dword [ebp - 0x14], eax
movzx ecx, byte [eax + edx]
movzx eax, byte [esi + edx + 0xa04]
mov esi, dword [ebp - 4]
add eax, ecx
imul eax, dword [esi]
mov esi, dword [ebp - 0x10]
add ebx, eax
movzx eax, byte [esi + edx + 0x1044]
add eax, ecx
mov ecx, dword [ebp - 4]
imul eax, dword [ecx]
add ecx, 4
mov dword [ebp - 4], ecx
add edi, eax
mov eax, dword [ebp - 0x14]
inc edx
cmp edx, 0x11e
jb 0x406413
lea eax, [esi + 0x484]
xor edx, edx
mov dword [ebp - 4], eax
movzx eax, byte [esi + edx + 0xb24]
mov esi, dword [ebp - 4]
movzx ecx, byte [edx + 0x407260]
add eax, ecx
imul eax, dword [esi]
add ebx, eax
lea eax, [ecx + 5]
mov ecx, esi
mov esi, dword [ebp - 0x10]
imul eax, dword [ecx]
add ecx, 4
mov dword [ebp - 4], ecx
add edi, eax
inc edx
cmp edx, 0x1e
jb 0x40645b
mov eax, dword [ebp - 0xc]
xor edx, edx
push 0xfffffffffffffffd
pop ecx
mov dword [ebp - 0x14], 0xffff
sub ecx, dword [eax + 4]
mov eax, dword [ebp + 0xc]
and ecx, 7
add eax, 0xfffe
div dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
dec eax
imul eax, eax, 5
add eax, edx
lea ecx, [ecx + eax*8]
add ecx, 0x20
cmp edi, ecx
mov eax, ecx
cmovbe eax, edi
cmp ebx, eax
jae 0x4064cc
push 2
pop edi
jmp 0x4064dc
cmp edi, ecx
jae 0x406533
xor edi, edi
lea eax, [esi + 0xb44]
inc edi
mov dword [ebp - 8], eax
mov ebx, dword [ebp - 0xc]
mov ecx, ebx
mov dl, byte [ebp + 0x10]
push edi
call fcn.00405bd7
pop ecx
cmp edi, 2
jne 0x4064f9
mov edx, ebx
mov ecx, esi
call fcn.00405e2a
cmp byte [ebp + 0x14], 0
mov ecx, ebx
je 0x406512
mov eax, dword [ebp + 0xc]
push eax
push esi
mov esi, dword [ebp - 8]
mov edx, esi
call fcn.00406151
jmp 0x406526
push dword [ebp + 8]
lea eax, [esi + 0x497ac]
mov esi, dword [ebp - 8]
push eax
mov edx, esi
call fcn.00405f2f
pop ecx
pop ecx
mov edx, esi
mov ecx, ebx
call fcn.00406258
jmp 0x406544
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0xc]
push edx
mov edx, dword [ebp + 8]
call fcn.004062e6
pop ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret