Function at 0x5afe10
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
mov ebx, dword [rsp + 0xc0]
mov rdi, rcx
mov r13d, edx
mov rbp, r8
mov esi, r9d
test edx, edx
jle 0x5b017f
test r9d, r9d
jle 0x5b017f
cmp r9d, ebx
jg 0x5b0186
cmp ebx, 0xa
jle 0x5b0186
movsxd rax, ebx
mov r8d, 0x4e
lea rdx, str.crypto_rsa_rsa_ssl.c
mov rcx, rax
mov qword [rsp + 0x38], rax
call fcn.00580440
test rax, rax
je 0x5b01b1
mov rcx, qword [rsp + 0x38]
movsxd r8, esi
add r8, rbp
lea r9, [rax + rcx]
mov rcx, r9
nop
mov edx, esi
lea eax, [rsi - 1]
sub rcx, 1
not edx
and edx, eax
sar edx, 0x1f
mov eax, edx
add edx, 1
sub r8, rdx
sub esi, edx
mov edx, r9d
not eax
sub edx, ecx
and al, byte [r8]
mov byte [rcx], al
cmp ebx, edx
jg 0x5afe90
lea r12d, [rbx - 1]
test ebx, ebx
mov rdx, 0xffffffffffffffff
movzx eax, al
not r12
cmovle r12, rdx
xor r11d, r11d
xor ecx, ecx
xor ebp, ebp
add r12, r9
mov r9d, 2
movzx edx, byte [r12 + 1]
xor edx, 2
movzx edx, dl
lea esi, [rdx - 1]
not edx
and edx, esi
mov esi, eax
sub eax, 1
not esi
and eax, esi
and eax, edx
mov edx, 0xffffffff
mov esi, eax
sar esi, 0x1f
mov r10d, esi
not r10d
nop
movzx eax, byte [r12 + r9]
mov r14d, eax
mov r8d, eax
sub eax, 1
not r14d
xor r8d, 3
and eax, r14d
movzx r8d, r8b
sar eax, 0x1f
and edx, eax
mov r14d, eax
mov r15d, edx
or ebp, r14d
not edx
mov eax, edx
mov edx, ebp
not edx
and r15d, r9d
and eax, r11d
add r9, 1
or r15d, eax
mov eax, edx
and eax, 1
mov r11d, r15d
add eax, ecx
mov ecx, r8d
sub r8d, 1
not ecx
and r8d, ecx
mov ecx, r8d
sar ecx, 0x1f
or ecx, ebp
and ecx, eax
cmp ebx, r9d
jg 0x5aff10
lea r15d, [r15 - 0xa]
mov eax, r11d
lea r9d, [rcx - 8]
mov edx, r15d
xor eax, 0xa
lea r14d, [rbx - 0xb]
xor r9d, 8
xor edx, 0xa
or edx, eax
xor edx, r11d
add r11d, 1
sar edx, 0x1f
mov eax, edx
and edx, esi
not eax
mov r8d, edx
and eax, esi
mov esi, ecx
not r8d
xor esi, 8
or r9d, esi
mov esi, ebx
sub esi, r11d
mov r11d, r13d
xor ecx, r9d
sub r11d, esi
mov ebp, esi
sar ecx, 0x1f
xor ebp, r13d
xor r11d, esi
mov r9d, ecx
or r11d, ebp
not r9d
xor r11d, r13d
and r9d, eax
and eax, ecx
sar r11d, 0x1f
mov ecx, eax
mov ebp, r11d
not ecx
not ebp
and ebp, r9d
and r9d, r11d
mov r11d, r9d
and r10d, r8d
not r11d
and r10d, 0x6b
and edx, 0x71
and eax, 0x73
and r9d, 0x6d
or edx, r10d
and ecx, edx
mov edx, r13d
or eax, ecx
xor edx, r14d
and eax, r11d
or eax, r9d
mov dword [rsp + 0x48], eax
mov eax, r14d
sub eax, r13d
xor eax, r13d
or eax, edx
xor eax, r14d
sar eax, 0x1f
mov edx, eax
not eax
and edx, r14d
and eax, r13d
mov r13d, 1
or edx, eax
lea rax, [r12 + 0xc]
mov dword [rsp + 0x44], edx
cmp r14d, 1
jle 0x5b00c8
mov dword [rsp + 0x4c], esi
mov rsi, rax
nop word cs:[rax + rax]
mov eax, r13d
mov edx, ebx
and eax, r15d
sub edx, r13d
mov r8d, eax
sub eax, 1
not r8d
and r8d, eax
sar r8d, 0x1f
mov r9d, r8d
not r9d
cmp edx, 0xb
jle 0x5b00bc
lea r10d, [rdx - 0xc]
lea rax, [r12 + 0xb]
movsxd r11, r13d
movzx r9d, r9b
add r10, rsi
or r8d, 0xffffff00
movzx edx, byte [rax + r11]
movzx ecx, byte [rax]
add rax, 1
and edx, r9d
and ecx, r8d
or edx, ecx
mov byte [rax - 1], dl
cmp r10, rax
jne 0x5b00a0
add r13d, r13d
cmp r14d, r13d
jg 0x5b0060
mov esi, dword [rsp + 0x4c]
mov r8d, dword [rsp + 0x44]
mov ecx, esi
xor edx, edx
neg ecx
test r8d, r8d
je 0x5b011f
nop dword [rax + rax]
mov eax, esi
mov r9d, esi
xor r9d, ecx
xor eax, edx
add ecx, 1
or eax, r9d
movzx r9d, byte [r12 + rdx + 0xb]
xor eax, edx
sar eax, 0x1f
and eax, ebp
movzx eax, al
mov r10d, eax
not eax
and r9d, r10d
movzx r10d, byte [rdi + rdx]
and eax, r10d
or eax, r9d
mov byte [rdi + rdx], al
add rdx, 1
cmp rdx, r8
jne 0x5b00e0
mov rdx, qword [rsp + 0x38]
mov r9d, 0xa5
lea r8, str.crypto_rsa_rsa_ssl.c
mov rcx, r12
call fcn.00580830
mov r8d, dword [rsp + 0x48]
mov edx, 0x72
mov dword [rsp + 0x20], 0xa6
lea r9, str.crypto_rsa_rsa_ssl.c
mov ecx, 4
call fcn.0055dd20
mov ecx, ebp
and ecx, 1
call fcn.005602e0
mov eax, ebp
not ebp
and eax, esi
or eax, ebp
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, 0xffffffff
jmp 0x5b016e
mov r8d, 0x6f
mov edx, 0x72
mov ecx, 4
mov dword [rsp + 0x20], 0x4a
lea r9, str.crypto_rsa_rsa_ssl.c
call fcn.0055dd20
mov eax, 0xffffffff
jmp 0x5b016e
mov r8d, 0x41
mov edx, 0x72
mov ecx, 4
mov dword [rsp + 0x20], 0x50
lea r9, str.crypto_rsa_rsa_ssl.c
call fcn.0055dd20
mov eax, 0xffffffff
jmp 0x5b016e