Function at 0x10087717
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x18], esi
cmp dword [esi + 0x28], 0
jne 0x10087733
mov eax, dword [ebx]
mov dword [esi + 0x28], eax
mov edx, dword [esi + 4]
mov edi, dword [ebx + 0xc]
mov dword [ebp - 0x2c], edi
lea ecx, [edx + 7]
shr ecx, 3
dec ecx
mov eax, ecx
mov dword [ebp - 8], ecx
shl eax, 3
sub edx, eax
mov eax, dword [esi + 0x24]
mov dword [ebp - 0x14], edx
cmp eax, dword [esi + 8]
jae 0x10087a3b
cmp dword [esi + 0x10], 0
je 0x10087779
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
add eax, 0x728
push eax
call fcn.10085a51
xor dword [esi + 0x44], eax
mov ecx, dword [ebp - 8]
cmp dword [esi + 0x44], 0
je 0x10087793
mov ecx, dword [esi + 0x24]
lea eax, [ecx - 1]
push eax
push ecx
mov ecx, ebx
call fcn.100851b7
jmp 0x100879f7
cmp dword [esi + 0x24], 1
jbe 0x100878f7
mov eax, dword [esi + 0x28]
lea ebx, [edi + edi]
and dword [ebp - 0x28], 0
mov edx, eax
sub edx, ebx
sub eax, edi
movzx edi, byte [edx]
add edi, edi
inc edx
mov dword [ebp - 0x20], edx
movzx edx, byte [eax]
inc eax
mov dword [ebp - 0x24], eax
mov ebx, edx
shr ebx, 3
mov eax, edi
and ebx, 0x7c
and eax, 0x380
or ebx, eax
mov dword [ebp - 0x10], ebx
test ecx, ecx
jle 0x10087874
mov ecx, dword [ebp - 0x20]
shl edi, 7
shl edx, 8
mov byte [ebp - 1], 0
movzx eax, byte [ecx]
or edi, eax
mov dword [ebp - 0x1c], 7
add edi, edi
inc ecx
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x24]
movzx eax, byte [ecx]
or edx, eax
inc ecx
mov dword [ebp - 0xc], edx
mov esi, edx
mov dword [ebp - 0x24], ecx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
lea eax, [eax + ebx*8]
push eax
call fcn.10085a51
mov ecx, dword [ebp - 0x1c]
mov ebx, eax
mov al, bl
mov edx, esi
shl al, cl
add ecx, 3
or byte [ebp - 1], al
mov eax, edi
shr edx, cl
mov ecx, dword [ebp - 0x1c]
and edx, 4
shr eax, cl
and eax, 0x80
or edx, eax
mov eax, dword [ebp - 0x10]
and eax, 0x1bd
add eax, eax
or edx, eax
or ebx, edx
sub ecx, 1
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x1c], ecx
jns 0x10087809
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x28]
mov dl, byte [ebp - 1]
mov eax, dword [esi + 0x28]
mov byte [ecx + eax], dl
inc ecx
mov edx, dword [ebp - 0xc]
mov dword [ebp - 0x28], ecx
cmp ecx, dword [ebp - 8]
jl 0x100877d9
and dword [ebp - 0x1c], 0
shl edx, 8
shl edi, 8
cmp dword [ebp - 0x14], 0
mov dword [ebp - 0xc], edx
mov byte [ebp - 1], 0
jle 0x100879e5
mov dword [ebp - 0x20], 7
mov esi, edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
lea eax, [eax + ebx*8]
push eax
call fcn.10085a51
mov ecx, dword [ebp - 0x20]
mov ebx, eax
mov al, bl
mov edx, edi
shl al, cl
or byte [ebp - 1], al
mov eax, esi
push 7
pop ecx
sub ecx, dword [ebp - 0x1c]
shr edx, cl
push 0xa
pop ecx
sub ecx, dword [ebp - 0x1c]
and edx, 0x80
shr eax, cl
and eax, 4
or edx, eax
mov eax, dword [ebp - 0x10]
and eax, 0x1bd
add eax, eax
or edx, eax
mov eax, dword [ebp - 0x1c]
or ebx, edx
inc eax
dec dword [ebp - 0x20]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x1c], eax
cmp eax, dword [ebp - 0x14]
jl 0x10087898
jmp 0x100879e2
mov edx, dword [esi + 0x28]
sub edx, edi
test byte [esi + 0x24], 1
mov dword [ebp - 0x1c], edx
je 0x1008790e
movzx edi, byte [edx]
inc edx
mov dword [ebp - 0x1c], edx
jmp 0x10087910
xor edi, edi
and dword [ebp - 0x20], 0
mov ebx, edi
shr ebx, 3
and ebx, 0x7c
test ecx, ecx
jle 0x1008798b
test byte [esi + 0x24], 1
je 0x10087932
movzx eax, byte [edx]
shl edi, 8
or edi, eax
inc edx
mov dword [ebp - 0x1c], edx
push 7
mov byte [ebp - 1], 0
pop esi
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
lea eax, [eax + ebx*8]
push eax
call fcn.10085a51
mov edx, eax
mov ecx, esi
mov al, dl
and ebx, 0x1bd
shl al, cl
add ebx, ebx
or byte [ebp - 1], al
lea ecx, [esi + 3]
mov eax, edi
shr eax, cl
and eax, 4
or ebx, eax
or ebx, edx
sub esi, 1
jns 0x10087939
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x20]
mov dl, byte [ebp - 1]
mov eax, dword [esi + 0x28]
mov byte [ecx + eax], dl
mov eax, ecx
mov edx, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 0x20], eax
cmp eax, dword [ebp - 8]
jl 0x10087920
and dword [ebp - 0x28], 0
shl edi, 8
cmp dword [ebp - 0x14], 0
mov byte [ebp - 1], 0
jle 0x100879e5
mov esi, dword [ebp - 0x28]
mov dword [ebp - 0x20], 7
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
lea eax, [eax + ebx*8]
push eax
call fcn.10085a51
mov ecx, dword [ebp - 0x20]
mov edx, eax
mov al, dl
and ebx, 0x1bd
shl al, cl
add ebx, ebx
or byte [ebp - 1], al
mov eax, edi
push 0xa
pop ecx
sub ecx, esi
shr eax, cl
and eax, 4
or ebx, eax
or ebx, edx
inc esi
dec dword [ebp - 0x20]
cmp esi, dword [ebp - 0x14]
jl 0x100879a6
mov esi, dword [ebp - 0x18]
mov eax, dword [esi + 0x28]
mov ecx, dword [ebp - 8]
mov dl, byte [ebp - 1]
mov edi, dword [ebp - 0x2c]
mov ebx, dword [ebp + 8]
mov byte [ecx + eax], dl
add dword [esi + 0x28], edi
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x10087a1d
mov eax, dword [esi + 0x24]
xor edx, edx
mov dword [ebp - 0x28], 0x32
div dword [ebp - 0x28]
test edx, edx
jne 0x10087a1d
mov eax, dword [ecx]
call dword [eax + 4]
test eax, eax
jne 0x10087a30
inc dword [esi + 0x24]
mov eax, dword [esi + 0x24]
cmp eax, dword [esi + 8]
jae 0x10087a3b
mov ecx, dword [ebp - 8]
jmp 0x1008775c
inc dword [esi + 0x24]
push 3
pop eax
mov dword [esi + 0x30], eax
jmp 0x10087a45
push 4
mov dword [esi + 0x30], 4
pop eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10