Function at 0x524480
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, ecx
xor ecx, ecx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x34], eax
mov edx, dword [eax]
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x30], ecx
cmp dword [eax + 0x10], ecx
jle 0x524a2c
push ebx
push edi
mov eax, dword [eax + 0x18]
mov edi, edx
lea edx, [edx + eax*4]
mov eax, dword [edi]
dec eax
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x24], eax
test eax, eax
jle 0x524a0f
mov eax, dword [edi + 4]
add edi, 4
mov dword [ebp - 0x10], eax
xor ebx, ebx
mov eax, dword [ebp - 0x34]
mov dword [ebp - 8], ebx
mov edx, dword [eax + 8]
add edx, ecx
mov ecx, dword [esi]
mov eax, dword [ecx + 0xc]
imul eax, edx
sub edx, dword [esi + 0x10]
add eax, dword [ecx]
mov ecx, dword [esi + 4]
mov dword [esi + 0x14], eax
mov eax, edx
cdq
idiv dword [ecx + 0x18]
imul edx, dword [ecx + 0xc]
add edx, dword [ecx]
sub dword [ebp - 0x24], 1
mov ecx, dword [ebp - 0x10]
mov dword [esi + 0x18], edx
js 0x52486b
mov eax, dword [edi + 4]
add edi, 8
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x18], edi
mov eax, dword [edi]
mov dword [ebp - 0x28], eax
cdq
and edx, 0xff
lea ebx, [edx + eax]
mov eax, ecx
cdq
and edx, 0xff
sar ebx, 8
mov dword [ebp - 0xc], ebx
lea edi, [edx + eax]
sar edi, 8
mov dword [ebp - 0x1c], edi
cmp ebx, edi
jne 0x52454f
mov eax, dword [ebp - 0x28]
mov ebx, dword [ebp - 8]
sub eax, ecx
imul eax, dword [ebp - 0x20]
add ebx, eax
mov eax, dword [ebp - 0x28]
jmp 0x524859
movzx eax, cl
mov ecx, 0x100
sub ecx, eax
imul ecx, dword [ebp - 0x20]
add ecx, dword [ebp - 8]
mov eax, ecx
cdq
and edx, 0xff
lea ecx, [edx + eax]
sar ecx, 8
test ecx, ecx
jle 0x524702
mov eax, dword [esi]
mov ebx, dword [esi + 0x14]
mov eax, dword [eax + 0x10]
imul eax, edi
add eax, ebx
mov ebx, dword [esi + 8]
mov dword [ebp - 8], eax
mov eax, edi
sub eax, dword [esi + 0xc]
cdq
cmp ecx, 0xff
jl 0x52464b
mov ecx, dword [esi + 4]
idiv dword [ecx + 0x14]
mov edi, edx
mov edx, 0x100
imul edi, dword [ecx + 0x10]
add edi, dword [esi + 0x18]
movzx ecx, byte [edi + 1]
or ecx, 0xff0000
movzx esi, byte [edi + 2]
imul ecx, ebx
shl esi, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
mov eax, dword [ebp - 8]
movzx eax, byte [eax + 1]
imul eax, edx
shr eax, 8
add eax, ecx
mov dword [ebp - 0x10], eax
movzx eax, byte [edi]
or esi, eax
imul esi, ebx
mov ebx, dword [ebp - 8]
movzx ecx, byte [ebx + 2]
movzx eax, byte [ebx]
shl ecx, 0x10
or ecx, eax
shr esi, 8
imul ecx, edx
and esi, 0xff00ff
mov edx, dword [ebp - 0x10]
shr ecx, 8
and ecx, 0xff00ff
add esi, ecx
mov ecx, 0x100
mov eax, esi
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, edx
shr eax, 8
or ecx, esi
neg al
and ecx, 0xff00ff
or al, dl
mov byte [ebx], cl
mov byte [ebx + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [ebx + 2], al
jmp 0x5246f9
imul ebx, ecx
mov ecx, dword [esi + 4]
idiv dword [ecx + 0x14]
sar ebx, 8
mov edi, edx
mov dword [ebp - 0x10], ebx
imul edi, dword [ecx + 0x10]
mov edx, 0x100
add edi, dword [esi + 0x18]
movzx ecx, byte [edi + 1]
or ecx, 0xff0000
movzx esi, byte [edi + 2]
imul ecx, ebx
shl esi, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
mov eax, dword [ebp - 8]
movzx ebx, byte [eax + 1]
movzx eax, byte [edi]
mov edi, dword [ebp - 8]
or esi, eax
imul esi, dword [ebp - 0x10]
imul ebx, edx
movzx eax, byte [edi]
shr esi, 8
shr ebx, 8
and esi, 0xff00ff
add ebx, ecx
movzx ecx, byte [edi + 2]
shl ecx, 0x10
or ecx, eax
imul ecx, edx
shr ecx, 8
and ecx, 0xff00ff
add esi, ecx
mov ecx, 0x100
mov eax, esi
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, ebx
shr eax, 8
or ecx, esi
neg al
and ecx, 0xff00ff
or al, bl
mov byte [edi], cl
mov byte [edi + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [edi + 2], al
mov esi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
test edx, edx
jle 0x52484d
inc edi
sub ebx, edi
mov dword [ebp - 0xc], ebx
test ebx, ebx
jle 0x52484d
mov eax, dword [esi]
mov eax, dword [eax + 0x10]
mov ecx, eax
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 8]
imul ecx, edi
sub edi, dword [esi + 0xc]
imul eax, edx
add ecx, dword [esi + 0x14]
sar eax, 8
mov dword [ebp - 8], eax
cmp eax, 0xfe
jge 0x524810
mov esi, dword [esi + 4]
mov eax, edi
cdq
inc edi
mov dword [ebp - 0x1c], edi
idiv dword [esi + 0x14]
mov ebx, dword [esi + 0x10]
mov esi, 0x100
mov eax, dword [ebp - 0x14]
imul ebx, edx
add ebx, dword [eax + 0x18]
movzx edx, byte [ebx + 1]
or edx, 0xff0000
movzx edi, byte [ebx + 2]
imul edx, dword [ebp - 8]
shl edi, 0x10
shr edx, 8
and edx, 0xff00ff
mov eax, edx
shr eax, 0x10
sub esi, eax
movzx eax, byte [ecx + 1]
imul eax, esi
shr eax, 8
add eax, edx
movzx edx, byte [ecx + 2]
mov dword [ebp - 0x38], eax
movzx eax, byte [ebx]
or edi, eax
mov ebx, dword [ebp - 0x38]
movzx eax, byte [ecx]
imul edi, dword [ebp - 8]
shl edx, 0x10
or edx, eax
imul edx, esi
mov esi, dword [ebp - 0x14]
shr edi, 8
and edi, 0xff00ff
shr edx, 8
and edx, 0xff00ff
add edi, edx
mov edx, 0x100
mov eax, edi
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, ebx
shr eax, 8
or edx, edi
mov edi, dword [ebp - 0x1c]
neg al
or al, bl
and edx, 0xff00ff
mov byte [ecx + 1], al
mov eax, edx
shr eax, 0x10
mov byte [ecx + 2], al
mov eax, dword [ebp - 0xc]
dec eax
mov byte [ecx], dl
add ecx, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
test eax, eax
jg 0x524745
jmp 0x52484a
mov esi, dword [esi + 4]
mov eax, edi
cdq
dec ebx
inc edi
idiv dword [esi + 0x14]
mov esi, dword [esi + 0x10]
mov eax, dword [ebp - 0x14]
imul esi, edx
add esi, dword [eax + 0x18]
mov ax, word [esi]
mov dl, byte [esi + 2]
mov esi, dword [ebp - 0x14]
mov word [ebp - 4], ax
movzx eax, al
mov byte [ecx], al
movzx eax, byte [ebp - 3]
mov byte [ecx + 1], al
mov byte [ecx + 2], dl
add ecx, dword [ebp - 0x10]
test ebx, ebx
jg 0x524810
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x14]
movzx ebx, al
imul ebx, edx
sub dword [ebp - 0x24], 1
mov ecx, eax
mov edi, dword [ebp - 0x18]
mov dword [ebp - 8], ebx
jns 0x524502
mov eax, ebx
cdq
and edx, 0xff
lea edi, [edx + eax]
sar edi, 8
test edi, edi
jle 0x524a0c
mov ebx, dword [esi + 0x14]
mov eax, ecx
mov ecx, dword [esi]
cdq
and edx, 0xff
add edx, eax
mov eax, dword [ecx + 0x10]
mov ecx, dword [esi + 4]
sar edx, 8
imul eax, edx
sub edx, dword [esi + 0xc]
add eax, ebx
mov ebx, dword [esi + 8]
mov dword [ebp - 0xc], eax
mov eax, edx
cdq
idiv dword [ecx + 0x14]
cmp edi, 0xff
jl 0x524964
mov edi, edx
mov edx, 0x100
imul edi, dword [ecx + 0x10]
add edi, dword [esi + 0x18]
movzx ecx, byte [edi + 1]
or ecx, 0xff0000
movzx esi, byte [edi + 2]
imul ecx, ebx
shl esi, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax + 1]
imul eax, edx
shr eax, 8
add eax, ecx
mov dword [ebp - 0x18], eax
movzx eax, byte [edi]
or esi, eax
imul esi, ebx
mov ebx, dword [ebp - 0xc]
movzx ecx, byte [ebx + 2]
movzx eax, byte [ebx]
shl ecx, 0x10
or ecx, eax
shr esi, 8
imul ecx, edx
and esi, 0xff00ff
mov edx, dword [ebp - 0x18]
shr ecx, 8
and ecx, 0xff00ff
add esi, ecx
mov ecx, 0x100
mov eax, esi
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, edx
shr eax, 8
or ecx, esi
neg al
and ecx, 0xff00ff
or al, dl
mov byte [ebx], cl
mov byte [ebx + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [ebx + 2], al
jmp 0x524a0c
imul ebx, edi
mov edi, edx
imul edi, dword [ecx + 0x10]
mov edx, 0x100
sar ebx, 8
add edi, dword [esi + 0x18]
mov dword [ebp - 0x18], ebx
movzx ecx, byte [edi + 1]
or ecx, 0xff0000
movzx esi, byte [edi + 2]
imul ecx, ebx
shl esi, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
mov eax, dword [ebp - 0xc]
movzx ebx, byte [eax + 1]
movzx eax, byte [edi]
mov edi, dword [ebp - 0xc]
or esi, eax
imul esi, dword [ebp - 0x18]
imul ebx, edx
movzx eax, byte [edi]
shr esi, 8
shr ebx, 8
and esi, 0xff00ff
add ebx, ecx
movzx ecx, byte [edi + 2]
shl ecx, 0x10
or ecx, eax
imul ecx, edx
shr ecx, 8
and ecx, 0xff00ff
add esi, ecx
mov ecx, 0x100
mov eax, esi
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, ebx
shr eax, 8
or ecx, esi
neg al
and ecx, 0xff00ff
or al, bl
mov byte [edi], cl
mov byte [edi + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [edi + 2], al
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x30]
mov esi, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x30], eax
cmp eax, dword [ecx + 0x10]
mov ecx, eax
mov eax, dword [ebp - 0x34]
jl 0x5244a4
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 4