Function at 0x407560
Capabilities:
Set registry value

Disassembly:
mov r11, rsp
sub rsp, 0x2d8
mov rax, qword [0x004212c8]
xor rax, rsp
mov qword [rsp + 0x2a0], rax
mov qword [r11 - 0x10], rbp
xor ebp, ebp
mov rdx, r8
mov qword [r11 - 0x250], 7
mov qword [r11 - 0x258], rbp
lea r8, str.driverinf
lea r9d, [rbp + 1]
lea rcx, [0x00423b60]
mov qword [r11 - 0x20], rdi
mov word [rsp + 0x70], bp
mov dword [rsp + 0x50], ebp
mov dword [rsp + 0x64], 0x104
call fcn.00402310
lea rdx, str.uninstall
lea rcx, [0x00423b60]
call fcn.004029f0
test eax, eax
je 0x4076ea
lea rdx, str.flags
lea rcx, [0x00423b60]
call fcn.00402d80
mov rcx, rax
call fcn.00409fc0
lea rdx, str.driverinf
lea rcx, [0x00423b60]
mov edi, eax
call fcn.00402d80
lea r9, [rsp + 0x50]
xor r8d, r8d
mov edx, edi
mov rcx, rax
call qword [sym.imp.DIFXAPI.dll_DriverPackageUninstallW]
lea rdx, str.keypath
lea rcx, [0x00423b60]
mov dword [rsp + 0x54], eax
call fcn.00402d80
mov qword [rsp + 0x40], rbp
mov rdx, rax
lea rax, [rsp + 0x58]
xor r9d, r9d
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbp
xor r8d, r8d
mov rcx, 0xffffffff80000002
mov dword [rsp + 0x28], 0xf023f
mov dword [rsp + 0x20], ebp
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x407a5e
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x54]
lea r9d, [rbp + 4]
lea rdx, str.Code
xor r8d, r8d
mov dword [rsp + 0x28], 4
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
cmp dword [rsp + 0x50], ebp
mov rcx, qword [rsp + 0x58]
setne bpl
lea rax, [rsp + 0x60]
lea rdx, str.Reboot
xor r8d, r8d
mov r9d, 4
mov dword [rsp + 0x28], 4
mov dword [rsp + 0x60], ebp
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x407a5e
lea rdx, str.driverinf
lea rcx, [0x00423b60]
call fcn.004029f0
test eax, eax
je 0x407a77
lea rdx, str.flags
lea rcx, [0x00423b60]
call fcn.004029f0
test eax, eax
je 0x407a77
lea rdx, str.keypath
lea rcx, [0x00423b60]
call fcn.004029f0
test eax, eax
je 0x407a77
lea rdx, str.driverinf
lea rcx, [0x00423b60]
mov qword [rsp + 0x2d0], rbx
mov qword [rsp + 0x2c0], rsi
call fcn.00402d80
mov r8, qword [rsp + 0x88]
mov rsi, rax
xor eax, eax
mov rcx, 0xffffffffffffffff
mov rdi, rsi
lea rdx, [rsp + 0x70]
repne scasw ax, word [rdi]
mov rdi, qword [rsp + 0x70]
cmp r8, 8
not rcx
cmovae rdx, rdi
cmp rsi, rdx
lea rbx, [rcx - 1]
mov rcx, qword [rsp + 0x80]
jb 0x4077e1
cmp r8, 8
lea rax, [rsp + 0x70]
cmovae rax, rdi
lea rax, [rax + rcx*2]
cmp rax, rsi
jbe 0x4077e1
cmp r8, 8
lea rax, [rsp + 0x70]
lea rdx, [rsp + 0x68]
cmovae rax, rdi
lea rcx, [rsp + 0x68]
mov r9, rbx
sub rsi, rax
sar rsi, 1
mov r8, rsi
call fcn.00406b90
jmp 0x407875
movabs rax, 0x7ffffffffffffffe
cmp rbx, rax
jbe 0x40780a
call fcn.00408580
mov r8, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x80]
mov rdi, qword [rsp + 0x70]
cmp r8, rbx
jae 0x4078de
mov r8, rcx
lea rcx, [rsp + 0x68]
mov rdx, rbx
call fcn.00406e00
mov r8, qword [rsp + 0x88]
mov rdi, qword [rsp + 0x70]
test rbx, rbx
je 0x407875
cmp r8, 8
lea rdx, [r8 + r8]
lea rcx, [rsp + 0x70]
cmovae rcx, rdi
lea rdi, [rbx + rbx]
mov r8, rsi
mov r9, rdi
call fcn.00409d10
cmp qword [rsp + 0x88], 8
lea rax, [rsp + 0x70]
cmovae rax, qword [rsp + 0x70]
mov qword [rsp + 0x80], rbx
mov word [rdi + rax], bp
lea rdx, str.flags
lea rcx, [0x00423b60]
call fcn.00402d80
mov rcx, rax
call fcn.00409fc0
lea rdx, str.preinstall
lea rcx, [0x00423b60]
mov edi, eax
call fcn.004029f0
mov rsi, qword [rsp + 0x2c0]
test eax, eax
mov rbx, qword [rsp + 0x2d0]
je 0x407904
cmp qword [rsp + 0x88], 8
lea rcx, [rsp + 0x70]
cmovae rcx, qword [rsp + 0x70]
or edi, 1
mov edx, edi
call qword [sym.imp.DIFXAPI.dll_DriverPackagePreinstallW]
mov dword [rsp + 0x54], eax
jmp 0x40792c
test rbx, rbx
jne 0x407830
lea rax, [rsp + 0x70]
cmp r8, 8
mov qword [rsp + 0x80], rbp
cmovae rax, rdi
mov word [rax], bp
jmp 0x407875
cmp qword [rsp + 0x88], 8
lea rcx, [rsp + 0x70]
lea r9, [rsp + 0x50]
cmovae rcx, qword [rsp + 0x70]
xor r8d, r8d
mov edx, edi
call qword [sym.imp.DIFXAPI.dll_DriverPackageInstallW]
mov dword [rsp + 0x54], eax
cmp qword [rsp + 0x88], 8
lea rcx, [rsp + 0x70]
lea r8, [rsp + 0x64]
cmovae rcx, qword [rsp + 0x70]
lea rdx, [rsp + 0x90]
call qword [sym.imp.DIFXAPI.dll_DriverPackageGetPathW]
lea rdx, str.keypath
lea rcx, [0x00423b60]
call fcn.00402d80
mov qword [rsp + 0x40], rbp
xor r9d, r9d
mov rdx, rax
lea rax, [rsp + 0x58]
xor r8d, r8d
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rbp
mov rcx, 0xffffffff80000002
mov dword [rsp + 0x28], 0xf023f
mov dword [rsp + 0x20], ebp
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x407a5e
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x54]
lea rdx, str.Code
mov r9d, 4
xor r8d, r8d
mov dword [rsp + 0x28], 4
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
cmp dword [rsp + 0x50], ebp
mov rcx, qword [rsp + 0x58]
setne bpl
lea rax, [rsp + 0x60]
lea rdx, str.Reboot
xor r8d, r8d
mov r9d, 4
mov dword [rsp + 0x28], 4
mov dword [rsp + 0x60], ebp
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
xor eax, eax
lea rdi, [rsp + 0x90]
mov rcx, 0xffffffffffffffff
lea rdx, str.StorePath
mov r9d, 1
repne scasw ax, word [rdi]
lea rax, [rsp + 0x90]
xor r8d, r8d
not rcx
sub rcx, 1
add ecx, ecx
mov dword [rsp + 0x28], ecx
mov rcx, qword [rsp + 0x58]
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp qword [rsp + 0x88], 8
jb 0x407a73
mov rcx, qword [rsp + 0x70]
call fcn.00409d00
xor eax, eax
jmp 0x407a91
cmp qword [rsp + 0x88], 8
jb 0x407a8c
mov rcx, qword [rsp + 0x70]
call fcn.00409d00
mov eax, 1
mov rdi, qword [rsp + 0x2b8]
mov rbp, qword [rsp + 0x2c8]
mov rcx, qword [rsp + 0x2a0]
xor rcx, rsp
call fcn.00408e50
add rsp, 0x2d8
ret