Function at 0x4d84f0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
push esi
mov esi, dword [edi + 4]
mov eax, esi
cdq
mov ecx, esi
and ecx, 7
and edx, 7
mov ebx, 0x80
add eax, edx
sar ebx, cl
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
sar eax, 3
mov al, byte [eax + edx]
test al, bl
jne 0x4d852e
mov eax, dword [esp + 0x2c]
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
mov ecx, dword [ebp + 0x28]
test ecx, ecx
je 0x4d8541
mov eax, dword [ebp + 0x2c]
sub eax, ecx
sar eax, 3
cmp esi, eax
jb 0x4d8547
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ecx, dword [ebp + 0x28]
test dword [ecx + esi*8], 0x1c0000
je 0x4d8521
test ecx, ecx
jne 0x4d855b
xor eax, eax
jmp 0x4d8563
mov eax, dword [ebp + 0x2c]
sub eax, ecx
sar eax, 3
mov edx, dword [edi + 4]
add edx, 1
cmp edx, eax
jne 0x4d8576
mov eax, dword [ebp + 0x58]
mov dword [esp + 0xc], eax
jmp 0x4d857d
mov ecx, dword [ebp + 0x54]
mov dword [esp + 0xc], ecx
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0xc]
push edx
push ebx
mov ecx, edi
lea eax, [esp + 0x3c]
call fcn.004d8240
mov cl, byte [eax]
mov edx, dword [esp + 0x44]
add esp, 8
mov byte [esp + 0x1c], cl
mov al, byte [eax + 1]
and edx, 4
mov byte [esp + 0x18], al
mov dword [esp + 0x10], edx
je 0x4d85b7
test cl, cl
je 0x4d8521
cmp dword [esp + 0x30], 0
jle 0x4d8633
test al, al
jne 0x4d8633
mov esi, dword [esp + 0x28]
mov ecx, dword [esi + 4]
test ecx, ecx
jne 0x4d85d1
xor eax, eax
jmp 0x4d85d9
mov eax, dword [esi + 8]
sub eax, ecx
sar eax, 2
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x4d8628
xor ebp, ebp
test ebx, ebx
jle 0x4d8628
jmp 0x4d85f0
mov eax, dword [edi + 8]
test dword [eax + ebp*8 + 4], 0xc000
jne 0x4d861b
mov edx, dword [edi + 4]
movzx ecx, bp
shl ecx, 0x13
and edx, 0x7ffff
or ecx, edx
lea ebx, [esp + 0x3c]
mov dword [esp + 0x3c], ecx
call fcn.004d9890
add ebp, 1
cmp ebp, dword [esp + 0xc]
jl 0x4d85f0
mov ecx, dword [esp + 0x2c]
mov eax, ecx
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
xor ebp, ebp
test ebx, ebx
jle 0x4d8730
mov eax, dword [edi + 8]
test dword [eax + ebp*8 + 4], 0xc000
jne 0x4d871f
mov eax, dword [edi]
test eax, eax
je 0x4d86e8
mov ecx, dword [esp + 0x38]
cmp eax, ecx
je 0x4d86e8
cmp byte [esp + 0x18], 0
jne 0x4d86e8
test byte [esp + 0x3c], 0x20
je 0x4d86e8
sub eax, ecx
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
jne 0x4d86b1
mov esi, dword [esp + 0x24]
mov eax, esi
call fcn.0041c1e0
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x4d8628
mov edx, dword [edi + 4]
movzx ecx, bp
shl ecx, 0x13
and edx, 0x7ffff
or ecx, edx
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], ecx
call fcn.004d9890
jmp 0x4d871f
mov esi, dword [esp + 0x28]
mov eax, esi
call fcn.0041c1e0
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x4d8628
mov ecx, dword [edi + 4]
movzx eax, bp
shl eax, 0x13
and ecx, 0x7ffff
or eax, ecx
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], eax
call fcn.004d9890
jmp 0x4d871f
mov eax, dword [edi + 4]
mov esi, dword [esp + 0x20]
movzx edx, bp
shl edx, 0x13
and eax, 0x7ffff
or edx, eax
lea ebx, [esp + 0x34]
mov dword [esp + 0x34], edx
call fcn.004d9890
mov eax, dword [esp + 0x2c]
sub eax, 1
cmp dword [esp + 0x30], 0
mov dword [esp + 0x2c], eax
jg 0x4d871f
test eax, eax
jle 0x4d874e
add ebp, 1
cmp ebp, dword [esp + 0xc]
jl 0x4d863d
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x2c]
test eax, eax
jg 0x4d8743
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28
test edx, edx
jne 0x4d874e
mov edx, dword [esp + 0x24]
mov ecx, dword [edx + 4]
pop esi
pop ebp
pop ebx
add esp, 8
ret 0x28