Function at 0x1400850a0
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x20], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov r15, rdx
mov rsi, rcx
cmp byte [rcx + 0x5d], 0
jne 0x140085212
mov r10, qword [rcx + 0x10]
mov r8, qword [rcx + 8]
mov rax, r10
sub rax, r8
cmp rax, 2
jb 0x140085212
xor r13d, r13d
mov r14d, 4
lea edi, [r14 + 4]
movzx r9d, byte [r8]
movzx ebx, r9b
shr bl, 7
mov byte [rbp - 0x1c], bl
and r9d, 0xf
mov dword [rbp - 0x18], r9d
movzx edx, byte [r8 + 1]
movzx eax, dl
shr al, 7
movzx r11d, al
mov byte [rbp - 0x1b], r11b
and edx, 0x7f
mov dword [rbp - 0x14], edx
mov ecx, r13d
cmp edx, 0x7f
cmove ecx, edi
mov eax, 2
cmp edx, 0x7e
cmove eax, r14d
add ecx, eax
lea eax, [rcx + r11*4]
mov dword [rbp - 0x20], eax
sub r10, r8
mov r12d, eax
cmp r10, r12
jb 0x140085212
mov rcx, r13
cmp edx, 0x7e
jae 0x140085164
mov edi, edx
mov qword [rbp - 0x10], rdi
lea ecx, [r14 - 2]
jmp 0x14008522e
jne 0x140085183
movzx edi, byte [r8 + 2]
shl rdi, 8
movzx eax, byte [r8 + 3]
or rdi, rax
mov qword [rbp - 0x10], rdi
mov rcx, r14
jmp 0x14008522e
cmp edx, 0x7f
jne 0x14008522a
movzx edi, byte [r8 + 2]
shl rdi, 8
movzx eax, byte [r8 + 3]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 4]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 5]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 6]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 7]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 8]
or rdi, rax
shl rdi, 8
movzx eax, byte [r8 + 9]
or rdi, rax
mov qword [rbp - 0x10], rdi
lea ecx, [rdx - 0x75]
jge 0x14008522e
mov byte [rsi + 0x5d], 1
lea ecx, [rdx - 0x7d]
call fcn.1400fa208
mov rcx, rax
lea rdx, str.ERROR:_Frame_has_invalid_frame_length._Closing._n
call fcn.140084a90
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x30]
mov rbx, qword [rsp + 0xc8]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rdi, qword [rbp - 0x10]
test r11b, r11b
je 0x140085258
movzx eax, byte [rcx + r8]
mov byte [rbp - 8], al
movzx eax, byte [rcx + r8 + 1]
mov byte [rbp - 7], al
movzx eax, byte [rcx + r8 + 2]
mov byte [rbp - 6], al
movzx eax, byte [rcx + r8 + 3]
mov byte [rbp - 5], al
jmp 0x14008525f
mov dword [rbp - 8], 0
lea rax, [r12 + rdi]
cmp r10, rax
jb 0x140085212
cmp r9d, 2
jbe 0x1400853f1
cmp r9d, 9
jne 0x1400853ac
test r11b, r11b
je 0x1400852b1
mov rax, r13
test rdi, rdi
je 0x1400852b1
nop dword [rax]
lea r8, [rax + r12]
add r8, qword [rsi + 8]
movzx edx, byte [r8]
mov rcx, rax
and ecx, 3
xor dl, byte [rbp + rcx - 8]
mov byte [r8], dl
inc rax
cmp rax, rdi
jne 0x140085290
mov rbx, qword [rsi + 8]
add rbx, r12
lea r14, [rbx + rdi]
mov qword [rbp - 0x40], r13
mov qword [rbp - 0x30], r13
mov qword [rbp - 0x28], setsockopt
mov byte [rbp - 0x40], 0
mov rdx, r14
sub rdx, rbx
lea rcx, [rbp - 0x40]
call fcn.140069fd0
lea rax, [rbp - 0x40]
mov qword [rbp + 0x40], rax
cmp rbx, r14
je 0x140085332
nop dword [rax]
movzx r9d, byte [rbx]
mov rcx, qword [rbp - 0x30]
mov rdx, qword [rbp - 0x28]
cmp rcx, rdx
jae 0x140085321
lea rax, [rcx + 1]
mov qword [rbp - 0x30], rax
lea rax, [rbp - 0x40]
cmp rdx, 0x10
cmovae rax, qword [rbp - 0x40]
mov byte [rax + rcx], r9b
mov byte [rax + rcx + 1], 0
jmp 0x14008532a
lea rcx, [rbp - 0x40]
call fcn.1400734a0
inc rbx
cmp rbx, r14
jne 0x1400852f0
lea rax, [rbp - 0x40]
cmp qword [rbp - 0x28], 0x10
cmovae rax, qword [rbp - 0x40]
mov r8, qword [rbp - 0x30]
add rax, r8
lea r9, [rbp - 0x40]
cmp qword [rbp - 0x28], 0x10
cmovae r9, qword [rbp - 0x40]
mov qword [rsp + 0x20], rax
mov edx, 0xa
mov rcx, rsi
call fcn.140086150
nop
mov rdx, qword [rbp - 0x28]
cmp rdx, 0x10
jb 0x14008559e
inc rdx
mov rcx, qword [rbp - 0x40]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400853a2
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400855f1
call fcn.1400f29ec
jmp 0x14008559e
cmp r9d, 0xa
je 0x14008559e
cmp r9d, 8
jne 0x1400853ca
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x30]
jmp 0x14008559e
mov ecx, 2
call fcn.1400fa208
mov rcx, rax
lea rdx, str.ERROR:_Got_unexpected_WebSocket_message._n
call fcn.140084a90
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x30]
jmp 0x14008559e
test r11b, r11b
je 0x14008541f
mov r8, r13
test rdi, rdi
je 0x14008541f
nop
lea rdx, [r12 + r8]
add rdx, qword [rsi + 8]
movzx ecx, byte [rdx]
mov rax, r8
and eax, 3
xor cl, byte [rbp + rax - 8]
mov byte [rdx], cl
inc r8
cmp r8, rdi
jne 0x140085400
lea r14, [rsi + 0x38]
mov r8, qword [rsi + 8]
add r8, r12
lea r9, [r8 + rdi]
mov rdx, qword [rsi + 0x40]
mov rcx, r14
call fcn.1400867a0
test bl, bl
je 0x14008559e
mov rax, qword [r15]
mov rax, qword [rax]
mov qword [rbp + 0x50], rax
xorps xmm0, xmm0
movdqu xmmword [rbp - 0x40], xmm0
mov qword [rbp - 0x30], r13
mov r13, qword [r14]
mov rax, qword [r14 + 8]
mov qword [rbp + 0x40], rax
cmp r13, rax
je 0x1400854e4
mov r15, rax
sub r15, r13
cmp r15, 0x1000
jb 0x1400854a0
lea rcx, [r15 + 0x27]
cmp rcx, r15
jbe 0x1400855f7
call fcn.1400f2760
test rax, rax
je 0x1400855e5
lea rbx, [rax + 0x27]
and rbx, 0xffffffffffffffe0
mov qword [rbx - 8], rax
jmp 0x1400854b4
test r15, r15
je 0x1400854b2
mov rcx, r15
call fcn.1400f2760
mov rbx, rax
jmp 0x1400854b4
xor ebx, ebx
mov qword [rbp - 0x40], rbx
mov qword [rbp - 0x38], rbx
lea rax, [rbx + r15]
mov qword [rbp - 0x30], rax
mov r8, r15
mov rdx, r13
mov rcx, rbx
call fcn.1400f4c00
sub rbx, r13
mov rax, qword [rbp + 0x40]
add rax, rbx
mov qword [rbp - 0x38], rax
mov r15, qword [rbp + 0x48]
lea rdx, [rbp - 0x40]
mov rcx, r15
call qword [rbp + 0x50]
nop
mov rcx, qword [rbp - 0x40]
test rcx, rcx
je 0x140085529
mov rdx, qword [rbp - 0x30]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140085524
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400855e5
call fcn.1400f29ec
mov rdx, qword [rsi + 0x40]
mov r15, qword [r14]
cmp r15, rdx
je 0x14008554e
mov rbx, rdx
sub rbx, rdx
mov r8, rbx
mov rcx, r15
call fcn.1400f4c00
lea rax, [rbx + r15]
mov qword [rsi + 0x40], rax
lea rax, [rbp - 0x40]
xor r13d, r13d
cmp rax, r14
je 0x14008559a
mov rcx, qword [r14]
mov qword [r14], r13
mov qword [r14 + 8], r13
mov rdx, qword [r14 + 0x10]
mov qword [r14 + 0x10], r13
test rcx, rcx
je 0x14008559a
sub rdx, rcx
cmp rdx, 0x1000
jb 0x140085595
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x1400855eb
mov rcx, r8
call fcn.1400f29ec
mov r15, qword [rbp + 0x48]
mov r14, qword [rsi + 8]
lea rdx, [r14 + r12]
add rdx, rdi
cmp r14, rdx
je 0x1400855c8
mov rbx, qword [rsi + 0x10]
sub rbx, rdx
mov r8, rbx
mov rcx, r14
call fcn.1400f4c00
lea rax, [rbx + r14]
mov qword [rsi + 0x10], rax
mov r10, qword [rsi + 0x10]
mov r8, qword [rsi + 8]
mov rax, r10
sub rax, r8
cmp rax, 2
jb 0x140085212
jmp 0x1400850e7
call fcn.140104ed8
int3
call fcn.140104ed8
int3
call fcn.140104ed8
int3
call fcn.140016be0
int3