Function at 0x140036f9c
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 - 0x18]
sub rsp, 0x118
mov rax, qword [0x140230040]
xor rax, rsp
mov qword [rbp], rax
mov rax, qword [rbp + 0x80]
lea r13, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
xor r14d, r14d
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x80], r9
lea rax, [0x1401fa800]
mov rsi, r8
mov dword [rsp + 0x60], r14d
mov r15, rdx
mov qword [rsp + 0x20], rax
lea edx, [r14 + 2]
mov r9d, 0x2cb
mov r8, r13
mov r12, rcx
call fcn.140020854
test r15, r15
jne 0x14003701f
lea rax, str.no_transform_provided_to_encrypt_buf
mov r9d, 0x2ce
jmp 0x1400378f5
test rsi, rsi
je 0x1400378e8
mov r10, qword [rsi + 0x10]
test r10, r10
je 0x1400378e8
mov rbx, qword [rsi + 0x18]
mov rdi, qword [rsi + 0x20]
cmp rbx, rdi
jb 0x1400378e8
mov r9, qword [rsi + 0x28]
sub rbx, rdi
mov qword [rsp + 0x78], r9
cmp rbx, r9
jb 0x1400378e8
cmp byte [rsi + 0x30], r14b
jne 0x1400378e8
mov rcx, r15
call fcn.14003d5a4
mov qword [rsp + 0x30], r9
lea r13, [rdi + r10]
mov dword [rsp + 0x70], eax
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
lea rax, str.before_encrypt:_output_payload
mov qword [rsp + 0x28], r13
mov r9d, 0x2e2
mov qword [rsp + 0x20], rax
mov edx, 4
mov rcx, r12
call fcn.140020a00
mov rcx, qword [rsi + 0x28]
mov eax, 0x4000
cmp rcx, rax
jbe 0x1400370ed
mov qword [rsp + 0x30], rax
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x28], rcx
lea rax, str.Record_content__zu_too_large__maximum__zu
mov rcx, r12
mov qword [rsp + 0x20], rax
mov r9d, 0x2e8
mov edx, 1
call fcn.140020854
mov eax, 0xffff8f00
jmp 0x14003790f
mov al, byte [r15 + 0x141]
lea rdi, [rsi + 0x31]
mov byte [rsi + 0x30], al
lea rdx, [r15 + 0x162]
movzx r8d, byte [r15 + 0x141]
mov rcx, rdi
call fcn.14013a522
movzx eax, byte [rsi + 0x30]
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x30], rax
mov r9d, 0x30f
lea rax, [0x1401fa918]
mov qword [rsp + 0x28], rdi
mov edx, 3
mov qword [rsp + 0x20], rax
mov rcx, r12
call fcn.140020a00
cmp byte [rsi + 0x30], r14b
je 0x14003718e
mov rcx, qword [rsi + 0x28]
lea r14, [rcx + 1]
mov rdi, r14
neg rdi
and edi, 0xf
sub rbx, qword [rsp + 0x78]
je 0x1400371d7
mov al, byte [rsi + 8]
mov byte [rcx + r13], al
lea rax, [rbx - 1]
cmp rax, rdi
jb 0x1400371d7
lea rcx, [r14 + r13]
mov r8d, edi
xor edx, edx
call fcn.14013a51c
lea rax, [r14 + rdi]
mov qword [rsi + 0x28], rax
mov byte [rsi + 8], 0x19
mov rbx, qword [rsi + 0x18]
mov r14d, 1
sub rbx, qword [rsi + 0x20]
sub rbx, qword [rsi + 0x28]
mov eax, dword [rsp + 0x70]
cmp eax, r14d
ja 0x14003734e
cmp rbx, qword [r15 + 0x18]
jae 0x1400371e1
mov r9d, 0x331
lea rax, str.Buffer_provided_for_encrypted_record_not_large_enough
mov edx, r14d
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x20], rax
mov rcx, r12
call fcn.140020854
mov eax, 0xffff9600
jmp 0x14003790f
mov r8, rsi
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x68]
call fcn.140036ee8
lea rdi, [r15 + 0x48]
test rdi, rdi
je 0x1400372fb
cmp qword [rdi], 0
je 0x1400372fb
cmp qword [rdi + 0x10], 0
je 0x1400372fb
mov r8, qword [rsp + 0x78]
lea rdx, [rbp - 0x68]
mov rcx, rdi
call fcn.14002a680
mov dword [rsp + 0x68], eax
mov edx, eax
test eax, eax
jne 0x140037304
cmp qword [rdi], 0
je 0x1400372fb
cmp qword [rdi + 0x10], 0
je 0x1400372fb
mov r8, qword [rsi + 0x28]
mov rdx, r13
mov rcx, rdi
call fcn.14002a680
mov dword [rsp + 0x68], eax
mov edx, eax
test eax, eax
jne 0x140037304
lea rdx, [rbp - 0x30]
mov rcx, rdi
call fcn.14002a9f4
mov dword [rsp + 0x68], eax
mov edx, eax
test eax, eax
jne 0x140037304
mov rcx, rdi
call fcn.14002aab0
mov dword [rsp + 0x68], eax
mov edx, eax
test eax, eax
jne 0x140037304
mov rcx, qword [rsi + 0x28]
lea rdx, [rbp - 0x30]
mov r8, qword [r15 + 0x18]
add rcx, r13
call fcn.14013a522
mov rax, qword [r15 + 0x18]
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov rcx, qword [rsi + 0x28]
mov r9d, 0x36f
mov qword [rsp + 0x30], rax
add rcx, r13
mov qword [rsp + 0x28], rcx
lea rax, str.computed_mac
mov rcx, r12
mov qword [rsp + 0x20], rax
mov edx, 4
call fcn.140020a00
mov rax, qword [rsi + 0x28]
add rax, qword [r15 + 0x18]
mov edx, dword [rsp + 0x68]
mov qword [rsi + 0x28], rax
sub rbx, qword [r15 + 0x18]
mov dword [rsp + 0x60], r14d
jmp 0x140037304
mov edx, 0xffffaf00
mov dword [rsp + 0x68], edx
mov rcx, qword [r15 + 0x18]
test rcx, rcx
je 0x140037315
lea rdi, [rbp - 0x30]
xor eax, eax
rep stosb byte [rdi], al
test edx, edx
je 0x14003734a
mov dword [rsp + 0x28], edx
lea rax, str.mbedtls_md_hmac_xxx
mov edx, r14d
mov qword [rsp + 0x20], rax
mov r9d, 0x37f
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov rcx, r12
call fcn.140020944
mov eax, dword [rsp + 0x68]
jmp 0x14003790f
mov eax, dword [rsp + 0x70]
cmp eax, 3
jne 0x14003758a
mov rax, qword [r15 + 8]
mov rdi, qword [r15 + 0x10]
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x68], rdi
cmp rbx, qword [r15 + 0x20]
jae 0x14003737a
mov r9d, 0x3a3
jmp 0x1400371b9
xor eax, eax
lea rdx, [r15 + 0x28]
mov r8, rdi
mov qword [rbp - 0x78], rax
lea rcx, [rbp - 0x78]
mov dword [rbp - 0x70], eax
call fcn.14013a522
xor ecx, ecx
mov al, byte [rsi + rcx]
xor byte [rbp + rcx - 0x74], al
add rcx, r14
cmp rcx, 8
jb 0x140037395
mov r8, rsi
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x68]
call fcn.140036ee8
mov rax, qword [r15 + 8]
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x30], rax
mov ebx, 4
lea rax, [rbp - 0x78]
mov r9d, 0x3c5
mov qword [rsp + 0x28], rax
mov edx, ebx
lea rax, str.IV_used__internal_
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020a00
mov rax, qword [rsp + 0x70]
mov r9d, 0x3c8
sub rax, rdi
mov edx, ebx
neg rax
lea rdi, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov r8, rdi
mov rcx, r12
sbb rax, rax
and eax, 8
mov qword [rsp + 0x30], rax
lea rax, str.IV_used__transmitted_
mov qword [rsp + 0x28], rsi
mov qword [rsp + 0x20], rax
call fcn.140020a00
mov rbx, qword [rsp + 0x78]
lea rax, [rbp - 0x68]
mov qword [rsp + 0x30], rbx
mov r9d, 0x3ca
mov qword [rsp + 0x28], rax
mov r8, rdi
lea rax, str.additional_data_used_for_AEAD
mov edx, 4
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020a00
mov rax, qword [rsi + 0x28]
mov r9d, 0x3cd
mov qword [rsp + 0x28], rax
mov r8, rdi
lea rax, str.before_encrypt:_msglen___zu__including_0_bytes_of_padding
mov edx, 3
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020854
mov rax, qword [r15 + 0x20]
lea rdx, [rsi + 0x28]
mov rdi, qword [rsi + 0x18]
lea rcx, [r15 + 0x80]
add rdi, qword [rsi + 0x10]
lea r9, [rbp - 0x68]
mov r8, qword [r15 + 8]
sub rdi, r13
mov qword [rsp + 0x50], rax
mov rax, qword [rsi + 0x28]
mov qword [rsp + 0x48], rdx
lea rdx, [rbp - 0x78]
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rbx
call fcn.14001efc0
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov edi, eax
test eax, eax
je 0x140037518
mov dword [rsp + 0x28], eax
mov r9d, 0x3e8
lea rax, str.mbedtls_cipher_auth_encrypt_ext
mov edx, r14d
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020944
mov eax, edi
jmp 0x14003790f
mov rax, qword [r15 + 0x20]
mov r9d, 0x3ef
mov rcx, qword [rsi + 0x28]
mov edx, 4
sub rcx, rax
mov qword [rsp + 0x30], rax
add rcx, r13
lea rax, str.after_encrypt:_tag
mov qword [rsp + 0x28], rcx
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020a00
mov rax, qword [rsp + 0x70]
cmp rax, qword [rsp + 0x68]
je 0x14003757e
cmp qword [rsi + 0x20], 8
jae 0x14003756d
mov r9d, 0x3f8
jmp 0x1400371b9
mov rax, qword [rsi]
mov qword [r13 - 8], rax
sub qword [rsi + 0x20], 8
add qword [rsi + 0x28], 8
mov eax, dword [rsp + 0x60]
add eax, r14d
jmp 0x1400378a7
dec eax
cmp eax, r14d
jbe 0x1400375ad
mov r9d, 0x4de
lea rax, str.should_never_happen
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov edx, r14d
jmp 0x1400378fd
mov rcx, qword [r15 + 8]
xor edx, edx
mov rax, qword [rsi + 0x28]
add rax, r14
div rcx
sub rcx, rdx
neg rdx
sbb rdi, rdi
and rdi, rcx
lea rax, [rdi + 1]
cmp rbx, rax
jae 0x1400375dd
mov r9d, 0x419
jmp 0x1400371b9
xor edx, edx
mov rcx, qword [rsi + 0x28]
add rcx, rdx
add rdx, r14
mov byte [rcx + r13], dil
cmp rdx, rdi
jbe 0x1400375df
mov rcx, qword [rsi + 0x28]
mov r9, qword [rbp - 0x80]
inc rcx
add rcx, rdi
mov qword [rsi + 0x28], rcx
test r9, r9
jne 0x140037618
lea rax, str.No_PRNG_provided_to_encrypt_record_routine
mov r9d, 0x42a
jmp 0x14003759e
mov r8, qword [r15 + 8]
cmp qword [rsi + 0x20], r8
jae 0x14003762d
mov r9d, 0x42f
jmp 0x1400371b9
mov rcx, qword [rbp - 0x78]
lea rdx, [r15 + 0x28]
call r9
test eax, eax
jne 0x14003790f
mov r8, qword [r15 + 8]
lea rdx, [r15 + 0x28]
mov rcx, r13
sub rcx, r8
call fcn.14013a522
lea rax, [rdi + 1]
mov r9d, 0x443
mov qword [rsp + 0x38], rax
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov rax, qword [r15 + 8]
mov edx, 3
mov qword [rsp + 0x30], rax
mov rcx, r12
mov rax, qword [rsi + 0x28]
mov qword [rsp + 0x28], rax
lea rax, str.before_encrypt:_msglen___zu__including__zu_bytes_of_IV_and__zu_bytes_of_padding
mov qword [rsp + 0x20], rax
call fcn.140020854
mov r8, qword [r15 + 8]
lea rax, [rbp - 0x78]
mov qword [rsp + 0x30], rax
lea rcx, [r15 + 0x80]
mov rax, qword [rsi + 0x28]
lea rdx, [r15 + 0x28]
mov qword [rsp + 0x28], r13
mov r9, r13
mov qword [rsp + 0x20], rax
call fcn.14001edac
mov dword [rsp + 0x70], eax
test eax, eax
je 0x1400376fb
mov dword [rsp + 0x28], eax
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
lea rax, str.mbedtls_cipher_crypt
mov r9d, 0x475
mov edx, r14d
mov qword [rsp + 0x20], rax
mov rcx, r12
call fcn.140020944
mov eax, dword [rsp + 0x70]
jmp 0x14003790f
mov rcx, qword [rsi + 0x28]
cmp rcx, qword [rbp - 0x78]
je 0x140037710
mov r9d, 0x47b
jmp 0x140037597
sub r13, qword [r15 + 8]
mov rax, qword [rsi + 0x20]
sub rax, qword [r15 + 8]
mov qword [rsi + 0x20], rax
add rcx, qword [r15 + 8]
mov eax, dword [rsp + 0x60]
mov qword [rsi + 0x28], rcx
test eax, eax
jne 0x1400378a7
sub rbx, rdi
sub rbx, r14
cmp rbx, qword [r15 + 0x18]
jae 0x14003774b
mov r9d, 0x48f
jmp 0x1400371b9
mov r8, rsi
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x68]
call fcn.140036ee8
lea rax, str.using_encrypt_then_mac
mov r9d, 0x497
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x20], rax
mov edx, 3
mov rcx, r12
call fcn.140020854
mov rbx, qword [rsp + 0x78]
lea rax, [rbp - 0x68]
mov qword [rsp + 0x30], rbx
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov qword [rsp + 0x28], rax
mov r9d, 0x499
lea rax, str.MACd_meta_data
mov edx, 4
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020a00
lea rdi, [r15 + 0x48]
test rdi, rdi
je 0x14003785d
cmp qword [rdi], 0
je 0x14003785d
cmp qword [rdi + 0x10], 0
je 0x14003785d
mov r8, rbx
lea rdx, [rbp - 0x68]
mov rcx, rdi
call fcn.14002a680
mov ebx, eax
test eax, eax
jne 0x140037862
cmp qword [rdi], 0
je 0x14003785d
cmp qword [rdi + 0x10], 0
je 0x14003785d
mov r8, qword [rsi + 0x28]
mov rdx, r13
mov rcx, rdi
call fcn.14002a680
mov ebx, eax
test eax, eax
jne 0x140037862
lea rcx, [r15 + 0x48]
lea rdx, [rbp - 0x30]
call fcn.14002a9f4
mov ebx, eax
test eax, eax
jne 0x140037862
lea rcx, [r15 + 0x48]
call fcn.14002aab0
mov ebx, eax
test eax, eax
jne 0x140037862
mov rcx, qword [rsi + 0x28]
lea rdx, [rbp - 0x30]
mov r8, qword [r15 + 0x18]
add rcx, r13
call fcn.14013a522
mov rax, qword [rsi + 0x28]
add rax, qword [r15 + 0x18]
add dword [rsp + 0x60], r14d
mov qword [rsi + 0x28], rax
jmp 0x140037862
mov ebx, 0xffffaf00
mov rcx, qword [r15 + 0x18]
test rcx, rcx
je 0x140037873
lea rdi, [rbp - 0x30]
xor eax, eax
rep stosb byte [rdi], al
test ebx, ebx
je 0x1400378a3
lea rax, str.HMAC_calculation_failed
mov dword [rsp + 0x28], ebx
mov r9d, 0x4d6
mov qword [rsp + 0x20], rax
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov edx, r14d
mov rcx, r12
call fcn.140020944
mov eax, ebx
jmp 0x14003790f
mov eax, dword [rsp + 0x60]
lea r8, str.C:Usersdword_source_reposLast_EpochPathOfExileMenulibrary_ssl_msg.c
mov rcx, r12
cmp eax, r14d
je 0x1400378c8
lea rax, str.should_never_happen
mov r9d, 0x4e4
mov edx, r14d
jmp 0x140037900
lea rax, str.__encrypt_buf
mov r9d, 0x4e8
mov edx, 2
mov qword [rsp + 0x20], rax
call fcn.140020854
xor eax, eax
jmp 0x14003790f
lea rax, str.bad_record_structure_provided_to_encrypt_buf
mov r9d, 0x2d9
mov r8, r13
mov edx, 1
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.140020854
mov eax, 0xffff9400
mov rcx, qword [rbp]
xor rcx, rsp
call fcn.140138940
add rsp, 0x118
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret