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

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
sub rsp, 0x8c0
mov rax, qword [0x100080218]
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 0x1000406f6
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 0x1000408aa
mov rbx, qword [rsp + 0x38]
mov rbp, rbx
jmp 0x1000406fb
mov qword [rsp + 0x38], rbx
lea rax, [rsp + 0x60]
lea rdx, [0x1000759c0]
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 0x1000408aa
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x58]
lea rdx, [0x100075a30]
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 0x1000408aa
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 0x1000408aa
cmp dword [rsp + 0x910], eax
jne 0x1000407ed
mov rcx, r12
call fcn.100005f84
mov rsi, rax
test rax, rax
jne 0x1000407b7
mov rcx, qword [rsp + 0x60]
mov rdx, rdi
call fcn.100040c60
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.100006af0
lea rcx, [rsp + 0x50]
mov edx, 1
call fcn.10000915c
jmp 0x1000408aa
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.100040514
test eax, eax
jne 0x10004085b
mov rcx, qword [rsp + 0x58]
lea rdx, [0x100075900]
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, [0x1000776b0]
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 0x10004089a
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 0x1000408ba
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1000408ca
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x1000408da
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
test rbp, rbp
je 0x1000408e8
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