Function at 0x1000405e0
Capabilities:
Delete registry value
Set registry value

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
sub rsp, 0x8c0
mov rax, qword [0x10007f258]
xor rax, rsp
mov qword [rsp + 0x8b0], rax
mov rbx, rcx
mov rdi, r8
mov rsi, rdx
lea rcx, [rsp + 0x50]
xor edx, edx
mov r8d, 0x858
mov r12, r9
xor ebp, ebp
call sub.msvcrt.dll_memset
and qword [rsp + 0x60], rbp
and qword [rsp + 0x68], rbp
and dword [rsp + 0x74], ebp
mov dword [rsp + 0x7c], 1
test rsi, rsi
je 0x100040672
lea rax, [rsp + 0x38]
mov r9d, 0x2001f
xor r8d, r8d
mov rdx, rsi
mov rcx, 0xffffffff80000003
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
mov ebx, eax
test eax, eax
jne 0x100040826
mov rbx, qword [rsp + 0x38]
mov rbp, rbx
jmp 0x100040677
mov qword [rsp + 0x38], rbx
lea rax, [rsp + 0x60]
lea rdx, [0x100075950]
mov r9d, 0x2001f
xor r8d, r8d
mov rcx, rbx
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
mov ebx, eax
test eax, eax
jne 0x100040826
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x58]
lea rdx, [0x1000759c0]
mov r9d, 0x2001f
xor r8d, r8d
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
mov ebx, eax
test eax, eax
jne 0x100040826
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x68]
mov esi, 0x20006
lea rdx, str.SoftwareMicrosoftWindows_NTCurrentVersionPrinterPorts
mov r9d, esi
xor r8d, r8d
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
mov ebx, eax
test eax, eax
jne 0x100040826
cmp dword [rsp + 0x910], eax
jne 0x100040769
mov rcx, r12
call fcn.100006090
mov rsi, rax
test rax, rax
jne 0x100040733
mov rcx, qword [rsp + 0x60]
mov rdx, rdi
call fcn.100040be8
mov dword [rsp + 0x30], eax
and dword [rsp + 0x7c], 0
lea rax, [rsp + 0x30]
lea rcx, [rsp + 0x50]
mov r9, rsi
xor r8d, r8d
mov rdx, rdi
mov qword [rsp + 0x20], rax
call fcn.100006ce0
lea rcx, [rsp + 0x50]
mov edx, 1
call fcn.100009180
jmp 0x100040826
mov rcx, qword [rsp + 0x60]
mov rdx, rdi
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegDeleteValueW]
mov rcx, qword [rsp + 0x68]
mov rdx, rdi
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegDeleteValueW]
lea rcx, [rsp + 0x50]
mov rdx, rdi
call fcn.10004048c
test eax, eax
jne 0x1000407d7
mov rcx, qword [rsp + 0x58]
lea rdx, [0x100075890]
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegDeleteValueW]
mov rcx, qword [rsp + 0x58]
and dword [rsp + 0x30], 0
lea rax, [rsp + 0x30]
mov r9d, 4
lea rdx, [0x100077620]
mov dword [rsp + 0x28], r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x40]
lea rdx, str.PrintersDevModes2
mov r9d, esi
xor r8d, r8d
mov qword [rsp + 0x20], rax
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
test eax, eax
jne 0x100040816
mov rcx, qword [rsp + 0x40]
mov rdx, rdi
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegDeleteValueW]
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x38]
xor r8d, r8d
mov rdx, rdi
call sym.spoolsv.exe_PrvbSetDevModePerUser
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x100040836
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x100040846
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x100040856
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
test rbp, rbp
je 0x100040864
mov rcx, rbp
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov eax, ebx
mov rcx, qword [rsp + 0x8b0]
xor rcx, rsp
call fcn.1000010b0
add rsp, 0x8c0
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret