Function at 0x140046154
Capabilities:
Set registry value

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
mov rbp, rsp
sub rsp, 0x60
xor edi, edi
mov eax, 0x8000
and qword [rbp - 8], rdi
mov rbx, rcx
mov word [rbp + 0x38], ax
mov rcx, qword [0x14009b028]
lea r12, [0x14009b028]
lea r13, [0x140089940]
cmp rcx, r12
je 0x1400461ae
test byte [rcx + 0x1c], 4
je 0x1400461ae
cmp byte [rcx + 0x19], 5
jb 0x1400461ae
mov rcx, qword [rcx + 0x10]
lea edx, [rdi + 0x16]
mov r8, r13
call fcn.140001024
lea rax, [rbp + 0x48]
xor r8d, r8d
mov qword [rsp + 0x40], rax
lea r9, [0x140087e38]
lea rax, [rbp - 8]
mov rcx, 0xffffffff80000002
mov qword [rsp + 0x38], rax
lea rdx, str.SoftwareMicrosoftFaxSecurity
and qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x20006
and dword [rsp + 0x20], edi
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
nop dword [rax + rax]
mov esi, eax
test eax, eax
je 0x14004622e
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046227
test byte [rcx + 0x1c], 4
je 0x140046227
cmp byte [rcx + 0x19], 2
jb 0x140046227
mov rcx, qword [rcx + 0x10]
mov edx, 0x17
mov r9d, eax
mov r8, r13
call fcn.140001050
mov eax, esi
jmp 0x14004645a
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_IsValidSecurityDescriptor]
nop dword [rax + rax]
test eax, eax
jne 0x14004627e
mov ebx, 0x53a
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
lea edx, [rax + 0x18]
mov rcx, qword [rcx + 0x10]
mov r8, r13
call fcn.140001024
jmp 0x140046436
lea r8, [rbp - 0x10]
mov rcx, rbx
lea rdx, [rbp + 0x38]
call qword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
nop dword [rax + rax]
test eax, eax
jne 0x1400462d5
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
mov edx, 0x19
jmp 0x140046427
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorLength]
nop dword [rax + rax]
mov ecx, 0x8000
mov dword [rbp + 0x40], eax
test word [rbp + 0x38], cx
je 0x140046353
mov rcx, qword [rbp - 8]
lea rdx, str.Descriptor
mov dword [rsp + 0x28], eax
mov r9d, 3
xor r8d, r8d
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
nop dword [rax + rax]
mov ebx, eax
test eax, eax
je 0x140046436
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
mov edx, 0x1a
jmp 0x140046427
mov ecx, eax
call fcn.140066e68
mov rdi, rax
test rax, rax
jne 0x140046391
lea ebx, [rax + 8]
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
lea edx, [rax + 0x1b]
jmp 0x14004626d
lea r8, [rbp + 0x40]
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_MakeSelfRelativeSD]
nop dword [rax + rax]
test eax, eax
jne 0x1400463d8
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ebx, eax
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
mov edx, 0x1c
jmp 0x140046427
mov eax, dword [rbp + 0x40]
lea rdx, str.Descriptor
mov rcx, qword [rbp - 8]
mov r9d, 3
mov dword [rsp + 0x28], eax
xor r8d, r8d
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
nop dword [rax + rax]
mov ebx, eax
test eax, eax
je 0x140046436
mov rcx, qword [0x14009b028]
cmp rcx, r12
je 0x140046436
test byte [rcx + 0x1c], 4
je 0x140046436
cmp byte [rcx + 0x19], 2
jb 0x140046436
mov edx, 0x1d
mov rcx, qword [rcx + 0x10]
mov r9d, eax
mov r8, r13
call fcn.140001050
mov rcx, qword [rbp - 8]
test rcx, rcx
je 0x14004644b
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop dword [rax + rax]
test rdi, rdi
je 0x140046458
mov rcx, rdi
call fcn.140066f24
mov eax, ebx
mov rbx, qword [rsp + 0x90]
add rsp, 0x60
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret