Function at 0x507430
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov eax, 8
call fcn.004a72f0
cmp dword [esp + 0x2c], 0
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
push ebx
push ebp
push esi
mov esi, dword [eax]
push edi
je 0x50754e
test ecx, ecx
je 0x507639
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x34]
sub ebx, edx
mov dword [esp + 0x24], ebx
lea ecx, [ecx]
dec ecx
mov dword [esp + 0x34], ecx
test esi, esi
jne 0x507523
movzx edx, byte [edi + 1]
movzx ecx, byte [edi]
movzx eax, byte [edi + 6]
movzx ebp, byte [edi + 5]
shl edx, 8
or ecx, edx
movzx edx, byte [edi + 2]
shl edx, 0x10
or ecx, edx
movzx edx, byte [edi + 3]
shl edx, 0x18
or ecx, edx
movzx edx, byte [edi + 4]
mov dword [esp + 0x10], ecx
movzx ecx, byte [edi + 7]
shl ecx, 8
or ecx, eax
mov eax, dword [esp + 0x28]
shl ecx, 0x10
shl ebp, 8
or edx, ebp
or ecx, edx
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x30]
push ecx
push edx
push eax
lea ecx, [esp + 0x1c]
push ecx
call fcn.00506850
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x34]
mov byte [edi], cl
mov edx, ecx
shr edx, 8
mov byte [edi + 1], dl
mov edx, ecx
shr edx, 0x10
mov byte [edi + 2], dl
shr ecx, 0x18
mov byte [edi + 3], cl
mov ecx, dword [esp + 0x24]
mov edx, ecx
shr edx, 8
mov byte [edi + 4], cl
mov byte [edi + 5], dl
mov edx, ecx
shr edx, 0x10
add esp, 0x10
shr ecx, 0x18
mov byte [edi + 6], dl
mov edx, dword [esp + 0x20]
mov byte [edi + 7], cl
mov ecx, dword [esp + 0x34]
mov al, byte [ebx + edx]
xor al, byte [esi + edi]
inc esi
mov byte [edx], al
mov byte [esi + edi - 1], al
inc edx
and esi, 7
mov dword [esp + 0x20], edx
test ecx, ecx
jne 0x507470
mov eax, dword [esp + 0x38]
pop edi
mov dword [eax], esi
pop esi
pop ebp
pop ebx
add esp, 8
ret
test ecx, ecx
je 0x507639
mov edi, dword [esp + 0x34]
lea ebx, [ebx]
dec ecx
mov dword [esp + 0x34], ecx
test esi, esi
jne 0x50760b
movzx edx, byte [edi + 1]
movzx ecx, byte [edi]
movzx eax, byte [edi + 6]
movzx ebp, byte [edi + 5]
shl edx, 8
or ecx, edx
movzx edx, byte [edi + 2]
shl edx, 0x10
or ecx, edx
movzx edx, byte [edi + 3]
shl edx, 0x18
or ecx, edx
movzx edx, byte [edi + 4]
mov dword [esp + 0x10], ecx
movzx ecx, byte [edi + 7]
shl ecx, 8
or ecx, eax
mov eax, dword [esp + 0x28]
shl ecx, 0x10
shl ebp, 8
or edx, ebp
or ecx, edx
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x30]
push ecx
push edx
push eax
lea ecx, [esp + 0x1c]
push ecx
call fcn.00506850
mov ecx, dword [esp + 0x20]
mov byte [edi], cl
mov edx, ecx
shr edx, 8
mov byte [edi + 1], dl
mov edx, ecx
shr edx, 0x10
mov byte [edi + 2], dl
shr ecx, 0x18
mov byte [edi + 3], cl
mov ecx, dword [esp + 0x24]
mov edx, ecx
mov byte [edi + 4], cl
shr edx, 8
mov byte [edi + 5], dl
mov edx, ecx
shr edx, 0x10
add esp, 0x10
shr ecx, 0x18
mov byte [edi + 6], dl
mov byte [edi + 7], cl
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x1c]
mov al, byte [edx]
inc edx
mov dword [esp + 0x1c], edx
mov dl, byte [esi + edi]
mov byte [esi + edi], al
xor al, dl
mov edx, dword [esp + 0x20]
inc esi
mov byte [edx], al
inc edx
and esi, 7
mov dword [esp + 0x20], edx
test ecx, ecx
jne 0x507560
mov eax, dword [esp + 0x38]
pop edi
mov dword [eax], esi
pop esi
pop ebp
pop ebx
add esp, 8
ret