Function at 0x50ca50
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x24
mov ebp, dword [ecx]
mov esi, ecx
test ebp, ebp
je 0x50cb17
mov edi, dword [esi + 4]
mov ecx, dword [esi + 8]
cmp ecx, edi
jae 0x50cb17
movzx eax, byte [ebp + ecx]
cmp eax, 0x49
je 0x50cb2e
cmp eax, 0x42
jne 0x50cb17
lea ebx, [ecx + 1]
mov dword [esp], esi
cmp ebx, edi
mov dword [esi + 8], ebx
jae 0x50cbc4
cmp byte [ebp + ebx], 0x5f
jne 0x50cbc4
lea eax, [ecx + 2]
xor edx, edx
mov dword [esi + 8], eax
xor esi, esi
cmp esi, ecx
sbb edx, 0
jae 0x50cc68
mov edi, dword [esp]
mov eax, dword [edi + 0xc]
inc eax
cmp eax, 0x1f4
ja 0x50ccb3
cmp dword [edi + 0x10], 0
je 0x50cccd
movsd xmm0, qword [edi]
movsd xmm1, qword [edi + 8]
mov ecx, edi
mov dword [edi + 8], esi
mov dword [edi + 0xc], eax
movsd qword [esp + 0x1c], xmm1
movsd qword [esp + 0x14], xmm0
call fcn.0050ca50
movsd xmm0, qword [esp + 0x14]
movsd xmm1, qword [esp + 0x1c]
mov ebx, eax
cmp al, 2
movsd qword [edi], xmm0
movsd qword [edi + 8], xmm1
jne 0x50cb24
jmp 0x50ccac
mov ecx, esi
xor edx, edx
call fcn.0050b8c0
mov ebx, eax
add bl, bl
mov eax, ebx
add esp, 0x24
pop esi
pop edi
pop ebx
pop ebp
ret
inc ecx
xor edx, edx
mov dword [esi + 8], ecx
mov ecx, esi
call fcn.0050b8c0
test al, al
jne 0x50ccac
mov eax, dword [esi + 0x10]
test eax, eax
je 0x50cb62
push eax
push 1
push 0x60a490
call fcn.00541d00
add esp, 0xc
test al, al
jne 0x50ccac
mov eax, dword [esi]
mov bl, 1
test eax, eax
je 0x50cb24
xor edi, edi
nop dword [eax]
mov ecx, dword [esi + 8]
cmp ecx, dword [esi + 4]
jae 0x50cb86
test eax, eax
je 0x50cb86
cmp byte [eax + ecx], 0x45
je 0x50ccd4
sub edi, 1
jb 0x50cbaa
mov eax, dword [esi + 0x10]
test eax, eax
je 0x50cbaa
push eax
push 2
push 0x60a48a
call fcn.00541d00
add esp, 0xc
test al, al
jne 0x50ccac
mov ecx, esi
call fcn.0050c000
test al, al
jne 0x50ccac
mov eax, dword [esi]
test eax, eax
jne 0x50cb70
jmp 0x50cb24
xor esi, esi
xor edx, edx
mov dword [esp + 0xc], ecx
nop dword [eax]
mov al, 1
cmp ebx, edi
mov dword [esp + 8], eax
jae 0x50cc6e
movzx eax, byte [ebp + ebx]
cmp al, 0x5f
je 0x50cc4a
mov ecx, eax
add cl, 0xd0
cmp cl, 0xa
jb 0x50cc0d
mov ecx, eax
add cl, 0x9f
cmp cl, 0x1a
jae 0x50cbff
add al, 0xa9
jmp 0x50cc0b
mov ecx, eax
add cl, 0xbf
cmp cl, 0x1a
jae 0x50cc6e
add al, 0xe3
mov ecx, eax
mov eax, dword [esp]
inc ebx
mov dword [eax + 8], ebx
mov eax, edx
mov edx, 0x3e
mul edx
mov edx, 0x3e
mov dword [esp + 0x10], eax
mov eax, esi
seto byte [esp + 7]
mul edx
add edx, dword [esp + 0x10]
setb ch
or ch, byte [esp + 7]
jne 0x50cc6e
mov esi, eax
movzx ecx, cl
add esi, ecx
adc edx, 0
jae 0x50cbd0
jmp 0x50cc6e
mov eax, dword [esp]
inc ebx
add esi, 1
adc edx, 0
mov dword [eax + 8], ebx
jb 0x50cc6e
mov ecx, dword [esp + 0xc]
cmp esi, ecx
sbb edx, 0
jb 0x50cab9
mov al, 1
mov dword [esp + 8], eax
mov edi, dword [esp]
xor ecx, ecx
mov eax, dword [edi + 0x10]
test eax, eax
je 0x50ccc4
mov ebx, dword [esp + 8]
mov esi, ecx
mov edx, 0x60a461
mov ecx, 0x60a448
test bl, bl
cmovne ecx, edx
xor bl, 1
movzx edx, bl
lea edx, [edx + edx*8]
or edx, 0x10
push eax
push edx
push ecx
call fcn.00541d00
mov ecx, esi
add esp, 0xc
test al, al
je 0x50ccc4
mov bl, 2
jmp 0x50cb24
mov cl, 1
mov dword [esp + 8], 0
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x50cc7a
mov dword [edi], 0
mov byte [edi + 4], cl
xor ebx, ebx
jmp 0x50cb24
inc ecx
mov dword [esi + 8], ecx
jmp 0x50cb24