Function at 0x525990
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, ecx
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], eax
cmp dword [eax + 0x10], 0
mov edx, dword [eax]
jle 0x525bab
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov eax, dword [eax + 0x18]
mov ecx, edx
mov esi, dword [ecx]
lea edx, [edx + eax*4]
dec esi
mov dword [ebp - 8], edx
test esi, esi
jle 0x525b93
mov eax, dword [ecx + 4]
add ecx, 4
mov dword [ebp - 0x18], eax
xor edi, edi
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebx]
mov edx, dword [eax + 8]
add edx, dword [ebp - 0xc]
mov eax, dword [ecx + 0xc]
imul eax, edx
sub edx, dword [ebx + 0x10]
add eax, dword [ecx]
mov ecx, dword [ebx + 4]
mov dword [ebx + 0x14], eax
mov eax, edx
cdq
idiv dword [ecx + 0x18]
imul edx, dword [ecx + 0xc]
add edx, dword [ecx]
sub esi, 1
mov ecx, dword [ebp - 0x18]
mov dword [ebx + 0x18], edx
mov dword [ebp - 0x1c], esi
js 0x525b33
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 4]
add edx, 8
mov dword [ebp - 4], eax
mov dword [ebp - 0x14], edx
mov eax, dword [edx]
mov dword [ebp - 0x18], eax
cdq
and edx, 0xff
lea esi, [edx + eax]
mov eax, ecx
cdq
and edx, 0xff
sar esi, 8
lea ebx, [edx + eax]
sar ebx, 8
cmp esi, ebx
jne 0x525a58
mov edx, dword [ebp - 0x18]
mov eax, edx
sub eax, ecx
imul eax, dword [ebp - 4]
add edi, eax
jmp 0x525b24
movzx eax, cl
mov ecx, 0x100
sub ecx, eax
imul ecx, dword [ebp - 4]
lea eax, [edi + ecx]
cdq
and edx, 0xff
add edx, eax
sar edx, 8
test edx, edx
jle 0x525ab8
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov edi, dword [eax + 0x10]
mov eax, dword [ecx + 0x14]
imul edi, ebx
add edi, eax
mov eax, dword [ecx + 8]
mov ecx, 0x100
cmp edx, 0xff
jge 0x525a9f
imul eax, edx
sar eax, 8
inc eax
imul edx, eax, 0xff
movzx eax, byte [edi]
shr edx, 8
sub ecx, edx
imul ecx, eax
sar ecx, 8
add cl, dl
mov byte [edi], cl
mov edi, dword [ebp - 4]
test edi, edi
jle 0x525b1a
inc ebx
sub esi, ebx
test esi, esi
jle 0x525b1a
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov edx, dword [eax + 0x10]
mov eax, edx
imul eax, ebx
add eax, dword [ecx + 0x14]
mov ecx, dword [ecx + 8]
imul ecx, edi
sar ecx, 8
cmp ecx, 0xfe
jge 0x525b10
inc ecx
mov edi, 0x100
imul ebx, ecx, 0xff
shr ebx, 8
sub edi, ebx
movzx ecx, byte [eax]
dec esi
imul ecx, edi
sar ecx, 8
add cl, bl
mov byte [eax], cl
add eax, edx
test esi, esi
jg 0x525af8
jmp 0x525b1a
mov byte [eax], 0xff
dec esi
add eax, edx
test esi, esi
jg 0x525b10
mov edx, dword [ebp - 0x18]
movzx edi, dl
imul edi, dword [ebp - 4]
sub dword [ebp - 0x1c], 1
mov ecx, edx
jns 0x525a12
mov ebx, dword [ebp + 8]
mov eax, edi
cdq
and edx, 0xff
lea edi, [edx + eax]
sar edi, 8
test edi, edi
jle 0x525b90
mov eax, ecx
mov ecx, dword [ebx]
cdq
and edx, 0xff
add eax, edx
mov esi, dword [ecx + 0x10]
mov ecx, dword [ebx + 0x14]
sar eax, 8
imul esi, eax
mov eax, dword [ebx + 8]
add esi, ecx
mov ecx, 0x100
cmp edi, 0xff
jge 0x525b77
imul eax, edi
sar eax, 8
inc eax
imul edx, eax, 0xff
movzx eax, byte [esi]
shr edx, 8
sub ecx, edx
imul ecx, eax
sar ecx, 8
add cl, dl
mov byte [esi], cl
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, dword [ecx + 0x10]
mov eax, ecx
jl 0x5259b4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4