Function at 0x4fbd20
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
test edx, edx
mov dword [ebp - 0x18], ecx
mov ebx, 0xb
cmovne ebx, edx
mov dword [ebp - 0x24], ebx
push esi
push edi
cmp ebx, 5
jb 0x4fbf1c
cmp ebx, 0xc
jbe 0x4fbd53
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
bsr eax, eax
bsr ecx, esi
add eax, 2
inc ecx
cmp ecx, eax
cmovb eax, ecx
cmp ebx, eax
jb 0x4fbf1c
xor eax, eax
mov edi, 0x3e
cmp dword [ebp + 0x14], eax
push 0
sete al
sub edi, ebx
push esi
push 0x40000000
push 0
lea eax, [eax*2 - 1]
mov dword [ebp - 0x1c], edi
movzx eax, ax
mov dword [ebp - 0x20], eax
call fcn.0053d640
xor ecx, ecx
mov dword [ebp - 0x28], edx
xor edx, edx
mov dword [ebp - 0x2c], eax
lea eax, [edi - 0x14]
mov dword [ebp - 0x14], 0
bts ecx, eax
mov dword [ebp - 4], 0
cmp eax, 0x20
mov edi, 1
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov eax, dword [ebp - 0x18]
cmovae edx, ecx
mov dword [ebp - 0x34], ecx
mov ecx, ebx
mov dword [ebp - 0x30], edx
shl edi, cl
mov edx, esi
shr edx, cl
xor ebx, ebx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x38], edx
nop dword [eax + eax]
mov ecx, dword [ecx + ebx*4]
cmp ecx, esi
je 0x4fbf13
test ecx, ecx
jne 0x4fbe06
xor edx, edx
jmp 0x4fbeb0
cmp ecx, edx
ja 0x4fbe16
mov ecx, dword [ebp - 0x20]
dec edi
movzx edx, cx
jmp 0x4fbead
mov eax, dword [ebp - 0x28]
mul ecx
mov esi, eax
mov eax, dword [ebp - 0x2c]
mul ecx
mov ecx, dword [ebp - 0x1c]
add esi, edx
mov dword [ebp - 0xc], eax
mov edx, esi
mov dword [ebp - 8], esi
call fcn.00511be0
movzx esi, ax
cmp si, 8
jge 0x4fbe80
mov ecx, dword [ebp - 0x1c]
movsx edi, si
mov eax, edi
cdq
call fcn.00511c00
sub dword [ebp - 0xc], eax
mov ecx, dword [edi*4 + 0x58c290]
sbb dword [ebp - 8], edx
mov eax, dword [ebp - 0x30]
mul ecx
mov edi, eax
mov eax, dword [ebp - 0x34]
mul ecx
add edi, edx
cmp dword [ebp - 8], edi
jb 0x4fbe79
ja 0x4fbe72
cmp dword [ebp - 0xc], eax
jbe 0x4fbe79
mov eax, 1
jmp 0x4fbe7b
xor eax, eax
mov edi, dword [ebp - 0x10]
add esi, eax
movsx eax, si
sub edi, eax
movzx ecx, si
cmp si, word [ebp - 4]
mov eax, ebx
movzx edx, si
cmovle eax, dword [ebp - 0x14]
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
movzx eax, ax
cmovle ecx, eax
movzx eax, cx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x10], edi
mov ecx, dword [ebp + 8]
mov word [eax + ebx*2], dx
inc ebx
mov edx, dword [ebp - 0x38]
cmp ebx, dword [ebp + 0x10]
jbe 0x4fbdf0
mov ecx, dword [ebp - 0x14]
movzx ebx, word [eax + ecx*2]
lea edx, [eax + ecx*2]
movsx ecx, bx
mov eax, edi
sar ecx, 1
neg eax
cmp eax, ecx
jl 0x4fbf01
push dword [ebp - 0x20]
mov ecx, dword [ebp - 0x18]
push dword [ebp + 0x10]
push esi
push dword [ebp + 8]
mov esi, dword [ebp - 0x24]
mov edx, esi
call fcn.004fbac0
add esp, 0x10
cmp eax, 0xffffff88
jbe 0x4fbf0a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x24]
lea ecx, [ebx + edi]
mov word [edx], cx
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret