Function at 0x140020950
Capabilities:
Set registry value

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x3c8
mov rbp, rcx
mov r14, r8
mov r12, rdx
lea rcx, [rsp + 0x190]
xor edx, edx
mov r8d, 0x80
mov r13d, r9d
call fcn.14007cd30
mov r9d, dword [rbp + 0x470]
mov rdx, qword [rbp + 0x18]
lea r8, [rsp + 0x190]
mov rcx, r12
call fcn.14001bff0
bt dword [rbp + 0x3c], 0x1a
jae 0x1400209e5
or dword [r12 + 0x150], 0x80000000
or dword [r12 + 0x154], 0x80000000
or dword [r12 + 0x198], 0x80000000
or dword [r12 + 0x19c], 0x80000000
cmp dword [rbp + 0xa14], 1
jne 0x140020a10
lea rdx, [rbp + 0xa18]
cmp byte [rdx], 0
je 0x140020a10
cmp r13d, 1
jne 0x140020a10
lea rcx, [r12 + 8]
mov r8d, 0x104
call fcn.14007d090
xor r15d, r15d
lea rsi, [rsp + 0x70]
lea rdi, [r12 + 0x12c]
mov dword [rsp + 0x60], r15d
mov dword [rsp + 0x5c], r15d
mov dword [rsp + 0x70], r15d
mov dword [rsp + 0x74], r15d
mov ebx, r15d
mov edx, dword [rdi]
test edx, edx
je 0x140020a92
mov r8d, dword [rdi + 4]
mov eax, ebx
lea r9, [rsp + 0x5c]
shl rax, 6
lea rcx, [rsp + rax + 0x190]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
call fcn.14002be50
cmp dword [rsp + 0x60], r15d
jne 0x140020aa2
cmp dword [rsp + 0x5c], r15d
jne 0x140020aa2
bt dword [rbp + 0xb28], 0x11
jae 0x140020a92
mov eax, dword [rdi]
cmp dword [rdi + 4], eax
jbe 0x140020a92
mov ecx, eax
mov eax, dword [rdi + 4]
mov dword [rsi], 1
mov dword [rdi], eax
mov dword [rdi + 4], ecx
add ebx, 1
add rsi, 4
add rdi, 0x48
cmp ebx, 2
jb 0x140020a37
lea rcx, [rsp + 0x80]
xor edx, edx
mov r8d, 0x104
call fcn.14007cd30
lea rcx, [rsp + 0x2b0]
xor edx, edx
mov r8d, 0x104
call fcn.14007cd30
cmp r13d, 1
mov qword [rsp + 0x50], r15
mov dword [rsp + 0x68], r15d
jne 0x140020afa
lea rcx, [0x1400e1fb0]
mov rdx, r12
mov r8d, 0x1a0
call fcn.14007d090
lea rdx, str.Connected_
jmp 0x140020b22
cmp r13d, 2
je 0x140020b06
cmp r13d, 3
jne 0x140020b2f
lea rcx, [0x1400e1d00]
mov rdx, r12
mov r8d, 0x1a0
call fcn.14007d090
lea rdx, str.Selected_
lea rcx, [rsp + 0x80]
call fcn.14001bdd0
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x80]
lea rbx, [r12 + 8]
repne scasb al, byte [rdi]
xor ecx, ecx
mov qword [rsp + 0x78], rbx
nop
nop
movzx eax, byte [rbx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x140020b50
lea rdx, [rsp + 0x80]
lea rcx, str.SubKey__s_n
call fcn.14000cbb0
test r14, r14
je 0x140020c07
lea rax, [rsp + 0x50]
lea rdx, [rsp + 0x80]
mov r9d, 0x2001f
xor r8d, r8d
mov rcx, r14
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x140020bf9
lea rax, [rsp + 0x68]
lea rdx, [rsp + 0x80]
xor r9d, r9d
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x50]
xor r8d, r8d
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r15
mov rcx, r14
mov dword [rsp + 0x28], 0x2001f
mov dword [rsp + 0x20], r15d
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
je 0x140020bf9
lea rcx, str.Failed_to_open_registry_key.
call fcn.14000cbb0
xor eax, eax
jmp 0x1400212e4
mov rdx, qword [rsp + 0x50]
lea rcx, [rbp + 0x40]
call fcn.140041310
test r14, r14
mov edi, r15d
mov dword [rsp + 0x58], r15d
je 0x140020c95
cmp r13d, 2
je 0x140020c24
cmp r13d, 3
jne 0x140020c95
lea r8, [rbp + 0xf4]
test r8, r8
je 0x140020c8c
cmp byte [r8 + 8], r15b
lea rdi, [r8 + 8]
je 0x140020c8c
mov rax, rbx
sub rdi, rbx
movzx edx, byte [rax]
movzx ecx, byte [rax + rdi]
sub edx, ecx
jne 0x140020c53
add rax, 1
test ecx, ecx
jne 0x140020c40
test edx, edx
jne 0x140020c8c
mov eax, dword [r8 + 0x114]
cmp dword [r12 + 0x114], eax
jne 0x140020c8c
mov eax, dword [r8 + 0x15c]
cmp dword [r12 + 0x15c], eax
jne 0x140020c8c
test byte [rbp + 0x45c], 2
mov edi, r15d
je 0x140020c95
mov dword [rsp + 0x58], r15d
jmp 0x140020c95
mov edi, 2
mov dword [rsp + 0x58], edi
cmp dword [rsp + 0x60], r15d
jne 0x140020ca3
cmp dword [rsp + 0x5c], r15d
je 0x140020caa
or edi, 1
mov dword [rsp + 0x58], edi
lea rcx, [rbp + 0xf4]
mov rdx, r12
mov r8d, 0x1a0
call fcn.14007d090
or dword [rbp + 0x45c], edi
mov dword [rsp + 0x64], r15d
mov esi, r15d
lea r14, [r12 + 0x138]
lea rbx, [rsp + 0x190]
lea r15, [rsp + 0x190]
lea r12, [rsp + 0x70]
nop
nop
xor edi, edi
lea rcx, [rsp + 0x210]
xor edx, edx
mov r8d, 0x9c
lea r13d, [rdi + 1]
mov dword [rsp + 0x410], edi
call fcn.14007cd30
cmp dword [r14 - 0x24], edi
mov word [rsp + 0x234], 0x9c
je 0x140020e23
mov rcx, qword [rbp + 0x18]
call fcn.140047300
cmp eax, 2
je 0x140020d42
mov rcx, qword [rbp + 0x18]
call fcn.140047300
cmp eax, 3
jne 0x140020dae
mov rcx, qword [rbp + 0x18]
call fcn.140047180
bt eax, 0x15
jae 0x140020dae
cmp dword [rbp + 0x470], 0xb
je 0x140020dae
cmp dword [rsp + 0x430], edi
jne 0x140020dae
lea rdx, [rsp + 0x410]
xor r8d, r8d
mov rcx, rbx
call fcn.140065e40
test eax, eax
je 0x140020dae
bt dword [rbp + 0xb28], 0x11
jae 0x140020db5
cmp dword [r12], edi
mov eax, dword [rsp + 0x410]
je 0x140020da4
test eax, eax
je 0x140020d9a
cmp eax, 2
jne 0x140020db5
mov dword [rsp + 0x410], r13d
jmp 0x140020db5
cmp eax, r13d
je 0x140020dae
cmp eax, 3
jne 0x140020db5
mov dword [rsp + 0x410], edi
lea r8, [rsp + 0x210]
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.USER32.dll_EnumDisplaySettingsA]
test eax, eax
jne 0x140020ddf
lea rcx, str.SaveDeviceProfileToReg:_EnumDisplaySettings_failed_for__s
mov rdx, rbx
call fcn.14000cbb0
xor r13d, r13d
lea rcx, [0x1400e0890]
mov rdx, rbx
call fcn.14003a020
lea rcx, [0x1400e0890]
mov edx, eax
call fcn.14003ae60
test al, 4
je 0x140020e15
lea rcx, [rbp + 0x40]
mov r8d, 4
mov edx, esi
call fcn.140040a00
mov dword [rsp + 0x64], esi
test r13d, r13d
je 0x140020e75
mov edi, dword [rsp + 0x410]
jmp 0x140020e26
mov byte [r15], dil
lea r13, [rbp + 0x40]
mov r8d, edi
mov edx, esi
mov rcx, r13
call fcn.140040af0
mov r8, rbx
mov edx, esi
mov rcx, r13
call fcn.140040970
lea r8, [rsp + 0x210]
mov edx, esi
mov rcx, r13
call fcn.1400409d0
call fcn.1400673f0
cmp eax, 8
jl 0x140020e79
cmp dword [rbp + 0x470], 1
jne 0x140020e79
mov eax, dword [rsp + 0x288]
mov dword [r14], eax
jmp 0x140020e79
lea r13, [rbp + 0x40]
add esi, 1
add rbx, 0x40
add r12, 4
add r15, 0x40
add r14, 0x48
cmp esi, 2
jb 0x140020cf0
cmp dword [rsp + 0x58], 2
mov r12, qword [rsp + 0x418]
jne 0x140020f32
cmp dword [r12 + 0x114], 0
je 0x140020f32
cmp dword [r12 + 0x15c], 0
je 0x140020f32
mov edx, dword [rsp + 0x64]
mov rcx, r13
lea ebx, [rdx - 1]
and ebx, 1
call fcn.140040a70
mov edx, ebx
mov rcx, r13
mov rdi, rax
call fcn.140040a70
xor r15d, r15d
mov edx, ebx
mov r8, rax
mov dword [rax + 0x34], r15d
lea rax, [rbx + rbx*8]
mov ecx, dword [r12 + rax*8 + 0x134]
mov dword [r8 + 0x68], ecx
mov ecx, dword [r12 + rax*8 + 0x12c]
mov dword [r8 + 0x6c], ecx
mov ecx, dword [r12 + rax*8 + 0x130]
mov dword [r8 + 0x70], ecx
mov ecx, dword [r12 + rax*8 + 0x138]
mov dword [r8 + 0x78], ecx
mov ecx, dword [rdi + 0x6c]
mov dword [r8 + 0x30], r15d
mov dword [r8 + 0x2c], ecx
mov rcx, r13
call fcn.1400409d0
jmp 0x140020f35
xor r15d, r15d
bt dword [rbp + 0x3c], 0x19
jae 0x140020f5f
lea r8, [rsp + 0x190]
mov rdx, r12
mov rcx, rbp
call fcn.14001e910
test eax, eax
jne 0x140020f5f
lea rcx, str.SaveDeviceProfileToReg:_GetMaxResolutions_failed_n
call fcn.14000cbb0
mov r14, qword [rsp + 0x420]
test r14, r14
je 0x1400212df
mov eax, dword [r12 + 0x134]
mov r9d, dword [r12 + 0x138]
mov r8d, dword [r12 + 0x130]
mov edx, dword [r12 + 0x12c]
lea rcx, str.SaveDeviceProfileToReg._Saved_Mode_for_Drive_0__Width__d___Hight__d___Freq__d___Bpp__d_
mov dword [rsp + 0x20], eax
call fcn.14000cbb0
mov edx, dword [r12 + 0x17c]
mov r9d, dword [r12 + 0x180]
mov r8d, dword [r12 + 0x178]
mov dword [rsp + 0x20], edx
mov edx, dword [r12 + 0x174]
lea rcx, str.SaveDeviceProfileToReg._Saved_Mode_for_Drive_1__Width__d___Hight__d___Freq__d___Bpp__d_
call fcn.14000cbb0
mov rdx, qword [rsp + 0x50]
mov rcx, r13
call fcn.1400410d0
cmp dword [rsp + 0x428], 2
jne 0x140021135
bt dword [rbp + 0x3c], 0x14
jae 0x140021135
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0x428]
lea rdx, str.UsedBySelectedProfile
mov r9d, 4
xor r8d, r8d
mov dword [rsp + 0x28], 4
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x428], 1
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
bt dword [rbp + 0x3c], 0x18
mov qword [rsp + 0x50], r15
jae 0x140021145
mov r12, qword [rsp + 0x78]
mov edx, 0x2d
mov rcx, r12
call fcn.14007e280
test rax, rax
mov rbx, rax
je 0x1400211c2
movzx esi, byte [rax + 1]
mov ecx, 0x31
mov r8d, 0x104
test sil, sil
cmovne ecx, r15d
xor edx, edx
mov byte [rax + 1], cl
lea rcx, [rsp + 0x80]
call fcn.14007cd30
lea rdx, str.Selected_
lea rcx, [rsp + 0x80]
call fcn.14001bdd0
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x80]
repne scasb al, byte [rdi]
xor ecx, ecx
nop
nop
movzx eax, byte [r12 + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x1400210c0
lea rax, [rsp + 0x50]
lea rdx, [rsp + 0x80]
mov r9d, 0x2001f
xor r8d, r8d
mov rcx, r14
mov byte [rbx + 1], sil
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x140021145
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0x428]
lea rdx, str.UsedBySelectedProfile
mov r9d, 4
xor r8d, r8d
mov dword [rsp + 0x28], 4
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x428], r15d
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov qword [rsp + 0x50], r15
bt dword [rbp + 0x3c], 0x14
jae 0x1400212d8
lea rcx, [rsp + 0x80]
xor edx, edx
mov r8d, 0x104
call fcn.14007cd30
lea rdx, str.Connected_
lea rcx, [rsp + 0x80]
call fcn.14001bdd0
or rcx, 0xffffffffffffffff
xor eax, eax
lea rdi, [rsp + 0x80]
lea rbx, [0x1400e1ea0]
repne scasb al, byte [rdi]
xor ecx, ecx
cmp dword [rbp + 0xa14], 1
je 0x1400211e0
lea rdx, [0x1400e2150]
nop
nop
nop
nop
movzx eax, byte [rdx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x1400211b0
jmp 0x1400211f0
lea rcx, str.SaveDeviceProfileToReg._something_really_WRONG._PROFILE_KEY_SEPARATOR_not_find_at_the_end__s
mov rdx, r12
call fcn.14000cbb0
xor eax, eax
jmp 0x1400212e4
movzx eax, byte [rbx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x1400211e0
lea rax, [rsp + 0x50]
lea rdx, [rsp + 0x80]
mov r9d, 0x2001f
xor r8d, r8d
mov rcx, r14
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x14002125d
lea rax, [rsp + 0x68]
lea rdx, [rsp + 0x80]
xor r9d, r9d
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x50]
xor r8d, r8d
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r15
mov rcx, r14
mov dword [rsp + 0x28], 0x2001f
mov dword [rsp + 0x20], r15d
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x140020be6
lea rcx, [rsp + 0x2b0]
xor edx, edx
mov r8d, 0x104
call fcn.14007cd30
mov rax, qword [str.SelectedProfileKey]
mov rcx, qword [rsp + 0x50]
lea rdx, [rsp + 0x2b0]
mov r9d, 7
xor r8d, r8d
mov qword [rdx], rax
mov rax, qword [0x1400ab548]
mov dword [rsp + 0x28], 0x104
mov qword [rdx + 8], rax
movzx eax, word [0x1400ab550]
mov qword [rsp + 0x20], rbx
mov word [rdx + 0x10], ax
movzx eax, byte [0x1400ab552]
mov byte [rdx + 0x12], al
lea rdx, [rsp + 0x2b0]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
or dword [rbp + 0xb28], 0x20
mov eax, 1
add rsp, 0x3c8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret