Function at 0x101be3e0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50c
push ebx
xor ebx, ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x74], ebx
mov dword [ebp - 0x70], ebx
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x58], ebx
cmp ecx, ebx
jbe 0x101be6b0
push esi
push edi
mov edi, dword [ebp + 0x10]
mov eax, edi
shl eax, 4
mov dword [ebp - 0x2c], eax
lea eax, [ebp + edi*2 - 0x50c]
mov dword [ebp - 0x28], eax
lea eax, [edi + edi*8]
add eax, eax
add eax, eax
mov dword [ebp - 0x30], eax
dec ecx
mov eax, 0xfc0fc0fd
mul ecx
mov esi, edi
shl esi, 6
add esi, edi
shr edx, 6
inc edx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x24], edx
jmp 0x101be468
xor ebx, ebx
xor eax, eax
cmp esi, ebx
jbe 0x101be49a
mov edi, edi
mov ecx, dword [ebp + 0xc]
movzx edx, byte [ecx]
mov ebx, 0x80
sub dx, bx
mov ebx, 0x100
imul dx, bx
mov word [ebp + eax*2 - 0x50c], dx
inc ecx
inc eax
mov dword [ebp + 0xc], ecx
cmp eax, esi
jb 0x101be470
xor ebx, ebx
mov ecx, dword [ebp + 8]
mov dword [ebp - 4], ecx
test edi, edi
jle 0x101be57d
jmp 0x101be4b0
movsx eax, word [ebp + ebx*2 - 0x50c]
sub eax, dword [ebp + ebx*4 - 0x54]
mov edx, dword [ebp + ebx*4 - 0x78]
mov edi, dword [edx*4 + 0x1027fab0]
mov esi, 0
jns 0x101be4d5
mov esi, 8
neg eax
lea edx, [edi + edi]
cmp edx, eax
cmovle eax, edx
add eax, eax
add eax, eax
add eax, eax
cdq
idiv edi
dec eax
cdq
sub eax, edx
sar eax, 1
or esi, eax
mov eax, dword [esi*4 + 0x1027fc18]
imul eax, edi
cdq
and edx, 7
add eax, edx
sar eax, 3
add dword [ebp + ebx*4 - 0x54], eax
mov eax, dword [ebp + ebx*4 - 0x54]
cmp eax, 0xffff8000
jge 0x101be517
mov edi, 0xffff8000
jmp 0x101be525
mov edi, eax
cmp eax, 0x7fff
jl 0x101be525
mov edi, 0x7fff
mov eax, dword [esi*4 + 0x1027fc58]
add dword [ebp + ebx*4 - 0x78], eax
mov eax, dword [ebp + ebx*4 - 0x78]
mov dword [ebp + ebx*4 - 0x54], edi
jns 0x101be53e
xor eax, eax
jmp 0x101be548
cmp eax, 0x58
jl 0x101be548
mov eax, 0x58
movzx edx, byte [ebp + ebx*4 - 0x54]
mov byte [ecx], dl
mov edx, edi
sar edx, 8
mov byte [ecx + 1], dl
movzx edx, al
mov dword [ebp + ebx*4 - 0x78], eax
sar eax, 8
mov byte [ecx + 2], dl
mov byte [ecx + 3], al
inc ebx
add ecx, 4
cmp ebx, dword [ebp + 0x10]
jl 0x101be4b0
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp + 0x10]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 8
lea ebx, [ebx]
xor eax, eax
mov dword [ebp - 0xc], eax
test edi, edi
jle 0x101be68d
mov dword [ebp - 0x10], ecx
jmp 0x101be5a5
mov eax, dword [ebp - 0xc]
mov esi, dword [ebp + eax*4 - 0x54]
mov ebx, dword [ebp + eax*4 - 0x78]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 8], eax
lea ebx, [ebx]
mov ecx, dword [ebp - 8]
movsx eax, word [ecx]
sub eax, esi
mov edi, dword [ebx*4 + 0x1027fab0]
mov ecx, 0
jns 0x101be5dd
mov ecx, 8
neg eax
lea edx, [edi + edi]
cmp edx, eax
cmovle eax, edx
add eax, eax
add eax, eax
add eax, eax
cdq
idiv edi
dec eax
cdq
sub eax, edx
sar eax, 1
or ecx, eax
mov eax, dword [ecx*4 + 0x1027fc18]
imul eax, edi
cdq
and edx, 7
add eax, edx
sar eax, 3
add esi, eax
cmp esi, 0xffff8000
jge 0x101be61a
mov esi, 0xffff8000
jmp 0x101be627
cmp esi, 0x7fff
jl 0x101be627
mov esi, 0x7fff
add ebx, dword [ecx*4 + 0x1027fc58]
jns 0x101be634
xor ebx, ebx
jmp 0x101be63e
cmp ebx, 0x58
jl 0x101be63e
mov ebx, 0x58
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 4]
test dl, 1
jne 0x101be64d
mov byte [eax], cl
jmp 0x101be656
shl cl, 4
or byte [eax], cl
inc eax
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
add eax, eax
add dword [ebp - 8], eax
inc edx
mov dword [ebp - 0x1c], edx
cmp edx, 8
jl 0x101be5c0
mov eax, dword [ebp - 0xc]
add dword [ebp - 0x10], 2
mov dword [ebp + eax*4 - 0x54], esi
mov dword [ebp + eax*4 - 0x78], ebx
inc eax
mov dword [ebp - 0xc], eax
cmp eax, dword [ebp + 0x10]
jl 0x101be5a2
mov esi, dword [ebp - 0x20]
mov edi, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x18]
add ecx, dword [ebp - 0x2c]
dec dword [ebp - 0x14]
mov dword [ebp - 0x18], ecx
jne 0x101be590
mov ecx, dword [ebp - 0x30]
add dword [ebp + 8], ecx
dec dword [ebp - 0x24]
jne 0x101be466
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret