Function at 0x5d0aee
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
and dword [ebp - 0x14], 0
mov ecx, dword [eax + 0x18]
mov dword [ebp - 0x28], 1
mov eax, dword [edi + 4]
mov edx, eax
and eax, 7
mov dword [ebp - 0x24], eax
mov eax, dword [ecx]
shr edx, 3
cmp dword [edi + 8], 0
mov dword [ebp - 0x20], eax
mov eax, dword [ecx + 4]
lea edx, [edx*8 + 1]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x1c], eax
jbe 0x5d0d7b
push ebx
push esi
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp - 0x14]
and dword [ebp - 0x10], 0
and byte [ebp + 0xf], 0
mov edx, dword [eax + 0x24]
mov ecx, dword [eax + 0x10]
mov ebx, edx
and byte [ebp - 1], 0
imul ebx, esi
add ebx, ecx
lea ecx, [esi - 1]
mov esi, ecx
mov dword [ebp - 0x2c], ecx
imul esi, edx
add esi, dword [eax + 0x10]
mov dword [ebp - 0x18], 0xd
mov dl, byte [esi]
shr dl, 2
and dl, 0x30
cmp byte [edi + 0xd], 0
movzx dx, dl
mov word [ebp - 8], dx
je 0x5d0ba8
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 8]
add eax, 0x195
push eax
mov eax, dword [ebp - 0x20]
add eax, 0x195
push eax
call fcn.005cec4a
mov ecx, dword [ebp - 0x2c]
movzx eax, al
xor dword [ebp - 0x28], eax
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x28], 0
jne 0x5d0bcf
mov edx, dword [eax + 0x24]
mov eax, dword [eax + 0x10]
push edx
imul ecx, edx
imul edx, dword [ebp - 0x14]
add ecx, eax
add edx, eax
push ecx
push edx
call fcn.005be4a1
add esp, 0xc
jmp 0x5d0d6a
xor eax, eax
push 1
mov ah, byte [esi]
inc esi
mov dword [ebp - 0xc], eax
movzx ax, byte [esi]
or dword [ebp - 0xc], eax
pop eax
inc esi
cmp dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
jbe 0x5d0cb4
movzx ax, byte [ebp + 0xf]
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
and ecx, 0xfff7
and eax, 0xffef
shl ecx, 1
or eax, ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
mov cx, ax
shr dx, cl
and edx, 1
shl edx, 3
or dword [ebp - 8], edx
mov ecx, dword [ebp - 8]
and ecx, 0xfdff
shl ecx, 1
dec eax
mov dword [ebp - 8], ecx
and eax, 0xf
cmp byte [edi + 0xe], 0
mov dword [ebp - 0x18], eax
je 0x5d0c52
mov eax, dword [ebp - 0x2c]
mov ecx, dword [edi + 0x10]
dec eax
push eax
push dword [ebp - 0x14]
call fcn.005c1043
test al, al
je 0x5d0c52
and byte [ebp + 0xf], 0
jmp 0x5d0c73
movzx eax, word [ebp - 8]
movzx ecx, word [ebp - 0x10]
or eax, ecx
mov ecx, dword [ebp - 0x1c]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x20]
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 - 0x2c]
shl al, 1
or al, byte [ebp + 0xf]
test cl, 7
mov byte [ebp - 1], al
jne 0x5d0ca7
and byte [ebp - 1], 0
mov byte [ebx], al
inc ebx
cmp dword [ebp - 0x18], 8
jae 0x5d0c9c
xor eax, eax
mov ah, byte [esi]
mov al, byte [ebp - 0xc]
jmp 0x5d0ca3
xor eax, eax
mov ah, byte [ebp - 0xb]
mov al, byte [esi]
mov dword [ebp - 0xc], eax
inc esi
inc ecx
cmp ecx, dword [ebp - 0x30]
mov dword [ebp - 0x2c], ecx
jb 0x5d0bee
xor esi, esi
cmp dword [ebp - 0x24], esi
jbe 0x5d0d58
movzx ax, byte [ebp + 0xf]
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
and ecx, 0xfff7
and eax, 0xffef
shl ecx, 1
or eax, ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
mov cx, ax
shr dx, cl
and edx, 1
shl edx, 3
or dword [ebp - 8], edx
mov ecx, dword [ebp - 8]
and ecx, 0xfdff
shl ecx, 1
dec eax
mov dword [ebp - 8], ecx
and eax, 0xf
cmp byte [edi + 0xe], 0
mov dword [ebp - 0x18], eax
je 0x5d0d22
mov ecx, dword [edi + 0x10]
lea eax, [esi - 1]
push eax
push dword [ebp - 0x14]
call fcn.005c1043
test al, al
je 0x5d0d22
and byte [ebp + 0xf], 0
jmp 0x5d0d43
movzx eax, word [ebp - 8]
movzx ecx, word [ebp - 0x10]
or eax, ecx
mov ecx, dword [ebp - 0x1c]
add ecx, eax
push ecx
mov ecx, dword [ebp - 0x20]
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 esi
cmp esi, dword [ebp - 0x24]
mov byte [ebp - 1], al
jb 0x5d0cbf
cmp dword [ebp - 0x24], 0
je 0x5d0d6a
mov al, byte [ebp - 1]
mov cl, 8
sub cl, byte [ebp - 0x24]
shl al, cl
mov byte [ebx], al
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [edi + 8]
jb 0x5d0b38
pop esi
pop ebx
xor eax, eax
pop edi
leave
ret