Function at 0x1800308a4
Capabilities:
Set registry value

Disassembly:
push rbp
push rdi
push r12
push r13
push r14
lea rbp, [rsp - 0x250]
sub rsp, 0x350
mov rax, qword [0x180093630]
xor rax, rsp
mov qword [rbp + 0x240], rax
xor edi, edi
mov dword [rsp + 0x50], edx
cmp byte [0x1800962f8], dil
mov r13, r8
mov r12d, edx
mov dword [rsp + 0x54], edi
mov r14d, ecx
jne 0x1800308f3
mov eax, 0xc0000001
jmp 0x180030cc2
mov qword [rsp + 0x380], rbx
lea rcx, [0x180096140]
mov qword [rsp + 0x388], rsi
call qword [sym.imp.ntdll.dll_RtlEnterCriticalSection]
mov rsi, qword [0x1800960e8]
test rsi, rsi
je 0x18003092c
cmp r14d, 3
je 0x180030935
mov ebx, 0xc0000030
jmp 0x180030ca3
lea eax, [r14 - 1]
cmp eax, 1
ja 0x180030922
cmp byte [0x1800961c8], dil
je 0x180030954
call fcn.1800063f0
mov ebx, eax
test eax, eax
js 0x180030ca3
mov rsi, qword [0x1800960e8]
mov qword [rsp + 0x398], r15
lea rax, [rbp + 0x30]
mov qword [rsp + 0x48], rax
lea r15, [0x180070210]
mov dword [rsp + 0x40], 0x2080000
cmp r14d, 1
jne 0x180030991
lea rdx, str.RegistryMachineSoftwarePoliciesMicrosoftWindowsSafer
lea rcx, [rsp + 0x40]
call qword [sym.imp.ntdll.dll_RtlAppendUnicodeToString]
jmp 0x180030a33
cmp r14d, 2
jne 0x180030a38
lea rcx, [rsp + 0x68]
call qword [sym.imp.ntdll.dll_RtlFormatCurrentUserKeyPath]
mov ebx, eax
test eax, eax
js 0x180030b9f
movzx ebx, word [rsp + 0x68]
add bx, 0x78
cmp word [rsp + 0x42], bx
jae 0x1800309f2
mov rcx, qword gs:[0x60]
xor edx, edx
movzx r8d, bx
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x1800309ed
mov ebx, 0xc0000017
jmp 0x180030c9b
mov word [rsp + 0x42], bx
lea rdx, [rsp + 0x68]
lea rcx, [rsp + 0x40]
call qword [sym.imp.ntdll.dll_RtlAppendUnicodeStringToString]
lea rcx, [rsp + 0x68]
mov ebx, eax
call qword [sym.imp.ntdll.dll_RtlFreeUnicodeString]
test ebx, ebx
js 0x180030b9f
lea rdx, str.SoftwarePoliciesMicrosoftWindowsSafer
lea rcx, [rsp + 0x40]
call qword [sym.imp.ntdll.dll_RtlAppendUnicodeToString]
mov ebx, eax
test eax, eax
js 0x180030b9f
mov rsi, rdi
jmp 0x180030a63
cmp r14d, 3
jne 0x180030c96
test rsi, rsi
je 0x180030a63
mov ecx, 0x5c
cmp cx, 0x5c
jne 0x180030a63
movzx eax, word [r15 + 2]
add r15, 2
movzx ecx, ax
test ax, ax
jne 0x180030a4c
mov rdx, r15
lea rcx, [rsp + 0x40]
call qword [sym.imp.ntdll.dll_RtlAppendUnicodeToString]
mov ebx, eax
test eax, eax
js 0x180030b9f
lea rax, [rsp + 0x40]
mov qword [rsp + 0x30], rdi
mov qword [rbp - 0x78], rax
lea r8, [rsp + 0x78]
mov eax, dword [0x180096064]
lea rcx, [rsp + 0x58]
xorps xmm0, xmm0
mov dword [rsp + 0x28], eax
xor r9d, r9d
mov qword [rsp + 0x20], rdi
mov edx, 0x2001b
mov dword [rsp + 0x78], 0x30
mov qword [rbp - 0x80], rsi
mov dword [rbp - 0x70], 0x40
movdqu xmmword [rbp - 0x68], xmm0
call qword [sym.imp.ntdll.dll_NtCreateKey]
mov ebx, eax
cmp eax, 0xc0000034
jne 0x180030b9f
movzx esi, word [rsp + 0x40]
xor r12b, r12b
shr si, 1
movzx r15d, di
cmp di, si
jae 0x180030b9a
mov rax, qword [rsp + 0x48]
movzx ecx, r15w
cmp word [rax + rcx*2], 0x5c
jne 0x180030b55
movzx eax, r15w
mov qword [rsp + 0x30], rdi
add ax, ax
lea r8, [rsp + 0x78]
mov word [rsp + 0x40], ax
lea rcx, [rsp + 0x60]
mov eax, dword [0x180096064]
xor r9d, r9d
mov dword [rsp + 0x28], eax
mov edx, 0x2001b
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ntdll.dll_NtCreateKey]
mov ebx, eax
test eax, eax
js 0x180030b4b
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x180030b52
cmp eax, 0xc0000034
je 0x180030b5f
mov r12b, 1
inc r15w
cmp r15w, si
jb 0x180030af0
test r12b, r12b
je 0x180030b9a
mov eax, dword [0x180096064]
lea r8, [rsp + 0x78]
add si, si
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], eax
lea rcx, [rsp + 0x58]
xor r9d, r9d
mov word [rsp + 0x40], si
mov edx, 0x2001b
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ntdll.dll_NtCreateKey]
mov ebx, eax
mov r12d, dword [rsp + 0x50]
mov rax, qword [rsp + 0x48]
test rax, rax
je 0x180030bcc
lea rcx, [rbp + 0x30]
cmp rax, rcx
je 0x180030bcc
mov rcx, qword gs:[0x60]
xor edx, edx
mov r8, qword [rsp + 0x48]
mov rcx, qword [rcx + 0x30]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
test ebx, ebx
js 0x180030c9b
lea rcx, [0x180096180]
call qword [sym.imp.ntdll.dll_RtlIsGenericTableEmpty]
test al, al
je 0x180030bef
mov ebx, 0xc0000225
jmp 0x180030c89
cmp r12d, 4
jb 0x180030c2d
test r13, r13
je 0x180030c2d
mov ebx, dword [r13]
lea rcx, [rbp - 0x40]
xor edx, edx
mov dword [rsp + 0x54], ebx
lea r8d, [rdx + 0x70]
call sub.msvcrt.dll_memset
lea rdx, [rbp - 0x40]
mov dword [rbp - 0x40], ebx
lea rcx, [0x180096180]
call qword [sym.imp.ntdll.dll_RtlLookupElementGenericTable]
mov rdi, rax
test rax, rax
je 0x180030be5
lea rdx, str.DefaultLevel
lea rcx, [rbp - 0x58]
call qword [sym.imp.ntdll.dll_RtlInitUnicodeString]
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x54]
mov dword [rsp + 0x28], 4
lea rdx, [rbp - 0x58]
mov r9d, 4
mov qword [rsp + 0x20], rax
xor r8d, r8d
call qword [sym.imp.ntdll.dll_NtSetValueKey]
mov ebx, eax
test eax, eax
js 0x180030c89
cmp r14d, 2
jne 0x180030c7d
mov qword [0x180096088], rdi
jmp 0x180030c84
mov qword [0x180095ee0], rdi
call fcn.180004f84
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ntdll.dll_NtClose]
jmp 0x180030c9b
mov ebx, 0xc00000ef
mov r15, qword [rsp + 0x398]
lea rcx, [0x180096140]
call qword [sym.imp.ntdll.dll_RtlLeaveCriticalSection]
mov rsi, qword [rsp + 0x388]
mov eax, ebx
mov rbx, qword [rsp + 0x380]
mov rcx, qword [rbp + 0x240]
xor rcx, rsp
call fcn.180017170
add rsp, 0x350
pop r14
pop r13
pop r12
pop rdi
pop rbp
ret