Function at 0x100040610
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 0x1000406a2
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 0x100040856
mov rbx, qword [rsp + 0x38]
mov rbp, rbx
jmp 0x1000406a7
mov qword [rsp + 0x38], rbx
lea rax, [rsp + 0x60]
lea rdx, [0x100075940]
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 0x100040856
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x58]
lea rdx, [0x1000759b0]
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 0x100040856
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 0x100040856
cmp dword [rsp + 0x910], eax
jne 0x100040799
mov rcx, r12
call fcn.1000060a0
mov rsi, rax
test rax, rax
jne 0x100040763
mov rcx, qword [rsp + 0x60]
mov rdx, rdi
call fcn.100040c1c
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.100006b40
lea rcx, [rsp + 0x50]
mov edx, 1
call fcn.100009188
jmp 0x100040856
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.1000404bc
test eax, eax
jne 0x100040807
mov rcx, qword [rsp + 0x58]
lea rdx, [0x100075880]
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, [0x100077610]
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 0x100040846
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 0x100040866
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x100040876
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x100040886
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
test rbp, rbp
je 0x100040894
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