Function at 0x4066e9
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.00405ee7
mov ecx, esi
call fcn.004060ca
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 + 0x407570]
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 0x406734
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 0x406760
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 0x406781
push 0x70
lea ecx, [esi + 0x244]
pop edx
imul eax, dword [ecx], 9
lea ecx, [ecx + 4]
add edi, eax
sub edx, 1
jne 0x406797
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, 0x407150
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 0x4067c8
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 + 0x407270]
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 0x406810
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 0x406881
push 2
pop edi
jmp 0x406891
cmp edi, ecx
jae 0x4068e8
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.00405f8c
pop ecx
cmp edi, 2
jne 0x4068ae
mov edx, ebx
mov ecx, esi
call fcn.004061df
cmp byte [ebp + 0x14], 0
mov ecx, ebx
je 0x4068c7
mov eax, dword [ebp + 0xc]
push eax
push esi
mov esi, dword [ebp - 8]
mov edx, esi
call fcn.00406506
jmp 0x4068db
push dword [ebp + 8]
lea eax, [esi + 0x497ac]
mov esi, dword [ebp - 8]
push eax
mov edx, esi
call fcn.004062e4
pop ecx
pop ecx
mov edx, esi
mov ecx, ebx
call fcn.0040660d
jmp 0x4068f9
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0xc]
push edx
mov edx, dword [ebp + 8]
call fcn.0040669b
pop ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret