Function at 0x4065c0
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
mov eax, 0x16680
call fcn.00409220
push ebx
mov ebx, dword [esp + 0x16690]
push ebp
push esi
push edi
mov edi, dword [esp + 0x166a0]
xor esi, esi
xor ecx, ecx
mov dword [esp + 0x10], 4
mov dword [esp + 0x14], 3
mov ebp, 1
mov eax, ecx
cdq
idiv edi
mov byte [esp + ecx + 0x18], cl
mov al, byte [edx + ebx]
mov byte [esp + ecx + 0xb354], al
mov dl, cl
inc dl
mov byte [esp + ebp + 0x18], dl
mov eax, ebp
cdq
idiv edi
mov al, byte [edx + ebx]
mov byte [esp + ecx + 0xb355], al
mov eax, dword [esp + 0x14]
mov dl, cl
add dl, 2
mov byte [esp + ecx + 0x1a], dl
dec eax
cdq
idiv edi
mov al, byte [edx + ebx]
mov byte [esp + ecx + 0xb356], al
mov eax, dword [esp + 0x14]
mov dl, cl
add dl, 3
mov byte [esp + ecx + 0x1b], dl
cdq
idiv edi
mov al, byte [edx + ebx]
mov edx, dword [esp + 0x14]
mov byte [esp + edx + 0xb354], al
mov eax, dword [esp + 0x10]
mov dl, cl
add dl, 4
mov byte [esp + eax + 0x18], dl
cdq
idiv edi
mov al, byte [edx + ebx]
mov byte [esp + ecx + 0xb358], al
mov dl, cl
add dl, 5
mov byte [esp + ecx + 0x1d], dl
lea eax, [ecx + 5]
cdq
idiv edi
mov al, byte [edx + ebx]
mov edx, dword [esp + 0x14]
mov byte [esp + ecx + 0xb359], al
mov eax, 6
add edx, eax
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x10]
add ebp, eax
add edx, eax
add ecx, eax
cmp ebp, 0xb33b
mov dword [esp + 0x10], edx
jl 0x4065f5
xor ecx, ecx
jmp 0x4066c0
mov bl, byte [esp + ecx + 0x18]
movzx edx, byte [esp + ecx + 0xb354]
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
add ecx, 6
mov esi, edx
mov al, byte [esp + esi + 0x18]
movzx edx, byte [esp + ecx + 0xb34f]
mov byte [esp + esi + 0x18], bl
mov bl, byte [esp + ecx + 0x13]
mov byte [esp + ecx + 0x12], al
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
mov esi, edx
mov al, byte [esp + esi + 0x18]
movzx edx, byte [esp + ecx + 0xb350]
mov byte [esp + esi + 0x18], bl
mov bl, byte [esp + ecx + 0x14]
mov byte [esp + ecx + 0x13], al
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
mov esi, edx
mov al, byte [esp + esi + 0x18]
movzx edx, byte [esp + ecx + 0xb351]
mov byte [esp + esi + 0x18], bl
mov bl, byte [esp + ecx + 0x15]
mov byte [esp + ecx + 0x14], al
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
mov esi, edx
mov al, byte [esp + esi + 0x18]
movzx edx, byte [esp + ecx + 0xb352]
mov byte [esp + esi + 0x18], bl
mov bl, byte [esp + ecx + 0x16]
mov byte [esp + ecx + 0x15], al
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
mov esi, edx
mov al, byte [esp + esi + 0x18]
movzx edx, byte [esp + ecx + 0xb353]
mov byte [esp + esi + 0x18], bl
mov bl, byte [esp + ecx + 0x17]
mov byte [esp + ecx + 0x16], al
add edx, esi
movzx eax, bl
add eax, edx
cdq
mov esi, 0xb33a
idiv esi
cmp ecx, 0xb33a
mov esi, edx
mov al, byte [esp + esi + 0x18]
mov byte [esp + esi + 0x18], bl
mov byte [esp + ecx + 0x17], al
jl 0x4066c0
mov eax, dword [esp + 0x16698]
xor edi, edi
test eax, eax
jle 0x40683d
mov esi, dword [esp + 0x166a4]
mov ebp, dword [esp + 0x16694]
sub ebp, esi
mov dword [esp + 0x10], eax
lea eax, [ecx + 1]
cdq
mov ecx, 0xb33a
idiv ecx
mov ebx, 0xb33a
mov ecx, edx
movzx eax, byte [esp + ecx + 0x18]
add eax, edi
cdq
mov edi, 0xb33a
idiv edi
mov al, byte [esp + ecx + 0x18]
mov edi, edx
mov dl, byte [esp + edi + 0x18]
mov byte [esp + edi + 0x18], al
mov byte [esp + ecx + 0x18], dl
movzx eax, byte [esp + edi + 0x18]
movzx edx, dl
add eax, edx
cdq
idiv ebx
mov bl, byte [esi + ebp]
mov al, byte [esp + edx + 0x18]
xor al, bl
mov byte [esi], al
mov eax, dword [esp + 0x10]
inc esi
dec eax
mov dword [esp + 0x10], eax
jne 0x4067e6
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x16680
ret