Function at 0x408150
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
mov ebx, ecx
push esi
push edi
test ebx, ebx
jne 0x408169
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0xc984], 0xffffffff
jle 0x40817e
mov eax, 0xfffffff6
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test edx, edx
lea edi, [ebx + 0x11fb0]
mov eax, 0x4a3d10
mov ecx, 0x62
cmovne eax, edx
mov edx, 0x40
mov esi, eax
mov dword [ebp - 0x28], eax
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebx + 0x12138]
lea esi, [ebx + 0x12838]
lea edi, [ebx + 0x9a0]
lea eax, [edi - 0x80]
mov dword [ecx - 0x11e14], edi
mov dword [ecx - 0x11e18], eax
lea ecx, [ecx + 0x18]
mov dword [ecx - 0x14], esi
lea eax, [esi - 0x100]
mov dword [ecx - 0x18], eax
lea eax, [edi + 0x80]
mov dword [ecx - 0x11e28], eax
lea eax, [esi + 0x100]
mov dword [ecx - 0x10], eax
lea eax, [edi + 0x100]
mov dword [ecx - 0x11e24], eax
lea eax, [esi + 0x200]
mov dword [ecx - 0xc], eax
lea eax, [edi + 0x180]
mov dword [ecx - 0x11e20], eax
lea eax, [esi + 0x300]
mov dword [ecx - 8], eax
lea eax, [edi + 0x200]
mov dword [ecx - 0x11e1c], eax
add edi, 0x300
lea eax, [esi + 0x400]
add esi, 0x600
mov dword [ecx - 4], eax
sub edx, 1
jne 0x4081b1
mov esi, dword [ebp - 0x28]
lea edi, [ebx + 0x320]
push esi
lea edx, [ebx + 0x12138]
mov dword [ebp - 0x24], edi
mov ecx, edi
call fcn.004125f0
movups xmm0, xmmword [esi + 0x100]
mov eax, dword [ebx + 0x30]
lea edx, [ebx + 0x2a738]
add esp, 4
movups xmmword [ebx + 0xc920], xmm0
movups xmm0, xmmword [esi + 0x110]
lea eax, [eax + eax*2]
lea ecx, [eax*2 + 0x4a4820]
movups xmmword [ebx + 0xc930], xmm0
mov dword [ebp - 0x28], ecx
movups xmm0, xmmword [esi + 0x120]
movups xmmword [ebx + 0xc940], xmm0
movups xmm0, xmmword [esi + 0x130]
mov esi, 0x4a48c0
mov dword [ebp - 4], esi
movups xmmword [ebx + 0xc950], xmm0
nop dword [eax + eax]
mov dword [ebp - 0x1c], edx
mov eax, edi
mov dword [ebp - 0x20], 0x40
nop dword [eax]
xorps xmm0, xmm0
mov dword [ebp - 0x14], ecx
movlpd qword [ebp - 0x30], xmm0
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 0x30]
mov dword [ebp - 8], eax
mov dword [ebp - 0x18], 3
mov dword [ebp - 0xc], ecx
mov edx, dword [eax]
xor ebx, ebx
xor ecx, ecx
mov dword [ebp - 0x2c], edx
mov edi, esi
nop dword [eax]
movzx eax, byte [ecx + 0x4a44c0]
lea edi, [edi + 2]
inc ecx
movzx esi, word [edx + eax*2]
movzx edx, word [edi - 2]
mov eax, esi
shr eax, 1
add eax, edx
xor edx, edx
div esi
mov edx, dword [ebp - 0x2c]
imul eax, eax
add ebx, eax
cmp ecx, 0x40
jl 0x4082f0
mov esi, dword [ebp - 0x14]
movzx eax, word [esi]
cdq
push edx
push eax
push 0
push ebx
call fcn.00495780
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
add ebx, eax
mov eax, dword [ebp - 8]
adc ecx, edx
mov dword [ebp - 0xc], ebx
add esi, 2
mov dword [ebp - 0x10], ecx
add eax, 8
mov dword [ebp - 0x14], esi
sub dword [ebp - 0x18], 1
mov esi, dword [ebp - 4]
mov dword [ebp - 8], eax
jne 0x4082e1
test ecx, ecx
jg 0x408364
jl 0x40835d
test ebx, ebx
jne 0x408364
or eax, 0xffffffff
or edx, eax
jmp 0x40836e
push ecx
push ebx
call fcn.00411aa0
add esp, 8
mov esi, dword [ebp - 4]
xor ecx, ecx
sub ecx, eax
mov eax, 0x60000000
sbb eax, edx
mov edx, dword [ebp - 0x1c]
shrd ecx, eax, 1
sar eax, 1
mov dword [edx], ecx
mov ecx, dword [ebp - 0x28]
mov dword [edx + 4], eax
add edx, 8
sub dword [ebp - 0x20], 1
mov eax, dword [ebp - 8]
mov dword [ebp - 0x1c], edx
jne 0x4082c0
mov edi, dword [ebp - 0x24]
sub esi, 0xffffff80
add edi, 4
mov dword [ebp - 4], esi
mov dword [ebp - 0x24], edi
cmp esi, 0x4a49c0
jl 0x4082b0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret