Function at 0x56985c
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 0x569a7f
cmp edi, 0xc
jbe 0x569886
push 0xffffffffffffffd4
pop eax
jmp 0x569a82
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 0x569a7f
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.0056d054
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]
mov ecx, edi
inc ebx
mov eax, ebp
shl ebx, cl
shr eax, cl
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x34], eax
mov ecx, dword [ecx + esi*4]
cmp ecx, ebp
je 0x569a7b
test ecx, ecx
jne 0x569969
xor eax, eax
jmp 0x569a22
cmp ecx, eax
ja 0x569976
dec ebx
or eax, 0xffffffff
jmp 0x569a22
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.0056cfbc
movzx ebp, ax
cmp bp, 8
jge 0x5699e8
mov ecx, dword [esp + 0x18]
movsx esi, bp
mov eax, esi
cdq
call fcn.0056d0e0
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 0x5699e0
ja 0x5699db
cmp dword [esp + 0x14], eax
jbe 0x5699e0
xor eax, eax
inc eax
jmp 0x5699e2
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 ecx, dword [esp + 0x64]
mov word [edx + esi*2], ax
inc esi
mov eax, dword [esp + 0x34]
mov dword [esp + 0x20], esi
cmp esi, dword [esp + 0x6c]
jbe 0x569953
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 0x569a6c
push dword [esp + 0x6c]
push ebp
push dword [esp + 0x6c]
push edi
push edx
call fcn.00569a8c
add esp, 0x14
cmp eax, 0xffffff88
jbe 0x569a77
jmp 0x569a82
mov eax, dword [esp + 0x60]
lea ecx, [esi + ebx]
mov word [edx + eax*2], cx
mov eax, edi
jmp 0x569a82
xor eax, eax
jmp 0x569a82
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x48
ret