Function at 0x20598b8
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x48
cmp dword [esp + 0x50], 0
push ebx
push ebp
push esi
push edi
push 0xb
pop edi
cmovne edi, dword [esp + 0x60]
cmp edi, 5
jb 0x2059ad7
cmp edi, 0xc
jbe 0x20598e2
push 0xffffffffffffffd4
pop eax
jmp 0x2059ada
mov ebp, dword [esp + 0x68]
xor esi, esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x60], esi
lea eax, [ebp - 1]
bsr ecx, eax
mov eax, dword [esp + 0x6c]
bsr eax, eax
inc ecx
add eax, 2
cmp ecx, eax
cmovb eax, ecx
cmp edi, eax
jb 0x2059ad7
push 0x3e
pop ebx
push esi
push ebp
push 0x40000000
sub ebx, edi
mov dword [esp + 0x44], esi
push esi
mov dword [esp + 0x4c], 0x7386b
mov dword [esp + 0x50], 0x7b20d
mov dword [esp + 0x54], 0x7f29c
mov dword [esp + 0x58], 0x86470
mov dword [esp + 0x5c], 0xaae60
mov dword [esp + 0x60], 0xb71b0
mov dword [esp + 0x64], 0xcaa30
mov dword [esp + 0x28], ebx
call fcn.0205cf94
mov dword [esp + 0x28], eax
xor ecx, ecx
mov dword [esp + 0x24], edx
lea eax, [esi - 0x14]
add eax, ebx
mov dword [esp + 0x60], esi
bts ecx, eax
mov dword [esp + 0x20], esi
xor edx, edx
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov eax, esi
mov dword [esp + 0x30], ecx
cmovae edx, ecx
mov dword [esp + 0x1c], eax
xor ebx, ebx
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x5c]
inc ebx
mov ecx, edi
mov eax, ebp
shl ebx, cl
shr eax, cl
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x64]
mov ecx, dword [ecx + esi*4]
cmp ecx, ebp
je 0x2059ad3
test ecx, ecx
jne 0x20599c5
xor eax, eax
jmp 0x2059a7e
cmp ecx, eax
ja 0x20599d2
dec ebx
or eax, 0xffffffff
jmp 0x2059a7e
mov eax, dword [esp + 0x24]
mul ecx
mov ebp, eax
mov eax, dword [esp + 0x28]
mul ecx
mov ecx, dword [esp + 0x18]
add ebp, edx
mov dword [esp + 0x14], eax
mov edx, ebp
mov dword [esp + 0x10], ebp
call fcn.0205cefc
movzx ebp, ax
cmp bp, 8
jge 0x2059a44
mov ecx, dword [esp + 0x18]
movsx esi, bp
mov eax, esi
cdq
call fcn.0205d020
sub dword [esp + 0x14], eax
mov eax, dword [esp + 0x2c]
sbb dword [esp + 0x10], edx
mul dword [esp + esi*4 + 0x38]
mov ecx, eax
mov eax, dword [esp + 0x30]
mul dword [esp + esi*4 + 0x38]
add ecx, edx
cmp dword [esp + 0x10], ecx
jb 0x2059a3c
ja 0x2059a37
cmp dword [esp + 0x14], eax
jbe 0x2059a3c
xor eax, eax
inc eax
jmp 0x2059a3e
xor eax, eax
mov esi, dword [esp + 0x20]
add ebp, eax
mov edx, dword [esp + 0x1c]
movsx eax, bp
sub ebx, eax
movzx ecx, bp
movzx eax, bp
cmp bp, dx
mov ebp, dword [esp + 0x68]
mov dword [esp + 0x20], eax
mov eax, esi
cmovle eax, dword [esp + 0x60]
mov dword [esp + 0x60], eax
movzx eax, dx
mov edx, dword [esp + 0x5c]
cmovle ecx, eax
movzx eax, cx
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x20]
mov word [edx + esi*2], ax
inc esi
mov eax, dword [esp + 0x34]
mov dword [esp + 0x20], esi
cmp esi, dword [esp + 0x6c]
jbe 0x20599ab
mov ecx, dword [esp + 0x60]
mov eax, ebx
neg eax
movzx esi, word [edx + ecx*2]
movsx ecx, si
sar ecx, 1
cmp eax, ecx
jl 0x2059ac4
push dword [esp + 0x6c]
push ebp
push dword [esp + 0x6c]
push edi
push edx
call fcn.02059ae4
add esp, 0x14
cmp eax, 0xffffff88
jbe 0x2059acf
jmp 0x2059ada
mov eax, dword [esp + 0x60]
lea ecx, [esi + ebx]
mov word [edx + eax*2], cx
mov eax, edi
jmp 0x2059ada
xor eax, eax
jmp 0x2059ada
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret