Function at 0x5d54f3
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 0x5d58d4
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 0x5d55c8
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.005d40cf
mov edx, dword [ebp - 0x20]
movzx eax, al
xor dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x34], 0
jne 0x5d55f2
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.005c3923
add esp, 0xc
jmp 0x5d58c4
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 0x5d5786
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 0x5d56b7
mov ecx, dword [ebp - 8]
and ecx, 7
jne 0x5d5690
push 8
pop ecx
movsx eax, byte [ebx + 0x14]
neg ecx
cmp eax, ecx
mov dword [ebp + 0xc], eax
jle 0x5d56b7
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 0x5d56e5
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.005c64c5
push eax
lea eax, [ebp - 0x10]
push 2
push eax
call fcn.005d4b0d
mov edx, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d570b
mov eax, dword [ebp - 8]
mov ecx, dword [ebx + 0x10]
dec eax
push eax
push dword [ebp - 0x14]
call fcn.005c64c5
test al, al
je 0x5d5705
and byte [ebp + 0xf], 0
jmp 0x5d5725
movzx eax, word [ebp - 0x10]
jmp 0x5d570e
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.005d40cf
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 0x5d5774
mov edx, dword [ebp - 0x20]
inc dword [ebp - 0x20]
and byte [ebp - 1], 0
cmp dword [ebp - 0x24], 8
mov byte [edx], al
jae 0x5d575e
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 0x5d5770
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 0x5d5621
mov edx, dword [ebp - 0x20]
mov eax, ecx
cmp eax, dword [ebp - 0x40]
jg 0x5d58b2
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 0x5d5827
mov edi, dword [ebp - 8]
and edi, 7
jne 0x5d5803
push 0x10
pop edi
movsx edx, byte [ebx + 0x14]
neg edi
cmp edx, edi
jle 0x5d5827
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 0x5d5854
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.005c64c5
push eax
lea eax, [ebp - 0x10]
push 3
push eax
call fcn.005d4b0d
mov esi, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d5878
push dword [ebp - 0x38]
mov ecx, dword [ebx + 0x10]
push dword [ebp - 0x14]
call fcn.005c64c5
test al, al
je 0x5d5872
and byte [ebp + 0xf], 0
jmp 0x5d5892
movzx eax, word [ebp - 0x10]
jmp 0x5d587b
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.005d40cf
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 0x5d5793
mov edx, dword [ebp - 0x20]
cmp dword [ebp - 0x44], 0
je 0x5d58c4
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 0x5d5543
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret