Function at 0x180042874
Capabilities:
Encode data using xor
Generate random numbers via winapi

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x6c0]
sub rsp, 0x7c0
mov rax, qword [0x180066008]
xor rax, rsp
mov qword [rbp + 0x6b0], rax
mov r13, qword [rdx]
mov r12d, 0x80
test byte [0x180067c74], r12b
mov ebx, ecx
mov rsi, qword [rdx + 0x58]
je 0x1800428ce
mov r9d, ecx
lea rdx, [0x180056ca8]
mov r8, r13
call fcn.1800421f0
mov rcx, qword [r13 + 0x20]
xor r8d, r8d
call fcn.18004bbb8
mov r14, rax
test rax, rax
jne 0x180042903
test byte [0x180067c70], 2
je 0x180042992
xor r9d, r9d
lea r8, str.stateless_send_data
call fcn.180041870
jmp 0x180042992
cmp ebx, 8
jne 0x180042a97
test qword [0x180067c98], 0x4000000
je 0x180042930
mov rdi, qword [0x180067cf8]
mov r15d, dword [0x180067d00]
mov qword [rbp + 0x568], rdi
jmp 0x180042944
lea rax, [0x180057268]
mov r15d, 3
mov qword [rbp + 0x568], rax
movzx eax, byte [rsi + 0x4f]
movzx ebx, r15w
shl bx, 2
mov rcx, r14
add bx, ax
movzx eax, byte [rsi + 0x4e]
add ax, 0xb
add bx, ax
movzx edx, bx
call fcn.18004bc34
mov r12, rax
test rax, rax
jne 0x1800429bc
test byte [0x180067c70], 2
je 0x18004298a
movzx r9d, bx
lea r8, str.vn_datagram
call fcn.180041870
mov rcx, r14
call fcn.18004bd7c
mov rcx, qword [rbp + 0x6b0]
xor rcx, rsp
call fcn.180028c10
mov rbx, qword [rsp + 0x810]
add rsp, 0x7c0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rbx, qword [rax + 8]
or byte [rbx], 0x80
lea rdi, [rbx + 6]
and dword [rbx + 1], 0
mov rcx, rdi
mov al, byte [rsi + 0x4f]
mov byte [rbx + 5], al
movzx r8d, byte [rsi + 0x4f]
mov rdx, qword [rsi + 0x40]
call fcn.18002a1d0
movzx eax, byte [rsi + 0x4f]
add rdi, rax
mov al, byte [rsi + 0x4e]
mov byte [rdi], al
inc rdi
movzx r8d, byte [rsi + 0x4e]
mov rcx, rdi
mov rdx, qword [rsi + 0x38]
call fcn.18002a1d0
movzx eax, byte [rsi + 0x4e]
lea rdx, [rbp + 0x560]
mov r9d, 2
mov byte [rbp + 0x560], 0
xor ecx, ecx
add rdi, rax
lea r8d, [r9 - 1]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
mov al, byte [rbp + 0x560]
lea rcx, [rdi + 4]
xor al, byte [rbx]
mov rdx, qword [rbp + 0x568]
and al, 0x7f
xor byte [rbx], al
mov eax, dword [r13 + 0x18]
mov r8d, r15d
shl r8, 2
mov dword [rdi], eax
call fcn.18002a1d0
and byte [rsi + 0x55], 0xfe
test byte [0x180067c76], 1
je 0x180042a8e
lea r9, str._S__TX_____VN
or r8, 0xffffffffffffffff
mov edx, 0x80
lea rcx, [rbp + 0x5b0]
call fcn.180042088
lea r8, [rbp + 0x5b0]
lea rdx, [0x180056df8]
call fcn.1800417fc
mov ecx, dword [r12]
jmp 0x180042eb4
cmp ebx, 9
jne 0x180042bd1
lea r9d, [rbx - 7]
xor ecx, ecx
lea r8d, [rbx - 8]
lea rdx, [rbp + 0x560]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
mov al, byte [rbp + 0x560]
shr al, 5
add al, 0x29
movzx ecx, al
mov byte [rbp + 0x560], cl
cmp cx, word [rsi + 0x48]
jb 0x180042ade
mov al, byte [rsi + 0x48]
dec al
mov byte [rbp + 0x560], al
mov cl, al
cmp cl, 0x15
jb 0x18004298a
movzx edx, cl
mov rcx, r14
call fcn.18004bc34
mov rdi, rax
test rax, rax
jne 0x180042b1b
test byte [0x180067c70], 2
je 0x18004298a
movzx r9d, byte [rbp + 0x560]
lea r8, str.reset_datagram
jmp 0x180042985
mov rbx, qword [rax + 8]
mov r9d, 2
movzx r8d, byte [rbp + 0x560]
mov rdx, rbx
sub r8d, 0x10
xor ecx, ecx
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
mov dl, byte [rbx]
and dl, 0x3f
or dl, 0x40
mov byte [rbx], dl
mov cl, dl
mov rax, qword [rsi + 0x30]
xor cl, byte [rax]
and cl, 4
xor cl, dl
mov byte [rbx], cl
movzx ecx, byte [rbp + 0x560]
mov rdx, qword [rdi + 8]
add rcx, 0xfffffffffffffff0
add rdx, rcx
mov rcx, qword [rsi + 0x38]
call fcn.1800389b0
test byte [0x180067c76], 1
je 0x180042bca
movzx ecx, byte [rbp + 0x560]
mov r8b, 0x10
mov rdx, qword [rdi + 8]
add rcx, 0xfffffffffffffff0
add rdx, rcx
lea rcx, [rsp + 0x60]
call fcn.18004318c
lea r9, str._S__TX_____SR__s
mov qword [rsp + 0x20], rax
or r8, 0xffffffffffffffff
lea rcx, [rbp + 0x5b0]
mov rdx, r12
call fcn.180042088
lea r8, [rbp + 0x5b0]
lea rdx, [0x180056df8]
call fcn.1800417fc
mov ecx, dword [rdi]
jmp 0x180042eb4
cmp ebx, 0xa
jne 0x18004298a
mov ebx, 0x93
mov rcx, r14
mov edx, ebx
call fcn.18004bc34
mov r15, rax
test rax, rax
jne 0x180042c0d
test byte [0x180067c70], 2
je 0x18004298a
mov r9d, ebx
lea r8, str.retry_datagram
jmp 0x180042985
mov r9d, 2
lea rdx, [rbp + 0x570]
xor ecx, ecx
lea r8d, [r9 + 0xc]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
xor edx, edx
lea rcx, [rbp + 0x5b0]
lea r8d, [rdx + 0x50]
call fcn.180029d60
lea rcx, [rbp + 0x568]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
movzx ebx, byte [rsi + 0x4e]
movabs rcx, 0xfe624e212ac18000
add rcx, qword [rbp + 0x568]
movabs rax, 0x346dc5d63886594b
imul rcx
mov r8d, ebx
lea rcx, [rbp + 0x5d4]
sar rdx, 0xb
mov rax, rdx
shr rax, 0x3f
add rdx, rax
mov rax, qword [rsi + 8]
mov qword [rbp + 0x5b0], rdx
mov rdx, qword [rsi + 0x38]
movups xmm0, xmmword [rax]
movups xmmword [rbp + 0x5b8], xmm0
movsd xmm1, qword [rax + 0x10]
movsd qword [rbp + 0x5c8], xmm1
mov eax, dword [rax + 0x18]
mov dword [rbp + 0x5d0], eax
call fcn.18002a1d0
movzx r10d, byte [0x180067d74]
mov r8b, 0xc
mov byte [rbp + 0x5e8], bl
cmp r10b, r8b
jb 0x180042d1e
movsd xmm0, qword [rbp + 0x570]
mov eax, dword [rbp + 0x578]
movsd qword [rbp + 0x580], xmm0
mov dword [rbp + 0x588], eax
jbe 0x180042d43
lea r9, [rbp + 0x57c]
movzx ecx, r8b
mov eax, 0xaaaaaaab
mul ecx
inc r8b
shr edx, 3
lea eax, [rdx + rdx*2]
shl eax, 2
sub ecx, eax
mov al, byte [r9]
movsxd rcx, ecx
inc r9
xor byte [rbp + rcx + 0x580], al
cmp r8b, r10b
jb 0x180042cee
jmp 0x180042d43
xor eax, eax
lea rdx, [rbp + 0x570]
mov r8, r10
mov qword [rbp + 0x580], rax
lea rcx, [rbp + 0x580]
mov dword [rbp + 0x588], eax
call fcn.18002a1d0
lea rdi, [0x180067dd0]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.18004197c
test rax, rax
jne 0x180042d6b
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x18004298a
mov edx, 0x44
lea rcx, [rbp + 0x5b8]
mov qword [rsp + 0x28], rcx
lea r9, [rbp + 0x5b0]
mov word [rsp + 0x20], dx
mov rcx, rax
lea r8d, [rdx - 0x3c]
lea rdx, [rbp + 0x580]
call fcn.18004b648
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test ebx, ebx
js 0x18004298a
mov rax, qword [r15 + 8]
lea r9, [rbp + 0x570]
mov rcx, qword [rsi + 0x30]
mov r8b, byte [rsi + 0x4f]
mov rdx, qword [rsi + 0x40]
mov qword [rsp + 0x50], rax
movzx eax, word [r15]
mov ecx, dword [rcx + 1]
mov word [rsp + 0x48], ax
lea rax, [rbp + 0x5b0]
mov qword [rsp + 0x40], rax
mov al, byte [rsi + 0x4e]
mov byte [rsp + 0x30], al
mov rax, qword [rsi + 0x38]
mov qword [rsp + 0x28], rax
mov al, byte [0x180067d74]
mov byte [rsp + 0x20], al
call fcn.180044010
movzx ecx, ax
mov dword [r15], ecx
test ecx, ecx
je 0x18004298a
test byte [0x180067c76], 1
je 0x180042eb4
mov r8b, byte [rsi + 0x4e]
lea rcx, [rsp + 0x60]
mov rdx, qword [rsi + 0x38]
call fcn.18004318c
mov r8b, byte [0x180067d74]
lea rdx, [rbp + 0x570]
lea rcx, [rbp + 0x160]
mov rdi, rax
call fcn.18004318c
mov r8b, byte [rsi + 0x4f]
lea rcx, [rbp + 0x360]
mov rdx, qword [rsi + 0x40]
mov rbx, rax
call fcn.18004318c
mov rcx, qword [rsi + 0x30]
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
or r8, 0xffffffffffffffff
mov qword [rsp + 0x38], rdi
mov rdx, r12
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rax
mov eax, dword [rcx + 1]
lea rcx, [rbp + 0x630]
mov dword [rsp + 0x20], eax
call fcn.180042088
lea r8, [rbp + 0x630]
lea rdx, [0x180056df8]
call fcn.1800417fc
mov ecx, dword [r15]
movzx r9d, word [0x180067d6e]
xor edx, edx
movzx eax, word [rsi + 0x1a]
mov r8, qword [rsi + 8]
div r9d
mov r9d, edx
lea rdx, [r8 + 0x1c]
mov word [rsp + 0x30], r9w
mov r9, r14
mov dword [rsp + 0x28], 1
mov dword [rsp + 0x20], ecx
mov rcx, r13
call fcn.180042f84
jmp 0x180042992