Function at 0x5d006e
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov eax, dword [eax + 0x18]
xor edx, edx
mov ecx, dword [ebx + 4]
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x40], ecx
mov esi, ecx
and ecx, 7
mov dword [ebp - 0x34], 1
shr esi, 3
cmp dword [ebx + 8], edx
mov dword [ebp - 0x44], ecx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
lea esi, [esi*8 + 1]
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x14], edx
jle 0x5d044f
push edi
mov eax, dword [ebp + 0x10]
and byte [ebp + 0xf], 0
and byte [ebp - 1], 0
mov dword [ebp - 0x24], 0xe
mov ecx, dword [eax + 0x24]
mov esi, dword [eax + 0x10]
mov eax, dword [ebp - 0x14]
mov edx, ecx
imul edx, eax
add edx, esi
dec eax
mov edi, eax
mov dword [ebp - 0x20], edx
imul edi, ecx
add edi, esi
lea esi, [eax - 1]
imul esi, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x38], eax
add esi, dword [ecx + 0x10]
mov cl, byte [edi]
shr cl, 4
and cl, 0xc
movzx cx, cl
mov word [ebp - 0x30], cx
mov cl, byte [esi]
and cl, 0x80
cmp byte [ebx + 0xd], 0
movzx cx, cl
mov word [ebp - 0xc], cx
je 0x5d0143
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
add eax, 0xe5
push eax
mov eax, dword [ebp - 0x2c]
add eax, 0xe5
push eax
call fcn.005cec4a
mov edx, dword [ebp - 0x20]
movzx eax, al
xor dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x34], 0
jne 0x5d016d
mov edx, dword [ebp + 0x10]
mov ecx, dword [edx + 0x24]
mov edx, dword [edx + 0x10]
push ecx
imul eax, ecx
imul ecx, dword [ebp - 0x14]
add eax, edx
add ecx, edx
push eax
push ecx
call fcn.005be4a1
add esp, 0xc
jmp 0x5d043f
xor eax, eax
push 1
mov ah, byte [edi]
inc edi
mov dword [ebp - 0x1c], eax
movzx ax, byte [edi]
or dword [ebp - 0x1c], eax
xor eax, eax
mov ah, byte [esi]
inc edi
inc esi
mov dword [ebp - 0x18], eax
movzx ax, byte [esi]
or dword [ebp - 0x18], eax
pop eax
inc esi
cmp dword [ebp - 0x3c], eax
mov dword [ebp - 8], eax
jle 0x5d0301
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x18]
mov cx, ax
shr dx, cl
lea ecx, [eax - 1]
and ecx, 0xf
mov dword [ebp - 0x24], ecx
and edx, 1
shl edx, 6
or dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
movzx dx, byte [ebp + 0xf]
and eax, 0xfdfd
and edx, 0xfbfb
shl eax, 1
or eax, edx
mov edx, dword [ebp - 0x1c]
shr dx, cl
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x30]
and eax, 0xffbf
and edx, 1
shl edx, 1
or edx, eax
shl edx, 1
mov dword [ebp - 0x30], edx
or edx, dword [ebp - 0xc]
and edx, 0xfffb
cmp byte [ebx + 0x18], 0
mov dword [ebp - 0x10], edx
jne 0x5d0232
mov ecx, dword [ebp - 8]
and ecx, 7
jne 0x5d020b
push 8
pop ecx
movsx eax, byte [ebx + 0x14]
neg ecx
cmp eax, ecx
mov dword [ebp + 0xc], eax
jle 0x5d0232
or cl, 0xff
sub cl, al
mov al, byte [ebp - 1]
shr al, cl
and al, 1
movzx ax, al
shl eax, 2
or edx, eax
mov dword [ebp - 0x10], edx
jmp 0x5d0260
movsx eax, byte [ebx + 0x14]
mov ecx, dword [ebp - 8]
lea eax, [eax + ecx - 1]
mov ecx, dword [ebp + 0x10]
push eax
movsx eax, byte [ebx + 0x18]
add eax, dword [ebp - 0x14]
push eax
call fcn.005c1043
push eax
lea eax, [ebp - 0x10]
push 2
push eax
call fcn.005cf688
mov edx, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d0286
mov eax, dword [ebp - 8]
mov ecx, dword [ebx + 0x10]
dec eax
push eax
push dword [ebp - 0x14]
call fcn.005c1043
test al, al
je 0x5d0280
and byte [ebp + 0xf], 0
jmp 0x5d02a0
movzx eax, word [ebp - 0x10]
jmp 0x5d0289
movzx eax, dx
mov ecx, dword [ebp - 0x28]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x2c]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005cec4a
mov byte [ebp + 0xf], al
mov al, byte [ebp - 1]
mov ecx, dword [ebp - 8]
shl al, 1
or al, byte [ebp + 0xf]
test cl, 7
mov byte [ebp - 1], al
jne 0x5d02ef
mov edx, dword [ebp - 0x20]
inc dword [ebp - 0x20]
and byte [ebp - 1], 0
cmp dword [ebp - 0x24], 8
mov byte [edx], al
jae 0x5d02d9
xor eax, eax
mov ah, byte [edi]
inc edi
mov al, byte [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
xor eax, eax
mov ah, byte [esi]
mov al, byte [ebp - 0x18]
jmp 0x5d02eb
xor eax, eax
mov ah, byte [ebp - 0x1b]
mov al, byte [edi]
inc edi
mov dword [ebp - 0x1c], eax
xor eax, eax
mov ah, byte [ebp - 0x17]
mov al, byte [esi]
mov dword [ebp - 0x18], eax
inc esi
inc ecx
cmp ecx, dword [ebp - 0x3c]
mov dword [ebp - 8], ecx
jl 0x5d019c
mov edx, dword [ebp - 0x20]
mov eax, ecx
cmp eax, dword [ebp - 0x40]
jg 0x5d042d
dec eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x18]
mov cx, ax
mov esi, dword [ebp - 0x1c]
shr dx, cl
lea ecx, [eax - 1]
and ecx, 0xf
shr si, cl
and edx, 1
mov dword [ebp - 0x24], ecx
shl edx, 6
or dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
and esi, 1
movzx dx, byte [ebp + 0xf]
and eax, 0xfdfd
and edx, 0xfbfb
shl eax, 1
or eax, edx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x30]
shl esi, 1
and eax, 0xffbf
or esi, eax
mov al, byte [ebx + 0x18]
shl esi, 1
mov dword [ebp - 0x30], esi
or esi, dword [ebp - 0xc]
and esi, 0xfff7
test al, al
mov dword [ebp - 0x10], esi
jne 0x5d03a2
mov edi, dword [ebp - 8]
and edi, 7
jne 0x5d037e
push 0x10
pop edi
movsx edx, byte [ebx + 0x14]
neg edi
cmp edx, edi
jle 0x5d03a2
mov al, byte [ebp - 1]
or cl, 0xff
sub cl, dl
shr al, cl
and al, 1
movzx ax, al
shl eax, 3
or esi, eax
mov dword [ebp - 0x10], esi
jmp 0x5d03cf
movsx ecx, byte [ebx + 0x14]
mov edx, dword [ebp - 8]
movsx eax, al
add eax, dword [ebp - 0x14]
lea ecx, [ecx + edx - 1]
push ecx
mov ecx, dword [ebp + 0x10]
push eax
call fcn.005c1043
push eax
lea eax, [ebp - 0x10]
push 3
push eax
call fcn.005cf688
mov esi, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d03f3
push dword [ebp - 0x38]
mov ecx, dword [ebx + 0x10]
push dword [ebp - 0x14]
call fcn.005c1043
test al, al
je 0x5d03ed
and byte [ebp + 0xf], 0
jmp 0x5d040d
movzx eax, word [ebp - 0x10]
jmp 0x5d03f6
movzx eax, si
mov ecx, dword [ebp - 0x28]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x2c]
add eax, ecx
mov ecx, dword [ebp + 8]
push eax
call fcn.005cec4a
mov byte [ebp + 0xf], al
mov al, byte [ebp - 1]
shl al, 1
or al, byte [ebp + 0xf]
inc dword [ebp - 8]
inc dword [ebp - 0x38]
mov byte [ebp - 1], al
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x40]
jle 0x5d030e
mov edx, dword [ebp - 0x20]
cmp dword [ebp - 0x44], 0
je 0x5d043f
mov al, byte [ebp - 1]
mov cl, 8
sub cl, byte [ebp - 0x44]
shl al, cl
mov byte [edx], al
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebx + 8]
jl 0x5d00be
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret