Function at 0x5d4e1b
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov ecx, dword [eax + 0x18]
xor edx, edx
mov eax, dword [ebx + 4]
mov dword [ebp - 0x10], edx
mov esi, eax
and eax, 7
mov dword [ebp - 0x34], eax
mov eax, dword [ecx]
shr esi, 3
cmp dword [ebx + 8], edx
mov dword [ebp - 0x2c], eax
mov eax, dword [ecx + 4]
lea esi, [esi*8 + 1]
mov dword [ebp - 0x38], 1
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x14], edx
jbe 0x5d51fd
push edi
mov eax, dword [ebp + 0x10]
and byte [ebp + 0xf], 0
and byte [ebp - 1], 0
mov dword [ebp - 0x24], 0xd
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 - 0x1c], eax
add esi, dword [ecx + 0x10]
mov cl, byte [edi]
shr cl, 2
and cl, 0x38
movzx cx, cl
mov word [ebp - 0x30], cx
mov cl, byte [esi]
and cl, 0xc0
movzx cx, cl
shl ecx, 3
cmp byte [ebx + 0xd], 0
mov dword [ebp - 0xc], ecx
je 0x5d4eef
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp + 8]
add eax, 0x795
push eax
mov eax, dword [ebp - 0x2c]
add eax, 0x795
push eax
call fcn.005d40cf
mov edx, dword [ebp - 0x20]
movzx eax, al
xor dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x38], 0
jne 0x5d4f19
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 0x5d51ed
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
jbe 0x5d50ae
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x18]
mov cx, ax
shr dx, cl
xor ecx, ecx
and dl, 1
mov ch, dl
or dword [ebp - 0xc], ecx
lea ecx, [eax - 1]
mov eax, dword [ebp - 0xc]
and ecx, 0xf
movzx dx, byte [ebp + 0xf]
and eax, 0xeffb
and edx, 0xdff7
shl eax, 1
or eax, edx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
shr ax, cl
mov ecx, dword [ebp - 0x30]
and ecx, 0xfeff
and eax, 1
shl eax, 2
or eax, ecx
shl eax, 1
mov dword [ebp - 0x30], eax
or eax, dword [ebp - 0xc]
and eax, 0xfffb
cmp byte [ebx + 0x18], 0
mov dword [ebp - 0x10], eax
jne 0x5d4fe1
mov ecx, dword [ebp - 8]
and ecx, 7
jne 0x5d4fb9
push 8
pop ecx
movsx edx, byte [ebx + 0x14]
neg ecx
cmp edx, ecx
mov dword [ebp + 0xc], edx
jle 0x5d4fe1
or cl, 0xff
sub cl, dl
mov dl, byte [ebp - 1]
shr dl, cl
and dl, 1
movzx cx, dl
shl ecx, 2
or eax, ecx
mov dword [ebp - 0x10], eax
jmp 0x5d500f
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 eax, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d5035
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 0x5d502f
and byte [ebp + 0xf], 0
jmp 0x5d504f
movzx eax, word [ebp - 0x10]
jmp 0x5d5038
movzx eax, ax
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 0x5d509e
mov edx, dword [ebp - 0x20]
inc dword [ebp - 0x20]
and byte [ebp - 1], 0
cmp dword [ebp - 0x24], 8
mov byte [edx], al
jae 0x5d5088
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 0x5d509a
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
jb 0x5d4f48
mov edx, dword [ebp - 0x20]
and dword [ebp - 8], 0
cmp dword [ebp - 0x34], 0
jbe 0x5d51df
mov esi, dword [ebp - 0x24]
mov eax, dword [ebp - 0x18]
mov cx, si
shr ax, cl
movzx dx, byte [ebp + 0xf]
and al, 1
xor ecx, ecx
mov ch, al
and edx, 0xdffe
or dword [ebp - 0xc], ecx
lea ecx, [esi - 1]
mov eax, dword [ebp - 0xc]
mov esi, dword [ebp - 0x1c]
and ecx, 0xf
and eax, 0xefff
shl eax, 1
shr si, cl
or eax, edx
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x30]
and eax, 0xfeff
and esi, 1
shl esi, 2
or esi, eax
mov al, byte [ebx + 0x18]
shl esi, 1
mov dword [ebp - 0x30], esi
or esi, dword [ebp - 0xc]
and esi, 0xfffb
test al, al
mov dword [ebp - 0x10], esi
jne 0x5d5151
mov edi, dword [ebp - 8]
and edi, 7
jne 0x5d512d
push 8
pop edi
movsx edx, byte [ebx + 0x14]
neg edi
cmp edx, edi
jle 0x5d5151
mov al, byte [ebp - 1]
or cl, 0xff
sub cl, dl
shr al, cl
and al, 1
movzx ax, al
shl eax, 2
or esi, eax
mov dword [ebp - 0x10], esi
jmp 0x5d517e
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 2
push eax
call fcn.005d4b0d
mov esi, dword [ebp - 0x10]
add esp, 0xc
cmp byte [ebx + 0xe], 0
je 0x5d51a4
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 0x5d519e
and byte [ebp + 0xf], 0
jmp 0x5d51be
movzx eax, word [ebp - 0x10]
jmp 0x5d51a7
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]
mov byte [ebp - 1], al
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x34]
jb 0x5d50bc
mov edx, dword [ebp - 0x20]
cmp dword [ebp - 0x34], 0
je 0x5d51ed
mov al, byte [ebp - 1]
mov cl, 8
sub cl, byte [ebp - 0x34]
shl al, cl
mov byte [edx], al
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebx + 8]
jb 0x5d4e68
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret