Function at 0x521750
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x30
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push ebx
push ebp
lea eax, [eax + edx*2]
add eax, 2
mov dword [esp + 0x1c], eax
lea eax, [edx + 1]
mov dword [esp + 0x10], eax
xor eax, eax
push esi
push edi
xor edi, edi
xor esi, esi
lea ebp, [eax + 1]
shl ebp, cl
mov dword [esp + 0x10], ebp
lea edx, [edi + ecx]
xor ecx, ecx
lea eax, [ebp - 1]
mov ebp, dword [esp + 0x4c]
mov dword [esp + 0x14], eax
mov ebx, eax
xor eax, eax
bts eax, edx
cmp edx, 0x20
cmovae ecx, eax
xor eax, ecx
cmp edx, 0x40
lea edx, [ebp*2 + 2]
mov ebp, dword [esp + 0x10]
cmovae ecx, eax
add edx, eax
adc esi, ecx
add edx, 8
adc esi, edi
cmp esi, edi
ja 0x521a6d
jb 0x5217d0
cmp edx, dword [esp + 0x58]
ja 0x521a6d
cmp dword [esp + 0x4c], 0xff
ja 0x521a6d
mov eax, dword [esp + 0x50]
cmp eax, 0xc
jbe 0x5217ee
push 0xffffffffffffffd4
jmp 0x521a6f
mov esi, dword [esp + 0x4c]
lea ecx, [eax - 1]
xor edx, edx
mov word [esp + 0x58], ax
inc edx
mov eax, edx
mov word [esp + 0x5a], dx
shl ax, cl
mov edx, edi
movzx eax, ax
mov dword [esp + 0x20], eax
add esi, 1
je 0x521872
mov ebp, dword [esp + 0x44]
mov edi, dword [esp + 0x48]
add ebp, 6
mov eax, dword [esp + 0x54]
sub edi, eax
lea ebp, [ebp + ebx*4]
movzx ecx, word [eax + edi]
mov esi, ecx
mov dword [esp + 0x1c], esi
or esi, 0xffffffff
cmp cx, si
jne 0x521848
mov byte [ebp], dl
xor ecx, ecx
dec ebx
sub ebp, 4
inc ecx
jmp 0x52185d
cmp cx, word [esp + 0x20]
jl 0x521856
xor ecx, ecx
mov word [esp + 0x5a], cx
mov ecx, dword [esp + 0x1c]
movzx ecx, cx
mov esi, dword [esp + 0x18]
inc edx
mov word [eax], cx
add eax, 2
cmp edx, esi
jb 0x52182a
mov ebp, dword [esp + 0x10]
xor edi, edi
push 4
lea eax, [esp + 0x5c]
push eax
push dword [esp + 0x4c]
call sub.VCRUNTIME140.dll_memcpy
mov ecx, ebp
mov eax, ebp
shr ecx, 3
add esp, 0xc
add ecx, 3
shr eax, 1
add eax, ecx
lea ecx, [ebp - 1]
mov dword [esp + 0x58], eax
cmp ebx, ecx
jne 0x5219c7
mov ecx, dword [esp + 0x4c]
mov eax, edi
mov dword [esp + 0x1c], eax
xorps xmm0, xmm0
movlpd qword [esp + 0x28], xmm0
mov esi, edi
mov dword [esp + 0x20], edi
add ecx, 1
je 0x52195d
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x48]
add eax, dword [esp + 0x24]
push 8
mov dword [esp + 0x34], ebp
movsx ecx, word [ecx + esi*2]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x34]
push ecx
push eax
mov dword [esp + 0x40], ebx
mov dword [esp + 0x34], eax
call sub.VCRUNTIME140.dll_memcpy
mov ecx, dword [esp + 0x24]
add esp, 0xc
push 8
pop edi
cmp ecx, edi
jle 0x521932
mov esi, ecx
push 8
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], ebp
push eax
mov eax, dword [esp + 0x30]
add eax, edi
mov dword [esp + 0x44], ebx
push eax
call sub.VCRUNTIME140.dll_memcpy
add edi, 8
add esp, 0xc
cmp edi, esi
jl 0x521905
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
add eax, ecx
mov ecx, 0x1010101
inc esi
mov dword [esp + 0x1c], eax
add ebp, ecx
mov dword [esp + 0x20], esi
adc ebx, ecx
mov ecx, dword [esp + 0x4c]
inc ecx
cmp esi, ecx
jb 0x5218cc
mov ebp, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0x4c], edi
mov esi, edi
mov dword [esp + 0x20], esi
mov edx, edi
test ebp, ebp
je 0x521a69
mov eax, dword [esp + 0x24]
mov ebp, edx
mov edx, dword [esp + 0x14]
add eax, esi
mov ebx, edi
mov dword [esp + 0x28], eax
mov esi, eax
mov edi, dword [esp + 0x44]
mov ecx, ebp
mov al, byte [ebx + esi]
and ecx, edx
inc ebx
mov byte [edi + ecx*4 + 6], al
mov edi, dword [esp + 0x58]
add ebp, edi
cmp ebx, 2
jb 0x521985
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x20]
mov ebp, dword [esp + 0x10]
add esi, 2
push 0
lea edx, [edx + edi*2]
mov dword [esp + 0x24], esi
and edx, dword [esp + 0x18]
mov dword [esp + 0x50], edx
pop edi
cmp esi, ebp
jb 0x521971
jmp 0x521a20
mov ecx, edi
mov edx, edi
test esi, esi
je 0x521a1c
mov ebp, dword [esp + 0x48]
xor eax, eax
mov esi, edi
cmp ax, word [ebp]
mov eax, dword [esp + 0x58]
jge 0x521a02
mov edi, dword [esp + 0x44]
mov byte [edi + ecx*4 + 6], dl
add ecx, eax
and ecx, dword [esp + 0x14]
cmp ecx, ebx
ja 0x5219e9
movsx eax, word [ebp]
inc esi
cmp esi, eax
mov eax, dword [esp + 0x58]
jl 0x5219e5
xor edi, edi
mov esi, dword [esp + 0x4c]
inc edx
inc esi
add ebp, 2
cmp edx, esi
jb 0x5219d3
mov ebp, dword [esp + 0x10]
test ecx, ecx
je 0x521a1c
or eax, 0xffffffff
jmp 0x521a70
test ebp, ebp
je 0x521a69
mov ebx, dword [esp + 0x44]
movzx eax, bp
add ebx, 7
mov dword [esp + 0x4c], eax
movzx edx, byte [ebx - 1]
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x54]
movzx esi, word [eax + edx*2]
mov ecx, esi
lea eax, [esi + 1]
mov word [ebp + edx*2], ax
bsr eax, ecx
mov cl, byte [esp + 0x50]
sub cl, al
shl si, cl
sub si, word [esp + 0x4c]
inc edi
mov byte [ebx], cl
lea ebx, [ebx + 4]
mov word [ebx - 7], si
cmp edi, dword [esp + 0x10]
jb 0x521a2e
xor eax, eax
jmp 0x521a70
push 0xffffffffffffffd2
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret