Function at 0x140007850
Capabilities:
Encode data using xor
Encrypt or decrypt data via bcrypt
Generate random numbers via winapi

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x7a0]
sub rsp, 0x8a0
mov rax, qword [0x1400f3e08]
xor rax, rsp
mov qword [rbp + 0x790], rax
mov rdi, qword [rdx]
xor r13d, r13d
test byte [0x1400f8b3d], 0x40
mov ebx, ecx
mov r15, qword [rdx + 0x58]
mov qword [rsp + 0x60], rdi
lea r12d, [r13 + 4]
je 0x1400078f8
lea rax, [rbp + 0x570]
mov dword [rbp + 0x578], ecx
mov qword [rbp + 0x5f0], rax
lea r9d, [r13 + 3]
lea rax, [rbp + 0x578]
mov qword [rbp + 0x570], rdi
mov qword [rbp + 0x600], rax
lea rdx, [0x1400d04a8]
lea rax, [rbp + 0x5e0]
mov qword [rbp + 0x5f8], 8
mov qword [rsp + 0x20], rax
mov qword [rbp + 0x608], r12
call fcn.140001460
mov rax, qword [r15 + 8]
lea rdx, [rbp + 0x610]
mov rcx, qword [rdi + 0x20]
mov qword [rbp + 0x610], rax
mov dword [rbp + 0x618], r13d
call fcn.1400584f0
mov r14, rax
test rax, rax
jne 0x140007989
test byte [0x1400f8b38], 2
je 0x1400082db
lea rax, str.stateless_send_data
mov qword [rbp + 0x570], r13
mov qword [rbp + 0x5f0], rax
lea r9d, [r14 + 3]
lea rax, [rbp + 0x570]
mov qword [rbp + 0x5f8], reloc.OLEAUT32.dll_SafeArrayLock
mov qword [rbp + 0x600], rax
lea rdx, [0x1400d0050]
lea rax, [rbp + 0x5e0]
mov qword [rbp + 0x608], 8
mov qword [rsp + 0x20], rax
call fcn.140001460
jmp 0x1400082db
mov qword [rsp + 0x8d0], rsi
cmp ebx, 9
jne 0x140007ba2
test qword [0x1400f7490], 0x40000000
je 0x1400079b8
mov rax, qword [0x1400f7498]
mov r13, qword [rax + 8]
mov r12d, dword [rax + 0x1c]
jmp 0x1400079bf
lea r13, [0x1400d1488]
movzx eax, byte [r15 + 0x57]
movzx ebx, r12w
shl bx, 2
add bx, ax
movzx eax, byte [r15 + 0x56]
add ax, 0xb
add bx, ax
cmp word [r14], 1
jne 0x1400079f2
movzx edx, bx
mov rcx, r14
call fcn.140063b80
mov rsi, rax
jmp 0x1400079fb
lea rsi, [r14 + 8]
movzx eax, bx
mov dword [rsi], eax
test rsi, rsi
jne 0x140007a7b
test byte [0x1400f8b38], 2
je 0x140007a63
movzx eax, bx
mov qword [rbp + 0x570], rax
lea rax, str.vn_datagram
mov qword [rbp + 0x5f8], SafeArrayLock
mov qword [rbp + 0x5f0], rax
lea rdx, [0x1400d0050]
lea rax, [rbp + 0x570]
mov qword [rbp + 0x608], 8
mov qword [rbp + 0x600], rax
mov r9d, 3
lea rax, [rbp + 0x5e0]
mov qword [rsp + 0x20], rax
call fcn.140001460
cmp word [r14], 1
jne 0x1400082bf
mov rcx, r14
call fcn.140063940
jmp 0x1400082d3
mov rbx, qword [rsi + 8]
or byte [rbx], 0x80
lea rdi, [rbx + 6]
mov dword [rbx + 1], 0
mov rcx, rdi
movzx eax, byte [r15 + 0x57]
mov byte [rbx + 5], al
movzx r8d, byte [r15 + 0x57]
mov rdx, qword [r15 + 0x48]
call fcn.140081340
movzx eax, byte [r15 + 0x57]
add rdi, rax
movzx eax, byte [r15 + 0x56]
mov byte [rdi], al
inc rdi
movzx r8d, byte [r15 + 0x56]
mov rcx, rdi
mov rdx, qword [r15 + 0x40]
call fcn.140081340
movzx eax, byte [r15 + 0x56]
lea rdx, [rbp + 0x569]
mov r9d, 2
mov byte [rbp + 0x569], 0
xor ecx, ecx
add rdi, rax
lea r8d, [r9 - 1]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
movzx eax, byte [rbp + 0x569]
lea rcx, [rdi + 4]
xor al, byte [rbx]
mov rdx, r13
and al, 0x7f
mov r8d, r12d
xor byte [rbx], al
mov rax, qword [rsp + 0x60]
shl r8, 2
mov eax, dword [rax + 0x18]
mov dword [rdi], eax
call fcn.140081340
and byte [r15 + 0x5d], 0xfe
test byte [0x1400f8b3e], 0x80
je 0x1400082a1
mov rbx, 0xffffffffffffffff
lea r9, str._S__TX_____VN
mov r8, rbx
lea rcx, [rbp + 0x660]
mov edx, 0x80
call fcn.1400015d0
lea rax, [rbp + 0x660]
inc rbx
cmp byte [rax + rbx], 0
jne 0x140007b56
lea rax, [rbp + 0x660]
mov dword [rbp + 0x62c], 0
mov qword [rbp + 0x620], rax
lea rdx, [0x1400d0798]
lea rax, [rbp + 0x610]
inc ebx
mov r9d, 2
mov qword [rsp + 0x20], rax
mov dword [rbp + 0x628], ebx
call fcn.140001460
jmp 0x1400082a1
cmp ebx, 0xa
jne 0x140007db6
lea r9d, [rbx - 8]
xor ecx, ecx
lea r8d, [rbx - 9]
lea rdx, [rbp + 0x568]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
movzx eax, byte [rbp + 0x568]
movzx edx, word [r15 + 0x50]
shr al, 5
add al, 0x29
movzx ecx, al
mov byte [rbp + 0x568], cl
movzx eax, cl
cmp cx, dx
jb 0x140007bf0
lea eax, [rdx - 1]
movzx ecx, al
mov byte [rbp + 0x568], al
cmp al, 0x15
jb 0x140007a63
cmp word [r14], 1
movzx edx, al
jne 0x140007c16
mov rcx, r14
call fcn.140063b80
movzx ecx, byte [rbp + 0x568]
mov rsi, rax
jmp 0x140007c1c
lea rsi, [r14 + 8]
mov dword [rsi], edx
test rsi, rsi
jne 0x140007c4f
test byte [0x1400f8b38], 2
je 0x140007a63
movzx eax, cl
mov qword [rbp + 0x570], rax
lea rax, str.reset_datagram
mov qword [rbp + 0x5f8], SafeArrayGetElement
jmp 0x140007a25
mov rbx, qword [rsi + 8]
mov r9d, 2
movzx r8d, cl
mov rdx, rbx
sub r8d, 0x10
xor ecx, ecx
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
movzx edx, byte [rbx]
and dl, 0x3f
or dl, 0x40
mov byte [rbx], dl
movzx ecx, dl
mov rax, qword [r15 + 0x38]
xor cl, byte [rax]
and cl, r12b
xor cl, dl
mov byte [rbx], cl
movzx ecx, byte [rbp + 0x568]
mov rdx, qword [rsi + 8]
add rcx, 0xfffffffffffffff0
add rdx, rcx
mov rcx, qword [r15 + 0x40]
call fcn.140005a90
test byte [0x1400f8b3e], 0x80
je 0x140007da4
movzx ecx, byte [rbp + 0x568]
xor edx, edx
mov rdi, qword [rsi + 8]
add rcx, 0xfffffffffffffff0
add rdi, rcx
mov r8d, 0x1ff
lea rcx, [rsp + 0x68]
call fcn.1400819f0
xor r8b, r8b
mov ebx, 0x57
nop dword [rax + rax]
movzx ecx, byte [rdi]
lea rdi, [rdi + 1]
shr cl, 4
mov eax, 0x30
movzx edx, r8b
add rdx, rdx
cmp cl, 0xa
cmovae eax, ebx
add al, cl
mov byte [rsp + rdx + 0x68], al
mov eax, 0x30
movzx ecx, byte [rdi - 1]
and cl, 0xf
cmp cl, 0xa
cmovae eax, ebx
inc r8b
add al, cl
mov byte [rsp + rdx + 0x69], al
cmp r8b, 0x10
jb 0x140007ce0
lea rax, [rsp + 0x68]
mov byte [rbp - 0x78], r13b
mov rbx, 0xffffffffffffffff
mov qword [rsp + 0x20], rax
mov r8, rbx
lea r9, str._S__TX_____SR__s
mov edx, 0x80
lea rcx, [rbp + 0x660]
call fcn.1400015d0
lea rax, [rbp + 0x660]
nop word [rax + rax]
inc rbx
cmp byte [rax + rbx], r13b
jne 0x140007d60
lea rax, [rbp + 0x660]
mov dword [rbp + 0x64c], r13d
mov qword [rbp + 0x640], rax
lea rdx, [0x1400d0798]
lea rax, [rbp + 0x630]
inc ebx
mov r9d, 2
mov qword [rsp + 0x20], rax
mov dword [rbp + 0x648], ebx
call fcn.140001460
call fcn.140001640
lock inc qword [rax + 0x1c0]
jmp 0x1400082a1
cmp ebx, 0xb
jne 0x140007a63
cmp word [rax], 1
jne 0x140007dd7
mov edx, 0x93
mov rcx, r14
call fcn.140063b80
mov rsi, rax
jmp 0x140007de1
lea rsi, [rax + 8]
mov dword [rsi], 0x93
test rsi, rsi
jne 0x140007e15
test byte [0x1400f8b38], 2
je 0x140007a63
mov qword [rbp + 0x570], 0x93
lea rax, str.retry_datagram
mov qword [rbp + 0x5f8], SafeArrayGetElement
jmp 0x140007a25
mov r9d, 2
lea rdx, [rbp + 0x650]
xor ecx, ecx
lea r8d, [r9 + 0xc]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
xorps xmm0, xmm0
mov qword [rbp + 0x598], r13
xorps xmm1, xmm1
movdqa xmmword [rbp + 0x5a0], xmm0
movdqa xmmword [rbp + 0x5b0], xmm1
movdqa xmmword [rbp + 0x5c0], xmm0
movdqa xmmword [rbp + 0x5d0], xmm1
call fcn.140001400
movzx ebx, byte [r15 + 0x56]
lea rcx, [rbp + 0x5b4]
mov rdx, qword [r15 + 0x40]
add rax, rax
mov qword [rbp + 0x590], rax
mov r8d, ebx
mov rax, qword [r15 + 8]
movups xmm0, xmmword [rax + 8]
movups xmmword [rbp + 0x598], xmm0
movsd xmm1, qword [rax + 0x18]
movsd qword [rbp + 0x5a8], xmm1
mov eax, dword [rax + 0x20]
mov dword [rbp + 0x5b0], eax
call fcn.140081340
movzx r10d, byte [0x1400f757c]
mov byte [rbp + 0x5c8], bl
cmp r10b, 0xc
jb 0x140007f28
movsd xmm0, qword [rbp + 0x650]
mov r8b, 0xc
mov eax, dword [rbp + 0x658]
movsd qword [rbp + 0x6e0], xmm0
mov dword [rbp + 0x6e8], eax
jbe 0x140007f4d
lea r9, [rbp + 0x65c]
nop dword [rax]
nop word [rax + rax]
movzx ecx, r8b
lea r9, [r9 + 1]
mov eax, 0xaaaaaaab
inc r8b
mul ecx
shr edx, 3
lea eax, [rdx + rdx*2]
shl eax, 2
sub ecx, eax
movsxd rax, ecx
lea rcx, [rbp + 0x6e0]
add rcx, rax
movzx eax, byte [r9 - 1]
xor byte [rcx], al
cmp r8b, r10b
jb 0x140007ef0
jmp 0x140007f4d
xor eax, eax
lea rdx, [rbp + 0x650]
mov r8, r10
mov qword [rbp + 0x6e0], rax
lea rcx, [rbp + 0x6e0]
mov dword [rbp + 0x6e8], eax
call fcn.140081340
lea rcx, [0x1400f75e0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.140005860
test rax, rax
jne 0x140007f76
lea rcx, [0x1400f75e0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140007a63
xor ecx, ecx
mov dword [rsp + 0x48], r13d
mov qword [rbp + 0x6b0], rcx
lea r9, [rbp + 0x660]
xorps xmm0, xmm0
lea rcx, [rbp + 0x590]
movups xmmword [rbp + 0x660], xmm0
mov r8d, 0x34
lea rdx, [rbp + 0x598]
movups xmmword [rbp + 0x670], xmm0
mov qword [rbp + 0x678], rcx
lea rcx, [rbp + 0x5cc]
movups xmmword [rbp + 0x680], xmm0
mov qword [rbp + 0x688], rcx
lea rcx, [rbp + 0x6e0]
mov qword [rbp + 0x668], rcx
lea rcx, [rbp + 0x580]
mov qword [rsp + 0x40], rcx
lea rcx, [rbp + 0x598]
mov dword [rsp + 0x38], 0x44
mov qword [rsp + 0x30], rcx
mov rcx, rax
movups xmmword [rbp + 0x690], xmm0
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
movups xmmword [rbp + 0x6a0], xmm0
mov dword [rbp + 0x660], 0x58
mov dword [rbp + 0x664], 1
mov dword [rbp + 0x680], 8
mov dword [rbp + 0x690], reloc.WS2_32.dll_recv
mov dword [rbp + 0x670], SafeArrayLock
call qword [sym.imp.bcrypt.dll_BCryptEncrypt]
mov ecx, eax
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov ebx, eax
test eax, eax
jle 0x140008064
movzx ebx, ax
or ebx, 0x80070000
lea rcx, [0x1400f75e0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test ebx, ebx
js 0x140007a63
mov rax, qword [rsi + 8]
lea r9, [rbp + 0x650]
mov rcx, qword [r15 + 0x38]
movzx r8d, byte [r15 + 0x57]
mov rdx, qword [r15 + 0x48]
mov qword [rsp + 0x50], rax
movzx eax, word [rsi]
mov ecx, dword [rcx + 1]
mov word [rsp + 0x48], ax
lea rax, [rbp + 0x590]
mov qword [rsp + 0x40], rax
movzx eax, byte [r15 + 0x56]
mov byte [rsp + 0x30], al
mov rax, qword [r15 + 0x40]
mov qword [rsp + 0x28], rax
movzx eax, byte [0x1400f757c]
mov byte [rsp + 0x20], al
call fcn.140011b50
movzx eax, ax
mov dword [rsi], eax
test eax, eax
je 0x140007a63
test byte [0x1400f8b3e], 0x80
je 0x140008294
movzx edi, byte [0x1400f757c]
lea rcx, [rsp + 0x68]
xor edx, edx
mov r8d, 0x1ff
call fcn.1400819f0
xor r9b, r9b
mov ebx, 0x57
test dil, dil
je 0x140008166
lea r10, [rbp + 0x650]
nop word [rax + rax]
movzx r8d, byte [r10]
lea r10, [r10 + 1]
movzx ecx, r8b
movzx edx, r9b
add rdx, rdx
shr cl, 4
cmp cl, 0xa
mov eax, 0x30
cmovae eax, ebx
and r8b, 0xf
add al, cl
mov byte [rsp + rdx + 0x68], al
cmp r8b, 0xa
mov eax, 0x30
cmovae eax, ebx
inc r9b
add al, r8b
mov byte [rsp + rdx + 0x69], al
cmp r9b, dil
jb 0x140008120
movzx r12d, byte [r15 + 0x57]
lea rcx, [rbp + 0x168]
mov byte [rsp + rdi*2 + 0x68], r13b
xor edx, edx
mov rdi, qword [r15 + 0x48]
mov r8d, 0x1ff
call fcn.1400819f0
xor r8b, r8b
test r12b, r12b
je 0x1400081d8
movzx ecx, byte [rdi]
lea rdi, [rdi + 1]
shr cl, 4
mov eax, 0x30
movzx edx, r8b
add rdx, rdx
cmp cl, 0xa
cmovae eax, ebx
add al, cl
mov byte [rbp + rdx + 0x168], al
mov eax, 0x30
movzx ecx, byte [rdi - 1]
and cl, 0xf
cmp cl, 0xa
cmovae eax, ebx
inc r8b
add al, cl
mov byte [rbp + rdx + 0x169], al
cmp r8b, r12b
jb 0x140008190
movzx r8d, byte [r15 + 0x56]
lea rcx, [rbp + 0x368]
mov rdx, qword [r15 + 0x40]
mov byte [rbp + r12*2 + 0x168], r13b
call fcn.140005e20
mov rcx, qword [r15 + 0x38]
lea r9, str._S__TX_____LH_Ver:0x_x_DestCid:_s_SrcCid:_s_Type:R_OrigDestCid:_s__Token__hu_bytes_
mov dword [rsp + 0x40], 0x50
mov rbx, 0xffffffffffffffff
mov qword [rsp + 0x38], rax
mov r8, rbx
lea rax, [rsp + 0x68]
mov edx, 0x80
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x168]
mov qword [rsp + 0x28], rax
mov eax, dword [rcx + 1]
lea rcx, [rbp + 0x710]
mov dword [rsp + 0x20], eax
call fcn.1400015d0
lea rax, [rbp + 0x710]
nop dword [rax]
inc rbx
cmp byte [rax + rbx], r13b
jne 0x140008250
lea rax, [rbp + 0x710]
mov dword [rbp + 0x64c], r13d
mov qword [rbp + 0x640], rax
lea rdx, [0x1400d0798]
lea rax, [rbp + 0x630]
inc ebx
mov r9d, 2
mov qword [rsp + 0x20], rax
mov dword [rbp + 0x648], ebx
call fcn.140001460
call fcn.140001640
lock inc qword [rax + 0x1c8]
mov r9d, dword [rsi]
mov r8, r14
mov rdx, qword [r15 + 8]
mov rcx, qword [rsp + 0x60]
mov dword [rsp + 0x20], 1
call fcn.14000ae10
jmp 0x1400082d3
mov rcx, qword [r14 + 0x18]
mov rdx, r14
add rcx, 0x200
call qword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
mov rsi, qword [rsp + 0x8d0]
mov rcx, qword [rbp + 0x790]
xor rcx, rsp
call fcn.14007f5b0
lea r11, [rsp + 0x8a0]
mov rbx, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret