Function at 0x5d58da
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push esi
and dword [ebp - 0x18], 0
mov ecx, dword [eax + 0x18]
mov eax, dword [edx + 4]
mov esi, eax
and eax, 7
mov dword [ebp - 0x30], eax
mov eax, dword [ecx]
shr esi, 3
cmp dword [edx + 8], 0
mov dword [ebp - 0x2c], eax
mov eax, dword [ecx + 4]
lea esi, [esi*8 + 1]
mov dword [ebp - 0x34], 1
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x28], eax
jbe 0x5d5bd4
push ebx
push edi
mov eax, dword [ebp + 0x10]
mov ebx, dword [ebp - 0x18]
and byte [ebp - 1], 0
and byte [ebp - 2], 0
mov ecx, dword [eax + 0x24]
mov esi, dword [eax + 0x10]
mov eax, ecx
mov dword [ebp - 0x24], 0xe
imul eax, ebx
add eax, esi
dec ebx
mov edi, ebx
mov dword [ebp - 0x1c], eax
imul edi, ecx
add edi, esi
lea esi, [ebx - 1]
imul esi, ecx
mov ecx, dword [ebp + 0x10]
add esi, dword [ecx + 0x10]
mov cl, byte [edi]
shr cl, 4
and cl, 0xc
movzx cx, cl
mov word [ebp - 0x14], cx
mov cl, byte [esi]
and cl, 0x80
cmp byte [edx + 0xd], 0
movzx cx, cl
mov word [ebp - 8], cx
je 0x5d59a6
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 + 0xc]
movzx eax, al
xor dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x34], 0
jne 0x5d59d3
mov ecx, dword [ebp + 0x10]
mov eax, dword [ecx + 0x24]
mov ecx, dword [ecx + 0x10]
push eax
imul ebx, eax
imul eax, dword [ebp - 0x18]
add ebx, ecx
add eax, ecx
push ebx
push eax
call fcn.005c3923
mov edx, dword [ebp + 0xc]
add esp, 0xc
jmp 0x5d5bc3
xor ecx, ecx
push 1
mov ch, byte [edi]
inc edi
mov dword [ebp - 0x10], ecx
movzx cx, byte [edi]
or dword [ebp - 0x10], ecx
xor ecx, ecx
mov ch, byte [esi]
inc edi
inc esi
mov dword [ebp - 0xc], ecx
movzx cx, byte [esi]
or dword [ebp - 0xc], ecx
pop ecx
inc esi
cmp dword [ebp - 0x38], ecx
mov dword [ebp - 0x20], ecx
jbe 0x5d5af8
mov eax, dword [ebp - 0x24]
mov ebx, dword [ebp - 0xc]
mov cx, ax
shr bx, cl
lea ecx, [eax - 1]
and ecx, 0xf
mov dword [ebp - 0x24], ecx
and ebx, 1
shl ebx, 6
or dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
movzx bx, byte [ebp - 1]
and eax, 0xfdfd
and ebx, 0xfbfb
shl eax, 1
or eax, ebx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
shr ax, cl
mov ecx, dword [ebp - 0x14]
and ecx, 0xffbf
and eax, 1
shl eax, 1
or eax, ecx
shl eax, 1
cmp byte [edx + 0xe], 0
mov dword [ebp - 0x14], eax
je 0x5d5a75
mov eax, dword [ebp - 0x20]
mov ecx, dword [edx + 0x10]
dec eax
push eax
push dword [ebp - 0x18]
call fcn.005c64c5
test al, al
je 0x5d5a75
and byte [ebp - 1], 0
jmp 0x5d5a96
movzx eax, word [ebp - 0x14]
movzx ecx, word [ebp - 8]
or eax, ecx
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 - 1], al
mov al, byte [ebp - 2]
shl al, 1
or al, byte [ebp - 1]
test byte [ebp - 0x20], 7
mov byte [ebp - 2], al
jne 0x5d5ae3
mov ecx, dword [ebp - 0x1c]
inc dword [ebp - 0x1c]
and byte [ebp - 2], 0
cmp dword [ebp - 0x24], 8
mov byte [ecx], al
jae 0x5d5acd
xor eax, eax
mov ah, byte [edi]
inc edi
mov al, byte [ebp - 0x10]
mov dword [ebp - 0x10], eax
xor eax, eax
mov ah, byte [esi]
mov al, byte [ebp - 0xc]
jmp 0x5d5adf
xor eax, eax
mov ah, byte [ebp - 0xf]
mov al, byte [edi]
inc edi
mov dword [ebp - 0x10], eax
xor eax, eax
mov ah, byte [ebp - 0xb]
mov al, byte [esi]
mov dword [ebp - 0xc], eax
inc esi
inc dword [ebp - 0x20]
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x38]
jb 0x5d5a02
mov eax, dword [ebp - 0x1c]
xor esi, esi
cmp dword [ebp - 0x30], esi
jbe 0x5d5bb1
mov eax, dword [ebp - 0x24]
mov edi, dword [ebp - 0xc]
mov cx, ax
shr di, cl
lea ecx, [eax - 1]
and ecx, 0xf
mov dword [ebp - 0x24], ecx
and edi, 1
shl edi, 6
or dword [ebp - 8], edi
mov eax, dword [ebp - 8]
movzx di, byte [ebp - 1]
and eax, 0xfdfd
and edi, 0xfbfb
shl eax, 1
or eax, edi
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
shr ax, cl
mov ecx, dword [ebp - 0x14]
and ecx, 0xffbf
and eax, 1
shl eax, 1
or eax, ecx
shl eax, 1
cmp byte [edx + 0xe], 0
mov dword [ebp - 0x14], eax
je 0x5d5b75
mov ecx, dword [edx + 0x10]
lea eax, [esi - 1]
push eax
push dword [ebp - 0x18]
call fcn.005c64c5
test al, al
je 0x5d5b75
and byte [ebp - 1], 0
jmp 0x5d5b96
movzx eax, word [ebp - 0x14]
movzx ecx, word [ebp - 8]
or eax, ecx
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 - 1], al
mov al, byte [ebp - 2]
mov edx, dword [ebp + 0xc]
shl al, 1
or al, byte [ebp - 1]
inc esi
cmp esi, dword [ebp - 0x30]
mov byte [ebp - 2], al
jb 0x5d5b03
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x30], 0
je 0x5d5bc3
mov bl, byte [ebp - 2]
mov cl, 8
sub cl, byte [ebp - 0x30]
shl bl, cl
mov byte [eax], bl
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [edx + 8]
jb 0x5d5924
pop edi
pop ebx
xor eax, eax
pop esi
leave
ret