Function at 0x509bd0
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
mov ebx, dword [0x007eff50]
mov qword [rsp + 0x38], rcx
mov rdi, rdx
mov r15, r8
test ebx, ebx
je 0x50a066
cmp qword [r8 + 8], 0
je 0x50a046
test byte [r8 + 0x10], 1
je 0x50a026
mov rbp, qword [0x007eff48]
test rbp, rbp
je 0x50a006
test rdx, rdx
lea rbx, [rbp + 0x10]
lea r14, [rbp + 0x20]
je 0x509ddd
lea rax, [rsp + 0x50]
mov qword [rsp + 0x48], rax
lea rax, [r8 + 0x19]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x60]
mov qword [rsp + 0x40], rax
nop dword [rax]
cmp qword [r15 + 0x40], 0
je 0x509f92
mov r11d, dword [0x007eff50]
cmp rdi, 0x10
mov esi, 0x10
cmovbe rsi, rdi
test r11d, r11d
je 0x509fe6
mov rax, qword [r15 + 0x40]
test rax, rax
je 0x509e30
cmp r15, qword [0x007eff28]
je 0x509e30
cmp r15, qword [0x007eff20]
je 0x509e30
cmp r15, qword [0x007eff18]
je 0x509e30
mov rdx, qword [rax + 8]
mov rax, qword [rax]
mov qword [rsp + 0x60], rax
mov eax, dword [r15 + 0x48]
mov qword [rsp + 0x68], rdx
mov edx, eax
mov byte [rsp + 0x6f], al
shr edx, 0x18
mov byte [rsp + 0x6c], dl
mov edx, eax
shr edx, 0x10
mov byte [rsp + 0x6d], dl
mov edx, eax
add eax, 1
shr edx, 8
mov dword [r15 + 0x48], eax
mov byte [rsp + 0x6e], dl
mov r12, qword [r15 + 8]
mov r8, qword [rsp + 0x40]
mov rdx, rbp
mov rcx, r12
call fcn.00509b90
mov rcx, qword [rsp + 0x30]
mov rax, rbp
movzx edx, byte [rcx]
add rax, 1
add rcx, 1
xor dl, byte [rax - 1]
mov byte [rax + 0xf], dl
cmp rbx, rax
jne 0x509d03
mov r8, rbx
mov rdx, r14
mov rcx, r12
lea r13, [rbp + 0x30]
call fcn.00509b90
mov rax, r14
nop
movzx edx, byte [rax - 0x20]
add rax, 1
xor dl, byte [rax - 1]
mov byte [rax - 0x11], dl
cmp rax, r13
jne 0x509d30
mov rdx, qword [rsp + 0x30]
mov r8, rbx
mov rcx, r12
call fcn.00509b90
mov rax, rbp
nop word cs:[rax + rax]
mov byte [rax], 0
add rax, 1
cmp rbx, rax
jne 0x509d60
mov rax, rbx
nop
mov byte [rax], 0
add rax, 1
cmp r14, rax
jne 0x509d70
add dword [r15 + 0x14], 1
cmp byte [r15 + 0x3b], 0
je 0x509df0
cmp qword [r15 + 0x40], 0
je 0x509df0
cmp r15, qword [0x007eff28]
je 0x509df0
cmp r15, qword [0x007eff20]
je 0x509df0
cmp r15, qword [0x007eff18]
je 0x509df0
mov rcx, qword [rsp + 0x38]
mov r8, rsi
mov rdx, r14
call sub.msvcrt.dll_memcpy
mov rax, r14
nop dword [rax]
mov byte [rax], 0
add rax, 1
cmp rax, r13
jne 0x509dc0
add qword [rsp + 0x38], rsi
sub rdi, rsi
test rdi, rdi
jne 0x509c50
xor eax, eax
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test byte [r15 + 0x10], 2
je 0x509f35
lea r12, [r15 + 0x2a]
mov r8d, 0x10
mov rdx, r14
mov rcx, r12
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x509fb5
mov rax, qword [r14]
mov qword [r15 + 0x2a], rax
mov rax, qword [r14 + 8]
mov qword [r12 + 8], rax
jmp 0x509daa
mov r10d, dword [0x007eff10]
test r10d, r10d
je 0x509f50
mov rcx, qword [rsp + 0x48]
xor edx, edx
call fcn.0064ab40
test eax, eax
jne 0x50a086
mov eax, dword [rsp + 0x54]
mov edx, dword [rsp + 0x50]
shl eax, 4
cmp edx, dword [0x007eff10]
je 0x509f60
xor r9d, r9d
mov dword [0x007eff10], edx
mov dword [0x007eff08], eax
mov word [0x007eff04], r9w
xor ecx, ecx
xor r8d, r8d
mov r9d, edx
mov byte [rsp + 0x63], dl
mov byte [rsp + 0x67], cl
shr r9d, 0x18
mov byte [rsp + 0x60], r9b
mov r9d, edx
sar r9d, 0x10
mov byte [rsp + 0x61], r9b
mov r9d, edx
mov edx, eax
shr edx, 0x10
sar r9d, 8
mov byte [rsp + 0x64], dl
mov edx, eax
or eax, r8d
shr edx, 8
mov byte [rsp + 0x66], al
mov byte [rsp + 0x62], r9b
mov byte [rsp + 0x65], dl
mov edx, dword [0x007eff0c]
mov eax, edx
mov byte [rsp + 0x6b], dl
shr eax, 0x18
mov byte [rsp + 0x68], al
mov eax, edx
shr eax, 0x10
mov byte [rsp + 0x69], al
mov eax, edx
shr eax, 8
mov byte [rsp + 0x6a], al
mov eax, dword [0x007eff00]
mov ecx, eax
mov byte [rsp + 0x6f], al
shr ecx, 0x18
mov byte [rsp + 0x6c], cl
mov ecx, eax
shr ecx, 0x10
mov byte [rsp + 0x6d], cl
mov ecx, eax
add eax, 1
shr ecx, 8
test eax, eax
mov dword [0x007eff00], eax
mov byte [rsp + 0x6e], cl
jne 0x509ce7
add edx, 1
mov dword [0x007eff0c], edx
jmp 0x509ce7
mov rax, qword [r14]
mov qword [r15 + 0x2a], rax
mov rax, qword [r14 + 8]
or byte [r15 + 0x10], 2
mov qword [r15 + 0x32], rax
jmp 0x509dd4
call sub.msvcrt.dll__getpid
mov dword [0x007eff0c], eax
jmp 0x509e40
cmp eax, dword [0x007eff08]
jne 0x509e6b
movzx ecx, word [0x007eff04]
add ecx, 1
and cx, 0xfff
mov r10d, ecx
mov word [0x007eff04], cx
shr r10w, 8
mov r8d, r10d
jmp 0x509e87
cmp dword [r15 + 0x14], 0x3e8
jbe 0x509c5b
mov rcx, r15
call fcn.0050a320
mov dword [r15 + 0x14], 0
jmp 0x509c5b
lea rax, str.duplicate_128_bit_block_returned_by_RNG
lea r8, str.x931_aes_driver
lea rcx, str.random_fips.c
xor r9d, r9d
mov edx, 0x1fb
mov qword [rsp + 0x20], rax
call fcn.004db2e0
mov eax, 0xffffffff
jmp 0x509ddf
lea r9, str.x931_get_dt
lea rdx, str.random_fips.c
lea rcx, str.fips_rng_is_locked
mov r8d, 0x117
call fcn.004cb9b0
lea r9, str.x931_aes_driver
lea rdx, str.random_fips.c
lea rcx, str.tempvalue_for_x931_aes_driver
mov r8d, 0x1c5
call fcn.004cb9b0
lea r9, str.x931_aes_driver
lea rdx, str.random_fips.c
lea rcx, str.rng_ctx__is_seeded
mov r8d, 0x1c3
call fcn.004cb9b0
lea r9, str.x931_aes_driver
lea rdx, str.random_fips.c
lea rcx, str.rng_ctx__cipher_hd
mov r8d, 0x1c2
call fcn.004cb9b0
lea r9, str.x931_aes_driver
lea rdx, str.random_fips.c
lea rcx, str.fips_rng_is_locked
mov r8d, 0x1c1
call fcn.004cb9b0
call qword [sym.imp.msvcrt.dll__errno]
mov ecx, dword [rax]
call sub.msvcrt.dll_strerror
lea rcx, str.gettimeofday___failed:__s_n
mov rdx, rax
call fcn.004cba70
nop
nop word cs:[rax + rax]