Function at 0x1400398d0
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 8], rcx
push rsi
push rdi
push r15
sub rsp, 0x20
mov r15, rcx
xor edi, edi
mov rcx, qword [rcx]
mov rsi, rdx
mov dword [rsp + 0x50], edi
cmp dword [r15 + 0x14], edi
jle 0x14003a097
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x10], r12
mov qword [rsp + 8], r13
mov qword [rsp], r14
nop
movsxd rax, dword [r15 + 0x1c]
mov r14, rcx
mov r13d, dword [r14]
lea rcx, [rcx + rax*4]
dec r13d
mov qword [rsp + 0x58], rcx
test r13d, r13d
jle 0x14003a06f
mov edx, dword [r15 + 0xc]
add r14, 4
mov rbx, qword [rsi + 8]
add edx, edi
mov r10, qword [rsi]
xor r8d, r8d
movsxd rax, edx
sub edx, dword [rsi + 0x18]
mov r9d, dword [r14]
movsxd rcx, dword [r10 + 0x14]
imul rcx, rax
mov eax, edx
add rcx, qword [r10]
cdq
mov qword [rsi + 0x20], rcx
idiv dword [rbx + 0x20]
movsxd rax, dword [rbx + 0x14]
movsxd rcx, edx
imul rcx, rax
add rcx, qword [rbx]
sub r13d, 1
mov qword [rsi + 0x28], rcx
js 0x140039e48
nop dword [rax]
mov r15d, dword [r14 + 4]
lea r14, [r14 + 8]
mov r12d, dword [r14]
mov eax, r12d
cdq
movzx ebp, dl
add ebp, eax
mov eax, r9d
cdq
sar ebp, 8
movzx edx, dl
add eax, edx
sar eax, 8
mov ecx, eax
cmp ebp, eax
jne 0x1400399bb
mov eax, r12d
sub eax, r9d
imul eax, r15d
add r8d, eax
jmp 0x140039e2b
movzx eax, r9b
mov edx, 0x100
sub edx, eax
imul edx, r15d
lea eax, [r8 + rdx]
cdq
movzx edx, dl
add eax, edx
sar eax, 8
mov edi, eax
test eax, eax
jle 0x140039bea
mov rdx, qword [rsi]
mov eax, ecx
mov r8, qword [rsi + 8]
imul eax, dword [rdx + 0x18]
cmp edi, 0xff
jl 0x140039aec
movsxd rdi, eax
mov eax, ecx
sub eax, dword [rsi + 0x14]
add rdi, qword [rsi + 0x20]
cdq
idiv dword [r8 + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [r8 + 0x18]
movsxd r8, edx
mov edx, 0x100
mov r9d, dword [r8 + rax]
mov ebx, r9d
shr ebx, 8
and r9d, 0xff00ff
imul r9d, dword [rsi + 0x10]
and ebx, 0xff00ff
imul ebx, dword [rsi + 0x10]
mov r8d, 0x100
shr r9d, 8
shr ebx, 8
and r9d, 0xff00ff
and ebx, 0xff00ff
mov eax, ebx
shr eax, 0x10
sub edx, eax
mov eax, dword [rdi]
mov r11d, eax
shr eax, 8
and eax, 0xff00ff
and r11d, 0xff00ff
imul eax, edx
imul r11d, edx
mov edx, 0x100
shr eax, 8
and eax, 0xff00ff
shr r11d, 8
add ebx, eax
and r11d, 0xff00ff
add r11d, r9d
mov eax, ebx
shr eax, 8
and eax, 0xff00ff
sub r8d, eax
mov eax, ebx
shl eax, 8
shl r8d, 8
or r8d, eax
mov eax, r11d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, ebx
or edx, r11d
shr eax, 8
xor r8d, edx
shl ebx, 8
and eax, 0xff00ff
mov edx, 0x100
sub edx, eax
and r8d, 0xff00ff
shl edx, 8
or edx, ebx
xor r8d, edx
mov dword [rdi], r8d
jmp 0x140039bea
imul edi, dword [rsi + 0x10]
movsxd rbx, eax
mov eax, ecx
sub eax, dword [rsi + 0x14]
add rbx, qword [rsi + 0x20]
cdq
idiv dword [r8 + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [r8 + 0x18]
sar edi, 8
movsxd r8, edx
mov edx, 0x100
mov r9d, dword [r8 + rax]
mov r11d, r9d
shr r11d, 8
and r9d, 0xff00ff
and r11d, 0xff00ff
imul r9d, edi
imul r11d, edi
mov r8d, 0x100
shr r9d, 8
shr r11d, 8
and r9d, 0xff00ff
and r11d, 0xff00ff
mov eax, r11d
shr eax, 0x10
sub edx, eax
mov eax, dword [rbx]
mov r10d, eax
shr eax, 8
and eax, 0xff00ff
and r10d, 0xff00ff
imul eax, edx
imul r10d, edx
mov edx, 0x100
shr eax, 8
and eax, 0xff00ff
shr r10d, 8
add r11d, eax
and r10d, 0xff00ff
add r10d, r9d
mov eax, r11d
shr eax, 8
and eax, 0xff00ff
sub r8d, eax
mov eax, r11d
shl eax, 8
shl r8d, 8
or r8d, eax
mov eax, r10d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r11d
or edx, r10d
shr eax, 8
xor r8d, edx
shl r11d, 8
and eax, 0xff00ff
mov edx, 0x100
sub edx, eax
and r8d, 0xff00ff
shl edx, 8
or edx, r11d
xor r8d, edx
mov dword [rbx], r8d
test r15d, r15d
jle 0x140039e23
inc ecx
sub ebp, ecx
test ebp, ebp
jle 0x140039e23
mov rax, qword [rsi]
mov ebx, r15d
imul ebx, dword [rsi + 0x10]
movsxd rdx, dword [rax + 0x18]
mov eax, edx
imul eax, ecx
sub ecx, dword [rsi + 0x14]
sar ebx, 8
movsxd r11, eax
add r11, qword [rsi + 0x20]
cmp ebx, 0xfe
jge 0x140039d37
mov rdi, rdx
nop
mov r8, qword [rsi + 8]
mov eax, ecx
cdq
inc ecx
dec ebp
idiv dword [r8 + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [r8 + 0x18]
mov r8d, dword [r11]
movsxd rdx, edx
mov r9d, dword [rdx + rax]
mov r10d, r9d
shr r10d, 8
and r9d, 0xff00ff
and r10d, 0xff00ff
imul r9d, ebx
imul r10d, ebx
mov edx, 0x100
shr r9d, 8
shr r10d, 8
and r9d, 0xff00ff
and r10d, 0xff00ff
mov eax, r10d
shr eax, 0x10
sub edx, eax
mov eax, r8d
and eax, 0xff00ff
shr r8d, 8
imul eax, edx
and r8d, 0xff00ff
imul r8d, edx
mov edx, 0x100
shr eax, 8
and eax, 0xff00ff
shr r8d, 8
add r9d, eax
and r8d, 0xff00ff
add r10d, r8d
mov r8d, 0x100
mov eax, r10d
shr eax, 8
and eax, 0xff00ff
sub r8d, eax
mov eax, r10d
shl eax, 8
shl r8d, 8
or r8d, eax
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r10d
or edx, r9d
shr eax, 8
xor r8d, edx
shl r10d, 8
and eax, 0xff00ff
and r8d, 0xff00ff
mov edx, 0x100
sub edx, eax
shl edx, 8
or edx, r10d
xor r8d, edx
mov dword [r11], r8d
add r11, rdi
test ebp, ebp
jg 0x140039c30
jmp 0x140039e23
mov rbx, rdx
nop word [rax + rax]
mov r8, qword [rsi + 8]
mov eax, ecx
cdq
inc ecx
dec ebp
idiv dword [r8 + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [r8 + 0x18]
movsxd rdx, edx
mov r8d, dword [rdx + rax]
mov r10d, r8d
and r8d, 0xff00ff
shr r10d, 8
and r10d, 0xff00ff
mov edx, 0x100
mov eax, r10d
shr eax, 0x10
sub edx, eax
mov eax, dword [r11]
mov r9d, eax
shr eax, 8
and eax, 0xff00ff
and r9d, 0xff00ff
imul eax, edx
imul r9d, edx
mov edx, 0x100
shr eax, 8
and eax, 0xff00ff
shr r9d, 8
add r10d, eax
and r9d, 0xff00ff
add r9d, r8d
mov eax, r10d
shr eax, 8
mov r8d, 0x100
and eax, 0xff00ff
sub r8d, eax
mov eax, r10d
shl eax, 8
shl r8d, 8
or r8d, eax
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r10d
or edx, r9d
shr eax, 8
xor r8d, edx
shl r10d, 8
and eax, 0xff00ff
and r8d, 0xff00ff
mov edx, 0x100
sub edx, eax
shl edx, 8
or edx, r10d
xor r8d, edx
mov dword [r11], r8d
add r11, rbx
test ebp, ebp
jg 0x140039d40
movzx r8d, r12b
imul r8d, r15d
sub r13d, 1
mov r9d, r12d
jns 0x140039980
mov r10, qword [rsi]
mov rbx, qword [rsi + 8]
mov edi, dword [rsp + 0x50]
mov r15, qword [rsp + 0x40]
mov eax, r8d
cdq
movzx edx, dl
add eax, edx
sar eax, 8
mov r11d, eax
test eax, eax
jle 0x14003a06a
mov eax, r9d
cdq
movzx edx, dl
add eax, edx
sar eax, 8
mov edx, eax
cmp r11d, 0xff
jl 0x140039f72
sub edx, dword [rsi + 0x14]
mov ecx, eax
imul ecx, dword [r10 + 0x18]
mov eax, edx
cdq
idiv dword [rbx + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [rbx + 0x18]
movsxd r11, ecx
add r11, qword [rsi + 0x20]
movsxd rcx, edx
mov edx, dword [r11]
mov r9d, dword [rcx + rax]
mov r10d, r9d
shr r10d, 8
and r9d, 0xff00ff
imul r9d, dword [rsi + 0x10]
and r10d, 0xff00ff
imul r10d, dword [rsi + 0x10]
mov ecx, 0x100
shr r9d, 8
shr r10d, 8
and r9d, 0xff00ff
and r10d, 0xff00ff
mov eax, r10d
shr eax, 0x10
sub ecx, eax
mov eax, edx
and eax, 0xff00ff
shr edx, 8
imul eax, ecx
and edx, 0xff00ff
imul edx, ecx
mov ecx, 0x100
shr eax, 8
and eax, 0xff00ff
shr edx, 8
add r9d, eax
and edx, 0xff00ff
add r10d, edx
mov edx, 0x100
mov eax, r10d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r10d
shl eax, 8
shl edx, 8
or edx, eax
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r10d
or ecx, r9d
shr eax, 8
xor edx, ecx
shl r10d, 8
and eax, 0xff00ff
mov ecx, 0x100
sub ecx, eax
and edx, 0xff00ff
shl ecx, 8
or ecx, r10d
xor edx, ecx
mov dword [r11], edx
jmp 0x14003a06a
imul eax, dword [r10 + 0x18]
sub edx, dword [rsi + 0x14]
imul r11d, dword [rsi + 0x10]
movsxd r10, eax
mov eax, edx
add r10, qword [rsi + 0x20]
cdq
idiv dword [rbx + 0x1c]
mov rax, qword [rsi + 0x28]
imul edx, dword [rbx + 0x18]
sar r11d, 8
movsxd rcx, edx
mov edx, dword [r10]
mov r8d, dword [rcx + rax]
mov r9d, r8d
shr r9d, 8
and r8d, 0xff00ff
and r9d, 0xff00ff
imul r8d, r11d
imul r9d, r11d
mov ecx, 0x100
shr r8d, 8
shr r9d, 8
and r8d, 0xff00ff
and r9d, 0xff00ff
mov eax, r9d
shr eax, 0x10
sub ecx, eax
mov eax, edx
and eax, 0xff00ff
shr edx, 8
imul eax, ecx
and edx, 0xff00ff
imul edx, ecx
mov ecx, 0x100
shr eax, 8
and eax, 0xff00ff
shr edx, 8
add r8d, eax
and edx, 0xff00ff
add r9d, edx
mov edx, 0x100
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r9d
shl eax, 8
shl edx, 8
or edx, eax
mov eax, r8d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r9d
or ecx, r8d
shr eax, 8
xor edx, ecx
shl r9d, 8
and eax, 0xff00ff
mov ecx, 0x100
sub ecx, eax
and edx, 0xff00ff
shl ecx, 8
or ecx, r9d
xor edx, ecx
mov dword [r10], edx
mov rcx, qword [rsp + 0x58]
inc edi
mov dword [rsp + 0x50], edi
cmp edi, dword [r15 + 0x14]
jl 0x140039910
mov r14, qword [rsp]
mov r13, qword [rsp + 8]
mov r12, qword [rsp + 0x10]
mov rbp, qword [rsp + 0x18]
mov rbx, qword [rsp + 0x48]
add rsp, 0x20
pop r15
pop rdi
pop rsi
ret