Function at 0x180165620
Capabilities:
Encode data using xor

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x38]
sub rsp, 0x138
mov qword [rsp + 0x68], 0xfffffffffffffffe
mov rax, qword [0x18036d060]
xor rax, rsp
mov qword [rbp + 0x20], rax
mov r13d, r9d
mov dword [rsp + 0x54], r9d
mov edi, r8d
mov dword [rsp + 0x60], r8d
mov dword [rsp + 0x5c], edx
mov r14, rcx
mov r12, qword [rbp + 0xa8]
mov rbx, qword [rbp + 0xa0]
mov qword [rbp - 0x70], rbx
mov r15, qword [rbp + 0xb0]
mov rsi, qword [rbp + 0xb8]
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rsp + 0x70], xmm0
mov qword [rbp - 0x80], rax
movzx r9d, byte [rsi + 0x162]
lea r8, str.encryptFragment
mov rdx, rsi
lea rcx, [rsp + 0x70]
call fcn.180105ba0
nop
test rbx, rbx
jne 0x1801656d9
lea rdx, str.Nothing_to_TLS_encrypt.
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x28]
nop
lea rcx, [rsp + 0x70]
call fcn.180105c80
xor al, al
jmp 0x180165f03
cmp dword [r14 + 0x124], 0
jne 0x180165704
cmp byte [r14 + 0x104], 0
jne 0x180165704
mov r8d, dword [r12]
mov rdx, rbx
mov rcx, r15
call fcn.1800baf90
movzx ebx, al
jmp 0x180165ef6
cmp edi, 3
jne 0x180165714
cmp r13d, 4
mov byte [rsp + 0x50], 1
je 0x180165719
mov byte [rsp + 0x50], 0
lea rcx, [r14 + 0x40]
call fcn.1800bc850
mov edi, reloc.WS2_32.dll_inet_ntoa
cmp dword [r14 + 0x120], 6
jne 0x180165837
mov eax, dword [r14 + 0x138]
add eax, dword [r14 + 0x134]
cmp eax, edi
je 0x180165753
lea rdx, str.Nonce_length_not_correct_for_GCM_mode.
jmp 0x1801656be
lea rcx, [r14 + 0x770]
call fcn.1800bc850
lea rcx, [r14 + 0x148]
call fcn.1800be430
cmp byte [rsp + 0x50], 0
je 0x180165a17
cmp eax, edi
je 0x1801657ad
lea rdx, str.WriteIV_is_not_the_correct_length_for_TLS_1.3_GCM_mode.
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x28]
lea rcx, [r14 + 0x148]
call fcn.1800be430
mov r8d, eax
lea rdx, str.fixedIV_len
mov rcx, rsi
call fcn.180106220
jmp 0x1801656c8
mov dword [rbp - 0x70], 0
mov rax, qword [r14 + 0x178]
mov qword [rbp - 0x6c], rax
lea rcx, [r14 + 0x148]
call fcn.1800bdfb0
xor r8d, r8d
lea rcx, [rbp - 0x70]
sub rax, rcx
nop word [rax + rax]
lea rdx, [rbp - 0x70]
add rdx, r8
movzx ecx, byte [rax + rdx]
xor byte [rdx], cl
inc r8
cmp r8, rdi
jl 0x1801657e0
mov r8d, edi
lea rdx, [rbp - 0x70]
lea rcx, [r14 + 0x40]
call fcn.1800baf90
mov word [rbp - 0x78], 0x317
mov byte [rbp - 0x76], 3
mov edx, dword [r12]
add edx, 0x11
mov eax, edx
shr eax, 8
mov byte [rbp - 0x75], al
mov byte [rbp - 0x74], dl
mov r8d, 5
lea rdx, [rbp - 0x78]
lea rcx, [r14 + 0x770]
call fcn.1800baf90
mov r13d, dword [rsp + 0x60]
cmp r13d, 3
jne 0x180165b83
mov r13d, dword [rsp + 0x54]
cmp r13d, 2
jl 0x180165b83
cmp dword [r14 + 0x138], 0
jbe 0x180165b83
lea rcx, [r14 + 0x70]
call fcn.1800bc850
cmp dword [r14 + 0x120], 6
je 0x180165886
lea rdx, [r14 + 0x70]
mov ecx, dword [r14 + 0x138]
call fcn.1800df5b0
mov r8d, dword [r12]
mov rdx, rbx
lea rcx, [r14 + 0x70]
call fcn.1800baf90
cmp byte [rsp + 0x50], 0
je 0x1801658ab
movzx edx, byte [rsp + 0x5c]
lea rcx, [r14 + 0x70]
call fcn.1800bb260
cmp dword [r14 + 0x124], 0
je 0x180165908
cmp dword [r14 + 0x120], 6
je 0x180165908
mov qword [rsp + 0x40], rsi
lea rax, [rbp - 0x60]
mov qword [rsp + 0x38], rax
mov eax, dword [r12]
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], r13d
mov r9d, 3
mov r8d, dword [rsp + 0x5c]
mov dl, 1
mov rcx, r14
call fcn.18015fcd0
test eax, eax
je 0x180165908
mov r8d, eax
lea rdx, [rbp - 0x60]
lea rcx, [r14 + 0x70]
call fcn.1800baf90
cmp byte [r14 + 0x104], 0
je 0x180165eda
mov eax, dword [r14 + 0x120]
mov ecx, eax
cmp eax, 6
je 0x180165978
cmp eax, 0x63
je 0x180165978
cmp eax, 7
je 0x180165978
xor r8d, r8d
mov ecx, dword [r14 + 0x138]
test ecx, ecx
je 0x180165958
lea rcx, [r14 + 0x70]
call fcn.1800be430
inc eax
mov ecx, dword [r14 + 0x138]
xor edx, edx
div ecx
mov r8d, ecx
sub r8d, edx
xor eax, eax
cmp r8d, ecx
cmovne eax, r8d
lea r8d, [rax + 1]
movzx edx, al
lea rcx, [r14 + 0x70]
call fcn.1800bb330
mov ecx, dword [r14 + 0x120]
cmp ecx, 6
jne 0x18016598d
lea rdx, [r14 + 0x40]
lea rcx, [r14 + 0x6f0]
call fcn.18018c960
mov rcx, r15
call fcn.1800be430
mov dword [rsp + 0x54], eax
movzx eax, byte [rsi + 0x161]
mov byte [rsp + 0x58], al
movzx ecx, byte [rsi + 0x162]
mov byte [rsi + 0x161], cl
mov qword [r14 + 0x188], 0
mov qword [r14 + 0x190], 0
cmp dword [r14 + 0x120], 6
jne 0x180165aca
lea rdx, [r14 + 0x180]
mov r9, rsi
lea r8, [r14 + 0x6f0]
mov rcx, qword [r14 + 0x7e0]
call fcn.1801c6f20
test al, al
jne 0x180165aae
mov rax, qword [rsi]
lea rdx, str.TLS_gcm_encrypt_setup_failed.
mov rcx, rsi
call qword [rax + 0x28]
mov dword [r12], 0
jmp 0x1801656c8
cmp eax, 4
je 0x180165a28
lea rdx, str.WriteIV_is_not_the_correct_length_for_GCM_mode.
jmp 0x180165781
mov r8d, 8
lea rdx, [r14 + 0x178]
lea rcx, [r14 + 0x770]
call fcn.1800baf90
lea rdx, [r14 + 0x148]
lea rcx, [r14 + 0x40]
call fcn.1800baf20
mov r8d, 8
lea rdx, [r14 + 0x178]
lea rcx, [r14 + 0x40]
call fcn.1800baf90
mov eax, dword [rsp + 0x5c]
mov byte [rbp - 0x78], al
mov r13d, dword [rsp + 0x60]
mov byte [rbp - 0x77], r13b
mov eax, dword [rsp + 0x54]
mov byte [rbp - 0x76], al
movzx eax, byte [r12 + 1]
mov byte [rbp - 0x75], al
movzx eax, byte [r12]
mov byte [rbp - 0x74], al
mov r8d, 5
lea rdx, [rbp - 0x78]
lea rcx, [r14 + 0x770]
call fcn.1800baf90
mov rbx, qword [rbp - 0x70]
jmp 0x18016583c
cmp byte [rsp + 0x50], 0
jne 0x180165aca
lea rdx, [r14 + 0x178]
mov r8d, 8
mov rcx, r15
call fcn.1800baf90
lea rcx, [r14 + 0x70]
call fcn.1800be430
mov ebx, eax
lea rcx, [r14 + 0x70]
call fcn.1800bdfb0
mov r9, rax
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], ebx
lea r8, [r14 + 0x6f0]
lea rdx, [r14 + 0x180]
mov rcx, qword [r14 + 0x7e0]
call fcn.18018c5d0
movzx ebx, al
movzx eax, byte [rsp + 0x58]
mov byte [rsi + 0x161], al
test bl, bl
jne 0x180165b27
lea rdx, str.Failed_to_encrypt_TLS_fragment
jmp 0x1801656be
cmp dword [r14 + 0x120], 6
jne 0x180165ecc
mov r9, rsi
lea r8, [r14 + 0x6f0]
lea rdx, [r14 + 0x180]
mov rcx, qword [r14 + 0x7e0]
call fcn.1801c6e60
test al, al
jne 0x180165b62
lea rdx, str.TLS_gcm_encrypt_finalize_failed.
jmp 0x1801656be
lea rcx, [r14 + 0x7a0]
call fcn.1800be430
cmp eax, 0x10
je 0x180165eba
lea rdx, str.GCM_auth_tag_is_not_16_bytes.
jmp 0x1801656be
lea rcx, [r14 + 0x70]
call fcn.1800bc850
mov r8d, dword [r12]
mov rdx, rbx
lea rcx, [r14 + 0x70]
call fcn.1800baf90
cmp byte [rsp + 0x50], 0
je 0x180165bb1
movzx edx, byte [rsp + 0x5c]
lea rcx, [r14 + 0x70]
call fcn.1800bb260
cmp dword [r14 + 0x124], 0
je 0x180165c06
mov qword [rsp + 0x40], rsi
lea rax, [rbp - 0x20]
mov qword [rsp + 0x38], rax
mov eax, dword [r12]
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x28], rbx
mov eax, dword [rsp + 0x54]
mov dword [rsp + 0x20], eax
mov r9d, dword [rsp + 0x60]
mov r8d, dword [rsp + 0x5c]
mov dl, 1
mov rcx, r14
call fcn.18015fcd0
test eax, eax
je 0x180165c06
mov r8d, eax
lea rdx, [rbp - 0x20]
lea rcx, [r14 + 0x70]
call fcn.1800baf90
cmp byte [r14 + 0x104], 0
je 0x180165eda
mov eax, dword [r14 + 0x120]
mov ecx, eax
cmp eax, 6
je 0x180165c76
cmp eax, 0x63
je 0x180165c76
cmp eax, 7
je 0x180165c76
xor r8d, r8d
mov ecx, dword [r14 + 0x138]
test ecx, ecx
je 0x180165c56
lea rcx, [r14 + 0x70]
call fcn.1800be430
inc eax
mov ecx, dword [r14 + 0x138]
xor edx, edx
div ecx
mov r8d, ecx
sub r8d, edx
xor eax, eax
cmp r8d, ecx
cmovne eax, r8d
lea r8d, [rax + 1]
movzx edx, al
lea rcx, [r14 + 0x70]
call fcn.1800bb330
mov ecx, dword [r14 + 0x120]
cmp ecx, 7
jne 0x180165de7
mov edx, edi
lea rcx, [r14 + 0x40]
call fcn.1800bdf30
mov rbx, rax
test rax, rax
je 0x180165cf0
mov dword [rax], 0
mov rcx, qword [r14 + 0x178]
mov qword [rax + 4], rcx
mov edx, edi
lea rcx, [r14 + 0x40]
call fcn.1800badc0
lea rcx, [r14 + 0x148]
call fcn.1800be430
cmp eax, edi
je 0x180165cca
lea rdx, str.m_fixedIv_should_be_12_bytes
jmp 0x1801656be
lea rcx, [r14 + 0x148]
call fcn.1800bdfb0
sub rax, rbx
nop dword [rax]
movzx ecx, byte [rax + rbx]
xor byte [rbx], cl
lea rbx, [rbx + 1]
sub rdi, 1
jne 0x180165ce0
lea rcx, [r14 + 0x770]
call fcn.1800bc850
lea rcx, [r14 + 0x770]
cmp byte [rsp + 0x50], 0
je 0x180165d28
mov word [rbp - 0x78], 0x317
mov byte [rbp - 0x76], 3
mov edx, dword [r12]
add edx, 0x11
mov eax, edx
shr eax, 8
mov byte [rbp - 0x75], al
mov byte [rbp - 0x74], dl
jmp 0x180165d67
lea rdx, [r14 + 0x178]
mov r8d, 8
call fcn.1800baf90
mov eax, dword [rsp + 0x5c]
mov byte [rbp - 0x78], al
mov eax, dword [rsp + 0x60]
mov byte [rbp - 0x77], al
mov eax, dword [rsp + 0x54]
mov byte [rbp - 0x76], al
movzx eax, byte [r12 + 1]
mov byte [rbp - 0x75], al
movzx eax, byte [r12]
mov byte [rbp - 0x74], al
lea rcx, [r14 + 0x770]
mov r8d, 5
lea rdx, [rbp - 0x78]
call fcn.1800baf90
lea rdx, [r14 + 0x40]
lea rcx, [r14 + 0x6f0]
call fcn.18018c960
mov rcx, qword [r14 + 0x7e0]
mov rax, qword [rcx]
mov qword [rsp + 0x20], rsi
lea r9, [r14 + 0x180]
lea r8, [r14 + 0x6f0]
mov dl, 1
call qword [rax + 0x18]
mov rcx, qword [r14 + 0x7e0]
mov rax, qword [rcx]
mov r9, rsi
lea r8, [r14 + 0x6f0]
lea rdx, [r14 + 0x180]
call qword [rax + 0x48]
test al, al
jne 0x180165de7
mov rax, qword [rsi]
lea rdx, str.TLS_aead_encrypt_setup_failed.
mov rcx, rsi
call qword [rax + 0x28]
mov dword [r12], 0
jmp 0x1801656c8
mov rcx, r15
call fcn.1800be430
mov dword [rsp + 0x54], eax
movzx edi, byte [rsi + 0x161]
movzx ecx, byte [rsi + 0x162]
mov byte [rsi + 0x161], cl
lea rcx, [r14 + 0x70]
call fcn.1800be430
mov ebx, eax
lea rcx, [r14 + 0x70]
call fcn.1800bdfb0
mov r9, rax
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], ebx
lea r8, [r14 + 0x6f0]
lea rdx, [r14 + 0x180]
mov rcx, qword [r14 + 0x7e0]
call fcn.18018c5d0
movzx ebx, al
mov byte [rsi + 0x161], dil
test al, al
jne 0x180165e65
mov r9, qword [rsi]
lea rdx, str.Failed_to_encrypt_TLS_fragment.
mov rcx, rsi
call qword [r9 + 0x28]
cmp dword [r14 + 0x120], 7
jne 0x180165ecc
mov rcx, qword [r14 + 0x7e0]
mov rax, qword [rcx]
mov r9, rsi
lea r8, [r14 + 0x6f0]
lea rdx, [r14 + 0x180]
call qword [rax + 0x50]
test al, al
jne 0x180165e9d
lea rdx, str.TLS_aead_encrypt_finalize_failed.
jmp 0x1801656be
lea rcx, [r14 + 0x7a0]
call fcn.1800be430
cmp eax, 0x10
je 0x180165eba
lea rdx, str.AEAD_auth_tag_is_not_16_bytes.
jmp 0x1801656be
lea rdx, [r14 + 0x7a0]
mov rcx, r15
call fcn.1800baf20
movzx ebx, al
mov rcx, r15
call fcn.1800be430
sub eax, dword [rsp + 0x54]
jmp 0x180165ef2
lea rdx, [r14 + 0x70]
mov rcx, r15
call fcn.1800baf20
movzx ebx, al
lea rcx, [r14 + 0x70]
call fcn.1800be430
mov dword [r12], eax
lea rcx, [rsp + 0x70]
call fcn.180105c80
movzx eax, bl
mov rcx, qword [rbp + 0x20]
xor rcx, rsp
call fcn.18007b140
add rsp, 0x138
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret