Function at 0x41d170
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xe8
mov esi, 1
call fcn.0041b8c0
mov rbx, rax
test ah, 2
jne 0x41d578
test bh, 1
jne 0x41d59c
test bl, 0x80
jne 0x41d5bd
test bl, 0x10
jne 0x41d5de
and ebx, 4
jne 0x41d5ff
lea r8, [0x0041a480]
lea rcx, [0x0041a8b0]
mov rdx, r8
call fcn.0041b4f0
test eax, esi
jne 0x41d560
lea rcx, str.scrypt:_mix_function_power_on_self_test_failed
mov ebx, 4
call qword [0x006740e0]
mov dword [rsp + 0x9c], 6
call fcn.0041c110
test eax, eax
jne 0x41d215
lea rcx, str.scrypt:_hash_function_power_on_self_test_failed
call qword [0x006740e0]
mov dword [rsp + 0x9c], ebx
lea rax, [0x0067db20]
lea r15, [0x0067da80]
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0xa0]
mov dword [rsp + 0x98], 1
mov qword [rsp + 0x90], rax
mov rax, qword [rsp + 0x38]
mov rdx, qword [rax + 8]
movzx edi, byte [rax + 0x10]
mov qword [rsp + 0x88], rax
movzx r14d, byte [rax + 0x12]
movzx esi, byte [rax + 0x11]
mov rax, qword [rax]
mov qword [rsp + 0x60], rdx
mov ebx, edi
mov rcx, rax
mov qword [rsp + 0x48], rax
call sub.msvcrt.dll_strlen
mov qword [rsp + 0x50], rax
call fcn.0041b8c0
lea rdx, [0x0041e500]
mov qword [rsp + 0x40], rdx
test ah, 2
jne 0x41d2f0
lea rdx, [0x0041d9f0]
mov qword [rsp + 0x40], rdx
test ah, 1
jne 0x41d2f0
lea rdx, [0x0041d640]
mov qword [rsp + 0x40], rdx
test al, 0x80
jne 0x41d2f0
lea rdx, [0x0041dda0]
mov qword [rsp + 0x40], rdx
test al, 0x10
jne 0x41d2f0
test al, 4
lea rdx, [0x0041e150]
lea rax, [0x0041ba50]
cmovne rax, rdx
mov qword [rsp + 0x40], rax
nop word cs:[rax + rax]
mov ecx, dword [0x006e9720]
test ecx, ecx
je 0x41d530
cmp bl, 0x1e
jbe 0x41d310
lea rcx, str.scrypt:_N_out_of_range
call qword [0x006740e0]
cmp sil, 7
jbe 0x41d323
lea rcx, str.scrypt:_r_out_of_range
call qword [0x006740e0]
cmp r14b, 0x19
jbe 0x41d336
lea rcx, str.scrypt:_p_out_of_range
call qword [0x006740e0]
mov ebx, 1
lea ecx, [rdi + 1]
mov ebp, 0x100
mov r13d, ebx
mov eax, ebx
shl r13d, cl
mov ecx, esi
shl eax, cl
mov ecx, r14d
shl ebx, cl
mov ecx, esi
mov dword [rsp + 0x34], eax
shl ebp, cl
mov ecx, r13d
mov dword [rsp + 0x30], ebx
mov esi, ebp
imul rcx, rsi
add rcx, 0x7f
call sub.msvcrt.dll_malloc
lea r12, [rax + 0x7f]
mov qword [rsp + 0x80], rax
and r12, 0xffffffffffffff80
test rax, rax
je 0x41d62e
mov eax, dword [rsp + 0x30]
add eax, 1
mov edi, eax
imul edi, ebp
lea rcx, [rdi + 0x7f]
mov qword [rsp + 0x68], rdi
call sub.msvcrt.dll_malloc
lea rdi, [rax + 0x7f]
mov qword [rsp + 0x78], rax
and rdi, 0xffffffffffffff80
test rax, rax
je 0x41d61c
mov ecx, r14d
mov eax, ebp
add rsi, rdi
mov rdx, qword [rsp + 0x50]
shl eax, cl
mov qword [rsp + 0x20], rsi
mov r9, qword [rsp + 0x58]
xor ebx, ebx
mov qword [rsp + 0x28], rax
mov r8, qword [rsp + 0x60]
xor r14d, r14d
mov rcx, qword [rsp + 0x48]
mov qword [rsp + 0x70], rax
call fcn.0041cee0
mov edx, dword [rsp + 0x30]
test edx, edx
je 0x41d43c
mov rax, r12
mov qword [rsp + 0x58], r15
mov r15d, r14d
mov r14, qword [rsp + 0x40]
mov r12d, ebp
mov rbp, rax
mov eax, dword [rsp + 0x34]
mov ecx, ebx
mov r9d, r13d
mov r8, rbp
add rcx, rsi
mov rdx, rdi
add r15d, 1
add ebx, r12d
mov dword [rsp + 0x20], eax
call r14
cmp dword [rsp + 0x30], r15d
jne 0x41d410
mov r15, qword [rsp + 0x58]
mov rbx, qword [rsp + 0x90]
mov rcx, qword [rsp + 0x48]
mov r8, rsi
mov r9, qword [rsp + 0x70]
mov rdx, qword [rsp + 0x50]
mov qword [rsp + 0x20], rbx
call fcn.0041cae0
xor eax, eax
mov rcx, qword [rsp + 0x68]
push rdi
push rcx
rep stosb byte [rdi], al
pop rcx
pop rdi
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x78]
call sub.msvcrt.dll_free
xor edx, edx
xor ecx, ecx
mov r8, rbx
nop dword [rax + rax]
movzx eax, byte [r15 + rdx]
xor al, byte [r8 + rdx]
add rdx, 1
movzx eax, al
or ecx, eax
cmp rdx, 0x40
jne 0x41d490
mov rsi, qword [rsp + 0x88]
sub ecx, 1
add qword [rsp + 0x38], 0x18
add r15, 0x40
shr ecx, 8
and dword [rsp + 0x98], ecx
mov rax, qword [rsp + 0x38]
cmp qword [rsi + 0x18], 0
je 0x41d4f0
mov rcx, qword [rax + 8]
call sub.msvcrt.dll_strlen
mov qword [rsp + 0x58], rax
jmp 0x41d24c
mov eax, dword [rsp + 0x98]
test eax, eax
jne 0x41d510
lea rcx, str.scrypt:_scrypt_power_on_self_test_failed
call qword [0x006740e0]
and dword [rsp + 0x9c], 0xfffffffb
mov eax, dword [rsp + 0x9c]
add rsp, 0xe8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov dword [0x006e9720], 1
call fcn.0041d170
test eax, eax
jne 0x41d2fe
lea rcx, str.scrypt:_power_on_self_test_failed
call qword [0x006740e0]
jmp 0x41d2fe
mov dword [rsp + 0x9c], 7
mov ebx, 5
jmp 0x41d1f8
lea r8, [0x0041a490]
lea rcx, [fcn.00418be0]
mov rdx, r8
call fcn.0041b4f0
and eax, 1
mov esi, eax
test bh, 1
je 0x41d1a2
lea r8, [0x0041a490]
lea rcx, [fcn.00418e20]
mov rdx, r8
call fcn.0041b4f0
and esi, eax
test bl, 0x80
je 0x41d1ab
lea r8, [0x0041a490]
lea rcx, [fcn.004191a0]
mov rdx, r8
call fcn.0041b4f0
and esi, eax
test bl, 0x10
je 0x41d1b4
lea r8, [0x0041a490]
lea rcx, [fcn.00419580]
mov rdx, r8
call fcn.0041b4f0
and esi, eax
and ebx, 4
je 0x41d1bd
lea r8, [0x0041a490]
lea rcx, [fcn.00419a10]
mov rdx, r8
call fcn.0041b4f0
and esi, eax
jmp 0x41d1bd
lea rcx, str.scrypt:_out_of_memory
call qword [0x006740e0]
jmp 0x41d3bb
lea rcx, str.scrypt:_out_of_memory
call qword [0x006740e0]
jmp 0x41d38b