Function at 0x5d0455
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 0x5d074f
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 0x5d0521
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 + 0xc]
movzx eax, al
xor dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x34], 0
jne 0x5d054e
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.005be4a1
mov edx, dword [ebp + 0xc]
add esp, 0xc
jmp 0x5d073e
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 0x5d0673
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 0x5d05f0
mov eax, dword [ebp - 0x20]
mov ecx, dword [edx + 0x10]
dec eax
push eax
push dword [ebp - 0x18]
call fcn.005c1043
test al, al
je 0x5d05f0
and byte [ebp - 1], 0
jmp 0x5d0611
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.005cec4a
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 0x5d065e
mov ecx, dword [ebp - 0x1c]
inc dword [ebp - 0x1c]
and byte [ebp - 2], 0
cmp dword [ebp - 0x24], 8
mov byte [ecx], al
jae 0x5d0648
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 0x5d065a
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 0x5d057d
mov eax, dword [ebp - 0x1c]
xor esi, esi
cmp dword [ebp - 0x30], esi
jbe 0x5d072c
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 0x5d06f0
mov ecx, dword [edx + 0x10]
lea eax, [esi - 1]
push eax
push dword [ebp - 0x18]
call fcn.005c1043
test al, al
je 0x5d06f0
and byte [ebp - 1], 0
jmp 0x5d0711
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.005cec4a
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 0x5d067e
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x30], 0
je 0x5d073e
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 0x5d049f
pop edi
pop ebx
xor eax, eax
pop esi
leave
ret