Function at 0x140128820
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
mov eax, dword [rsp + 0x110]
mov esi, dword [rsp + 0x108]
mov ecx, 1
mov rdi, rdx
mov qword [rsp + 0xf0], r8
mov qword [rsp + 0xf8], r9
lea ebx, [rax + 0xf]
mov eax, dword [rsp + 0x100]
and ebx, 0xfffffff0
imul eax, esi
mov dword [rsp + 0x58], eax
shl eax, 2
lea edx, [rax + rsi*2 + 0x10]
add edx, ebx
call fcn.1400ebc10
mov rcx, rax
mov qword [rsp + 0x70], rax
lea rax, str.failed_to_allocate_memory
test rcx, rcx
je 0x140128bd4
mov eax, ecx
mov r8d, 0x10
lea rdx, [0x14027e4e0]
neg eax
and eax, 0xf
add rax, rcx
mov qword [rsp + 0x30], rax
mov rcx, rax
call rdi
test eax, eax
jne 0x140128be8
mov rax, qword [rsp + 0x30]
movsxd rbp, esi
mov edx, 0xff
mov r8, rbp
lea rdi, [rax + rbx]
lea rax, [rdi + rbp]
mov qword [rsp + 0x38], rax
lea r13, [rax + rbp]
movsxd rax, dword [rsp + 0x58]
lea rcx, [r13 + rax]
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x68], rcx
add rcx, rax
mov qword [rsp + 0x50], rcx
mov rcx, rdi
call sub.msvcrt.dll_memset
test esi, esi
jle 0x140128d7f
xor eax, eax
nop dword [rax + rax]
mov byte [r13 + rax], al
add rax, 1
cmp esi, eax
jg 0x140128910
mov rbx, qword [rsp + 0x50]
mov r8, rdi
mov rcx, qword [rsp + 0x30]
mov rdx, rbx
call qword [rsp + 0xf0]
xor eax, eax
mov rdx, rbx
nop dword [rax]
movzx ecx, byte [r13 + rax]
xor byte [rdx + rax], cl
add rax, 1
cmp esi, eax
jg 0x140128940
lea rdx, [rdi + rbp - 1]
add byte [rdx], 1
jne 0x140128987
lea edx, [rsi - 1]
mov rcx, rbp
mov rax, qword [rsp + 0x38]
sub rcx, rdx
add rcx, rdi
jmp 0x140128982
movzx ebx, byte [rax - 2]
sub rax, 1
lea edx, [rbx + 1]
mov byte [rax - 1], dl
test dl, dl
jne 0x140128987
cmp rax, rcx
jne 0x140128970
mov r15, qword [rsp + 0x38]
mov r8, rbp
mov edx, 0xff
mov rcx, r15
call sub.msvcrt.dll_memset
mov rbx, qword [rsp + 0x68]
mov r9, qword [rsp + 0x50]
mov rdx, r15
mov rcx, qword [rsp + 0x30]
mov qword [rsp + 0x20], 1
mov r8, rbx
call qword [rsp + 0xf8]
mov r8, rbp
mov rdx, r13
mov rcx, rbx
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140128c6e
mov rcx, qword [rsp + 0x38]
mov r8, rbp
mov rdx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140128c6e
lea ebx, [rsi - 4]
mov edx, 0x57
mov rcx, rdi
lea r15, [rbp - 1]
movsxd rbx, ebx
mov r8, rbx
lea r14, [rdi + r15]
call sub.msvcrt.dll_memset
mov r8, rbx
mov rbx, qword [rsp + 0x38]
mov byte [r14], 1
mov edx, 0x57
mov byte [rdi + rbp - 2], 0
mov byte [rdi + rbp - 3], 0
mov byte [rdi + rbp - 4], 0
mov rcx, rbx
add r15, rbx
call sub.msvcrt.dll_memset
mov edx, dword [rsp + 0x58]
xor eax, eax
mov byte [r15], 1
mov qword [rsp + 0x80], r15
mov byte [rbx + rbp - 2], 0
mov byte [rbx + rbp - 3], 0
mov byte [rbx + rbp - 4], 0
test edx, edx
jle 0x140128c06
mov edx, dword [rsp + 0x58]
mov rcx, qword [rsp + 0x68]
nop word [rax + rax]
mov byte [r13 + rax], al
mov byte [rcx + rax], al
add rax, 1
cmp edx, eax
jg 0x140128a70
lea eax, [rsi - 1]
mov r15, r13
mov rcx, rbp
mov qword [rsp + 0x48], r13
mov r12, r14
mov r13d, esi
mov r14d, esi
mov rbx, qword [rsp + 0x50]
mov rsi, qword [rsp + 0xf0]
sub rcx, rax
mov qword [rsp + 0x40], rcx
nop dword [rax]
mov r8, rdi
mov rdx, rbx
mov rcx, qword [rsp + 0x30]
call rsi
xor eax, eax
test r14d, r14d
jle 0x140128b07
movzx edx, byte [r15 + rax]
xor byte [rbx + rax], dl
add rax, 1
cmp r14d, eax
jg 0x140128ac4
add byte [r12], 1
jne 0x140128b07
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x38]
add rcx, rdi
jmp 0x140128b02
movzx edx, byte [rax - 2]
sub rax, 1
add edx, 1
mov byte [rax - 1], dl
test dl, dl
jne 0x140128b07
cmp rax, rcx
jne 0x140128af0
add rbx, rbp
add r15, rbp
cmp dword [rsp + 0x58], r13d
lea eax, [r13 + r14]
jle 0x140128bfb
mov r13d, eax
jmp 0x140128ab0
mov r14, r13
mov rbx, qword [rsp + 0x38]
mov r8, rbp
mov edx, 0xff
mov rcx, rbx
call sub.msvcrt.dll_memset
mov rax, qword [rsp + 0x80]
movzx ecx, byte [rsp + 0x67]
mov r9, qword [rsp + 0x50]
sub byte [rax], cl
mov rax, rbx
mov byte [rbx + 1], 0
mov byte [rbx], 0
mov byte [rbx + 2], 7
mov rdx, rax
mov rcx, qword [rsp + 0x88]
mov rbx, qword [rsp + 0x68]
mov qword [rsp + 0x20], rcx
mov r8, rbx
mov rcx, qword [rsp + 0x30]
call qword [rsp + 0xf8]
mov r8, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x58]
mov rcx, rbx
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140128c6e
mov rcx, qword [rsp + 0x38]
mov r8, rbp
mov rdx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140128c6e
add dword [rsp + 0x48], 1
mov eax, dword [rsp + 0x48]
cmp dword [rsp + 0x100], eax
jne 0x140128cab
mov rcx, qword [rsp + 0x70]
call fcn.1400ebb20
xor eax, eax
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0x70]
call fcn.1400ebb20
lea rax, str.setkey_failed
jmp 0x140128bd4
mov r13, qword [rsp + 0x48]
mov esi, r14d
mov r14, r12
mov r15, qword [rsp + 0x50]
movsxd rax, dword [rsp + 0x100]
mov r12, qword [rsp + 0x78]
mov r9, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x38]
mov rcx, qword [rsp + 0x30]
mov rbx, r15
add rbx, r12
mov qword [rsp + 0x88], rax
mov qword [rsp + 0x20], rax
mov r8, rbx
call qword [rsp + 0xf8]
mov r8, r12
mov rdx, r15
mov rcx, rbx
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x140128c6e
mov rcx, qword [rsp + 0x38]
mov r8, rbp
mov rdx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
mov dword [rsp + 0x48], eax
je 0x140128c84
mov rcx, qword [rsp + 0x70]
call fcn.1400ebb20
lea rax, str.selftest_for_CTR_failed___see_syslog_for_details
jmp 0x140128bd4
lea eax, [rsi - 1]
mov rcx, rbp
sub rcx, rax
mov eax, dword [rsp + 0x100]
mov qword [rsp + 0x40], rcx
test eax, eax
jle 0x140128bc8
mov r15d, dword [rsp + 0x58]
mov qword [rsp + 0x58], r13
mov edx, 0xff
mov r8, rbp
mov rcx, rdi
call sub.msvcrt.dll_memset
mov eax, dword [rsp + 0x48]
sub byte [r14], al
mov rdx, qword [rsp + 0x58]
mov byte [rdi + 1], 0
mov byte [rdi], 0
mov byte [rdi + 2], 7
mov byte [rsp + 0x67], al
xor eax, eax
test r15d, r15d
jle 0x140128b25
mov byte [rdx + rax], al
add rax, 1
cmp r15d, eax
jg 0x140128ce1
mov rbx, qword [rsp + 0x50]
mov r12, qword [rsp + 0x58]
mov r13, r14
mov r14d, esi
nop dword [rax]
mov r8, rdi
mov rdx, rbx
mov rcx, qword [rsp + 0x30]
call qword [rsp + 0xf0]
xor eax, eax
test esi, esi
jle 0x140128d67
nop dword [rax + rax]
movzx edx, byte [r12 + rax]
xor byte [rbx + rax], dl
add rax, 1
cmp esi, eax
jg 0x140128d20
add byte [r13], 1
jne 0x140128d67
mov rcx, qword [rsp + 0x40]
mov rax, qword [rsp + 0x38]
add rcx, rdi
jmp 0x140128d62
movzx edx, byte [rax - 2]
sub rax, 1
add edx, 1
mov byte [rax - 1], dl
test dl, dl
jne 0x140128d67
cmp rax, rcx
jne 0x140128d50
add rbx, rbp
add r12, rbp
cmp r14d, r15d
lea eax, [rsi + r14]
jge 0x140128b22
mov r14d, eax
jmp 0x140128d00
mov r8, rdi
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x30]
call qword [rsp + 0xf0]
jmp 0x140128987