Function at 0x520400
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x30
mov dword [ebp - 8], 0
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
and eax, 7
mov dword [ebp - 0x10], eax
cmp dword [ebp + 0xc], 4
ja 0x520429
mov eax, 0
jmp 0x5206a7
add dword [ebp + 0x10], 5
mov dword [ebp - 0xc], 0xffffffff
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
lea edx, [eax - 4]
mov eax, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x20], eax
jmp 0x520468
mov eax, dword [ebp - 0x14]
mov al, byte [eax]
and eax, 0xff
and eax, 0xfe
cmp eax, 0xe8
je 0x520472
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jb 0x52044f
jmp 0x520473
nop
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
mov ecx, edx
sub ecx, eax
mov eax, ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jae 0x520670
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov ebx, edx
sub ebx, eax
mov eax, ebx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 3
jbe 0x5204ac
mov dword [ebp - 0x10], 0
jmp 0x520523
mov eax, dword [ebp - 0xc]
dec eax
mov edx, dword [ebp - 0x10]
mov ebx, edx
mov cl, al
shl ebx, cl
mov eax, ebx
and eax, 7
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x520523
mov eax, dword [ebp - 0x10]
add eax, 0x7ab6c8
mov al, byte [eax]
and eax, 0xff
mov edx, 4
mov ecx, edx
sub ecx, eax
mov eax, ecx
mov edx, eax
mov eax, dword [ebp - 0x14]
add eax, edx
mov al, byte [eax]
mov byte [ebp - 0x21], al
mov eax, dword [ebp - 0x10]
add eax, 0x7ab6c0
mov al, byte [eax]
test al, al
je 0x520507
cmp byte [ebp - 0x21], 0
je 0x520507
cmp byte [ebp - 0x21], 0xff
jne 0x520523
mov eax, dword [ebp - 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
add eax, eax
and eax, 6
or eax, 1
mov dword [ebp - 0x10], eax
inc dword [ebp - 8]
jmp 0x52066b
mov eax, dword [ebp - 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x14]
add eax, 4
mov al, byte [eax]
test al, al
je 0x520545
mov eax, dword [ebp - 0x14]
add eax, 4
mov al, byte [eax]
cmp al, 0xff
jne 0x520655
mov eax, dword [ebp - 0x14]
add eax, 4
mov al, byte [eax]
and eax, 0xff
mov edx, eax
shl edx, 0x18
mov eax, dword [ebp - 0x14]
add eax, 3
mov al, byte [eax]
and eax, 0xff
shl eax, 0x10
or edx, eax
mov eax, dword [ebp - 0x14]
add eax, 2
mov al, byte [eax]
and eax, 0xff
shl eax, 8
or edx, eax
mov eax, dword [ebp - 0x14]
inc eax
mov al, byte [eax]
and eax, 0xff
or eax, edx
mov dword [ebp - 0x18], eax
cmp dword [ebp + 0x18], 0
je 0x5205a3
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0x10]
add edx, eax
mov eax, dword [ebp - 0x18]
add eax, edx
mov dword [ebp - 0x1c], eax
jmp 0x5205b3
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0x10]
add edx, eax
mov eax, dword [ebp - 0x18]
sub eax, edx
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x10], 0
je 0x520611
mov eax, dword [ebp - 0x10]
add eax, 0x7ab6c8
mov al, byte [eax]
and eax, 0xff
shl eax, 3
mov dword [ebp - 0x28], eax
mov eax, 0x18
sub eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0x1c]
mov ebx, edx
mov cl, al
shr ebx, cl
mov eax, ebx
mov byte [ebp - 0x29], al
cmp byte [ebp - 0x29], 0
je 0x5205f0
cmp byte [ebp - 0x29], 0xff
jne 0x520614
mov eax, 0x20
sub eax, dword [ebp - 0x28]
mov edx, 1
mov ebx, edx
mov cl, al
shl ebx, cl
mov eax, ebx
dec eax
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
jmp 0x52058b
nop
jmp 0x520615
nop
mov eax, dword [ebp - 0x14]
add eax, 4
mov edx, dword [ebp - 0x1c]
shr edx, 0x18
and edx, 1
neg edx
mov byte [eax], dl
mov eax, dword [ebp - 0x14]
lea edx, [eax + 3]
mov eax, dword [ebp - 0x1c]
shr eax, 0x10
mov byte [edx], al
mov eax, dword [ebp - 0x14]
lea edx, [eax + 2]
mov eax, dword [ebp - 0x1c]
shr eax, 8
mov byte [edx], al
mov eax, dword [ebp - 0x14]
lea edx, [eax + 1]
mov eax, dword [ebp - 0x1c]
mov byte [edx], al
add dword [ebp - 8], 5
jmp 0x52066b
mov eax, dword [ebp - 0x10]
add eax, eax
and eax, 6
or eax, 1
mov dword [ebp - 0x10], eax
inc dword [ebp - 8]
jmp 0x520434
jmp 0x520434
nop
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
mov ecx, edx
sub ecx, eax
mov eax, ecx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 3
ja 0x52069a
mov eax, dword [ebp - 0xc]
dec eax
mov edx, dword [ebp - 0x10]
mov ebx, edx
mov cl, al
shl ebx, cl
mov eax, ebx
and eax, 7
jmp 0x52069f
mov eax, 0
mov edx, dword [ebp + 0x14]
mov dword [edx], eax
mov eax, dword [ebp - 8]
add esp, 0x30
pop ebx
pop ebp
ret