Function at 0x1402488d0
Capabilities:
Encode data using xor
Encrypt data using salsa20 or chacha

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
mov rdi, rdx
mov esi, ecx
cmp byte [reloc.WS2_32.dll_accept], 0
je 0x140248d5d
mov rax, qword [0x14041afe8]
mov ecx, 5
call qword [case.0x1403339d6.0]
mov rbx, rax
test rax, rax
sete bpl
je 0x140248d72
mov rax, qword [0x14041aff8]
mov rcx, rbx
call qword [case.0x1403339d6.0]
test esi, esi
jle 0x140248d4e
test rdi, rdi
je 0x140248d4e
xor ebp, ebp
cmp dword [0x1404679d8], 0
je 0x140248c9a
mov al, byte [0x140467a58]
movzx ecx, al
cmp ecx, esi
jb 0x1402489a6
sub ecx, esi
movsxd rax, ecx
lea rcx, [0x1404679d8]
lea rdx, [rax + rcx]
add rdx, 0x40
cmp esi, 4
jne 0x140248d9a
mov eax, dword [rdx]
mov dword [rdi], eax
sub byte [0x140467a58], sil
test bpl, bpl
jne 0x140248d89
mov rax, qword [0x14041b008]
mov rdx, qword [case.0x1403339d6.0]
mov rcx, rbx
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp rdx
mov qword [rsp + 0x40], rbx
mov dword [rsp + 0x2c], ebp
test al, al
jne 0x140248daa
mov qword [rsp + 0x38], rdi
mov dword [rsp + 0x28], esi
mov eax, dword [0x140467a08]
inc eax
mov dword [0x140467a08], eax
mov r9d, dword [0x1404679d8]
mov esi, dword [0x1404679dc]
mov ebx, dword [0x1404679e0]
mov ebp, dword [0x1404679e4]
mov edi, dword [0x1404679e8]
mov r14d, dword [0x1404679ec]
mov r13d, dword [0x1404679f0]
mov r12d, dword [0x1404679f4]
mov r15d, dword [0x1404679f8]
mov r10d, dword [0x1404679fc]
mov ecx, dword [0x140467a00]
mov dword [rsp + 0x20], ecx
mov ecx, dword [0x140467a04]
mov dword [rsp + 0x24], ecx
mov r8d, dword [0x140467a0c]
mov edx, dword [0x140467a10]
mov dword [rsp + 0x30], 0xa
mov ecx, dword [0x140467a14]
add r9d, edi
xor eax, r9d
rol eax, 0x10
add r15d, eax
xor edi, r15d
rol edi, 0xc
add r9d, edi
xor eax, r9d
rol eax, 8
add r15d, eax
xor edi, r15d
rol edi, 7
add esi, r14d
xor r8d, esi
rol r8d, 0x10
add r10d, r8d
xor r14d, r10d
rol r14d, 0xc
add esi, r14d
xor r8d, esi
rol r8d, 8
add r10d, r8d
mov dword [rsp + 0x34], r10d
xor r14d, r10d
rol r14d, 7
add ebx, r13d
xor edx, ebx
rol edx, 0x10
mov r11d, dword [rsp + 0x20]
add r11d, edx
xor r13d, r11d
rol r13d, 0xc
add ebx, r13d
xor edx, ebx
rol edx, 8
add r11d, edx
xor r13d, r11d
rol r13d, 7
add ebp, r12d
xor ecx, ebp
rol ecx, 0x10
mov r10d, dword [rsp + 0x24]
add r10d, ecx
xor r12d, r10d
rol r12d, 0xc
add ebp, r12d
xor ecx, ebp
rol ecx, 8
add r10d, ecx
xor r12d, r10d
rol r12d, 7
add r9d, r14d
xor ecx, r9d
rol ecx, 0x10
add r11d, ecx
xor r14d, r11d
rol r14d, 0xc
add r9d, r14d
xor ecx, r9d
rol ecx, 8
add r11d, ecx
mov dword [rsp + 0x20], r11d
xor r14d, r11d
rol r14d, 7
add esi, r13d
xor eax, esi
rol eax, 0x10
add r10d, eax
xor r13d, r10d
rol r13d, 0xc
add esi, r13d
xor eax, esi
rol eax, 8
add r10d, eax
mov dword [rsp + 0x24], r10d
xor r13d, r10d
rol r13d, 7
add ebx, r12d
xor r8d, ebx
rol r8d, 0x10
add r15d, r8d
xor r12d, r15d
rol r12d, 0xc
add ebx, r12d
xor r8d, ebx
rol r8d, 8
add r15d, r8d
xor r12d, r15d
rol r12d, 7
add ebp, edi
xor edx, ebp
rol edx, 0x10
mov r11d, dword [rsp + 0x34]
add r11d, edx
xor edi, r11d
rol edi, 0xc
add ebp, edi
xor edx, ebp
rol edx, 8
add r11d, edx
mov r10d, r11d
xor edi, r11d
rol edi, 7
dec dword [rsp + 0x30]
jne 0x140248a3f
add r9d, dword [0x1404679d8]
mov dword [0x140467a18], r9d
add esi, dword [0x1404679dc]
mov dword [0x140467a1c], esi
add ebx, dword [0x1404679e0]
mov dword [0x140467a20], ebx
add ebp, dword [0x1404679e4]
mov dword [0x140467a24], ebp
add edi, dword [0x1404679e8]
mov dword [0x140467a28], edi
add r14d, dword [0x1404679ec]
mov dword [0x140467a2c], r14d
add r13d, dword [0x1404679f0]
mov dword [0x140467a30], r13d
add r12d, dword [0x1404679f4]
mov dword [0x140467a34], r12d
add r15d, dword [0x1404679f8]
mov dword [0x140467a38], r15d
add r10d, dword [0x1404679fc]
mov dword [0x140467a3c], r10d
mov r9d, dword [rsp + 0x20]
add r9d, dword [0x140467a00]
mov dword [0x140467a40], r9d
mov r9d, dword [rsp + 0x24]
add r9d, dword [0x140467a04]
mov dword [0x140467a44], r9d
add eax, dword [0x140467a08]
mov dword [0x140467a48], eax
add r8d, dword [0x140467a0c]
mov dword [0x140467a4c], r8d
add edx, dword [0x140467a10]
mov dword [0x140467a50], edx
add ecx, dword [0x140467a14]
mov dword [0x140467a54], ecx
mov byte [0x140467a58], 0x40
mov ecx, 0x40
mov al, 0x40
mov esi, dword [rsp + 0x28]
cmp esi, 0x40
mov rdi, qword [rsp + 0x38]
mov rbx, qword [rsp + 0x40]
mov ebp, dword [rsp + 0x2c]
jle 0x140248951
jmp 0x1402489af
cmp byte [reloc.WS2_32.dll_accept], 0
je 0x140248dd7
mov rax, qword [0x14041afe8]
mov ecx, 2
call qword [case.0x1403339d6.0]
test rax, rax
je 0x140248dd7
mov r15, rax
mov rax, qword [0x14041aff8]
mov rcx, r15
call qword [case.0x1403339d6.0]
mov r14, qword [0x1404679b0]
mov rax, qword [0x14041b008]
mov rcx, r15
call qword [case.0x1403339d6.0]
movaps xmm0, xmmword [str.expand_32_byte_k]
movups xmmword [0x1404679d8], xmm0
test r14, r14
je 0x140248de3
mov eax, dword [0x14041b128]
test eax, eax
jne 0x140248dfd
mov rax, qword [r14 + 0x68]
lea r8, [0x1404679e8]
mov rcx, r14
mov edx, 0x2c
call qword [case.0x1403339d6.0]
mov eax, dword [0x140467a08]
mov dword [0x140467a14], eax
mov dword [0x140467a08], 0
mov byte [0x140467a58], 0
xor eax, eax
jmp 0x14024894a
mov dword [0x1404679d8], 0
jmp 0x140248982
test esi, esi
jle 0x140248d7f
test rdi, rdi
je 0x140248d7f
mov eax, esi
xor ebx, ebx
mov bpl, 1
jmp 0x140248937
test esi, esi
jle 0x140248d7f
test rdi, rdi
jne 0x140248937
mov dword [0x1404679d8], 0
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
movsxd r8, esi
mov rcx, rdi
call fcn.140336540
jmp 0x140248972
movzx r8d, al
mov rcx, rdi
lea rdx, [0x140467a18]
call fcn.140336540
movzx eax, byte [0x140467a58]
sub esi, eax
mov dword [rsp + 0x28], esi
add rdi, rax
mov qword [rsp + 0x38], rdi
jmp 0x1402489c0
mov r14, qword [0x1404679b0]
jmp 0x140248cec
xorps xmm0, xmm0
movups xmmword [0x140467a04], xmm0
movups xmmword [0x1404679f8], xmm0
movups xmmword [0x1404679e8], xmm0
jmp 0x140248e1f
xorps xmm0, xmm0
movups xmmword [0x1404679fc], xmm0
movups xmmword [0x1404679ec], xmm0
mov qword [0x140467a0c], 0
mov dword [0x1404679e8], eax
xor eax, eax
jmp 0x140248d30