Function at 0x401af0
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x2e8
lea rax, [rcx + 0x10]
mov dword [rsp + 0x348], r9d
mov r9d, r8d
mov rbp, rcx
mov dword [rsp + 0x340], r8d
mov rdi, rdx
xor r8d, r8d
mov rdx, qword [rcx + 8]
or r9d, 0x20019
mov qword [rsp + 0x20], rax
mov rcx, qword [rcx]
call qword [sym.imp.advapi32.dll_RegOpenKeyExW]
test eax, eax
jne 0x401dd0
lea rax, [rsp + 0xac]
mov rdx, qword [rdi + 8]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x40], rax
lea rax, [rdi + 0x10]
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x340]
mov qword [rsp + 0x30], 0
or eax, 0x2001f
mov dword [rsp + 0x20], 0
mov dword [rsp + 0x28], eax
mov rcx, qword [rdi]
call qword [sym.imp.advapi32.dll_RegCreateKeyExW]
mov rcx, qword [rbp + 0x10]
mov ebx, eax
test eax, eax
jne 0x401d98
lea rax, [rsp + 0xa0]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x98]
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x94]
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
call qword [sym.imp.advapi32.dll_RegQueryInfoKeyW]
test eax, eax
jne 0x401df0
mov ebx, dword [rsp + 0x94]
cmp dword [rsp + 0x98], ebx
cmovae ebx, dword [rsp + 0x98]
mov r14, qword [sym.imp.ucrtbase.dll_malloc]
lea ecx, [rbx + 1]
mov qword [rsp + 0x70], r14
mov dword [rsp + 0x98], ecx
mov rbx, rcx
add rcx, rcx
call r14
mov r15, rax
test rax, rax
je 0x4021dd
mov ecx, dword [rsp + 0xa0]
mov rsi, rcx
call r14
mov r13, rax
test rax, rax
je 0x4020f8
lea rax, [rsp + 0xa4]
mov qword [rsp + 0x338], rdi
xor r14d, r14d
mov edi, dword [rsp + 0x350]
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0xa8]
lea r12, [rsp + 0x9c]
mov qword [rsp + 0x68], rax
jmp 0x401cde
mov eax, dword [rsp + 0xa4]
xor r8d, r8d
mov qword [rsp + 0x20], r13
mov rdx, r15
mov r9d, dword [rsp + 0xa8]
mov dword [rsp + 0x28], eax
call qword [sym.imp.advapi32.dll_RegSetValueExW]
test eax, eax
jne 0x402110
mov ebx, dword [rsp + 0x98]
mov esi, dword [rsp + 0xa0]
add r14d, 1
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x30], r13
mov r9, r12
mov r8, r15
mov dword [rsp + 0x9c], ebx
mov rcx, qword [rbp + 0x10]
mov edx, r14d
mov qword [rsp + 0x38], rax
mov rax, qword [rsp + 0x68]
mov dword [rsp + 0xa4], esi
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0
call qword [sym.imp.advapi32.dll_RegEnumValueW]
cmp eax, 0x103
je 0x401f80
test eax, eax
jne 0x4020f0
mov rax, qword [rsp + 0x338]
mov rcx, qword [rax + 0x10]
test edi, edi
jne 0x401ca0
cmp dword [rsp + 0xac], 2
jne 0x401ca0
mov qword [rsp + 0x28], 0
xor r9d, r9d
xor r8d, r8d
mov rdx, r15
mov qword [rsp + 0x20], 0
call qword [sym.imp.advapi32.dll_RegQueryValueExW]
mov dword [rsp + 0x78], eax
test eax, eax
je 0x401e30
mov rax, qword [rsp + 0x338]
mov rcx, qword [rax + 0x10]
jmp 0x401ca0
call qword [sym.imp.advapi32.dll_RegCloseKey]
cmp ebx, 2
je 0x401dd5
mov ecx, 0x6b
mov r12d, 1
call sym.output_message
mov eax, r12d
add rsp, 0x2e8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp eax, 2
jne 0x401da3
mov ecx, 0x6e
mov r12d, 1
call sym.output_message
jmp 0x401db3
xor r12d, r12d
mov rbx, qword [sym.imp.ucrtbase.dll_free]
cmp eax, 0x103
setne r12b
xor r13d, r13d
xor r15d, r15d
mov rcx, r15
call rbx
mov rcx, r13
call rbx
mov rcx, qword [rbp + 0x10]
mov rbx, qword [sym.imp.advapi32.dll_RegCloseKey]
call rbx
mov rcx, qword [rdi + 0x10]
call rbx
jmp 0x401db3
mov rax, qword [rbp + 0x18]
xor ecx, ecx
lea rdi, [rsp + 0xb0]
mov qword [rsp + 0x80], rax
call qword [sym.imp.kernel32.dll_GetModuleHandleW]
mov r9d, 4
mov edx, 0x64
mov rbx, qword [0x0040e584]
mov rsi, rax
lea r8, [0x0040d050]
mov rcx, rax
call rbx
mov rcx, rsi
mov r9d, 4
mov edx, 0x65
lea r8, [0x0040d048]
call rbx
mov rcx, rsi
mov r9d, 4
mov edx, 0x66
lea r8, [0x0040d040]
call rbx
mov rcx, rsi
mov r9d, 0x20
mov edx, 0x70
lea r8, [section..bss]
lea rsi, [rsp + 0xd0]
call rbx
cmp word [r15], 0
lea rbx, [section..bss]
mov dword [rsp + 0x8c], r14d
cmovne rbx, r15
mov r14, qword [rsp + 0x80]
jmp 0x401efa
cmp ax, word [0x0040d048]
je 0x40216f
cmp ax, word [0x0040d040]
je 0x40217e
mov r8, rbx
mov rdx, r14
mov ecx, 0xfb
call sym.output_message
mov ecx, 0x68
call sym.output_message
mov ecx, 0xfffffff6
call qword [sym.imp.kernel32.dll_GetStdHandle]
mov rdx, rsi
mov r9, rdi
mov r8d, 0x104
mov qword [rsp + 0x20], 0
mov rcx, rax
call qword [sym.imp.kernel32.dll_ReadConsoleW]
movzx ecx, word [rsp + 0xd0]
call qword [sym.imp.ucrtbase.dll_towupper]
lea rdx, [0x0040d050]
mov word [rsp + 0xd0], ax
cmp ax, word [rdx]
jne 0x401ee0
mov r14d, dword [rsp + 0x8c]
mov rax, qword [rsp + 0x338]
mov edi, dword [rsp + 0x78]
mov rcx, qword [rax + 0x10]
jmp 0x401ca0
mov eax, dword [rsp + 0x348]
mov dword [rsp + 0x350], edi
mov rdi, qword [rsp + 0x338]
test eax, eax
je 0x4021ce
mov rbx, qword [sym.imp.ucrtbase.dll_free]
lea rax, [rsp + 0xd0]
mov qword [rsp + 0x78], r13
xor esi, esi
lea r14, [rsp + 0xb0]
mov r13, rax
mov qword [rsp + 0x68], rbx
nop dword [rax]
mov eax, dword [rsp + 0x98]
mov rcx, qword [rbp + 0x10]
mov r9, r12
mov edx, esi
mov qword [rsp + 0x38], 0
mov r8, r15
mov dword [rsp + 0x9c], eax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call qword [sym.imp.advapi32.dll_RegEnumKeyExW]
test eax, eax
jne 0x402193
mov rax, qword [rbp + 0x10]
mov r9, qword [rbp + 0x18]
mov qword [rsp + 0xb8], r15
mov qword [rsp + 0xd8], r15
mov qword [rsp + 0xb0], rax
mov rax, qword [rdi + 0x10]
mov qword [rsp + 0xd0], rax
cmp word [r9], 0
je 0x402168
mov rax, r9
nop
add rax, 2
cmp word [rax], 0
jne 0x402050
sub rax, r9
sar rax, 1
mov edx, dword [rsp + 0x9c]
mov qword [rsp + 0x60], r9
lea ebx, [rax + rdx + 2]
mov rax, qword [rsp + 0x70]
lea rcx, [rbx + rbx]
call rax
mov qword [rsp + 0xc8], rax
mov rcx, rax
test rax, rax
je 0x4021f2
mov qword [rsp + 0x20], r15
mov r9, qword [rsp + 0x60]
mov rdx, rbx
lea r8, [0x004090e0]
call sym.swprintf.constprop.0
mov eax, dword [rsp + 0x350]
mov rcx, r14
mov r8d, dword [rsp + 0x340]
mov r9d, 1
mov rdx, r13
mov dword [rsp + 0x20], eax
call sym.run_copy
mov rcx, qword [rsp + 0xc8]
mov ebx, eax
mov rax, qword [rsp + 0x68]
call rax
test ebx, ebx
jne 0x4021ae
add esi, 1
jmp 0x401fc8
mov rdi, qword [rsp + 0x338]
mov rbx, qword [sym.imp.ucrtbase.dll_free]
mov r12d, 1
jmp 0x401e09
mov rdi, qword [rsp + 0x338]
cmp eax, 2
je 0x402147
mov ecx, 0x6b
mov dword [rsp + 0x60], eax
xor r12d, r12d
call sym.output_message
mov eax, dword [rsp + 0x60]
mov rbx, qword [sym.imp.ucrtbase.dll_free]
cmp eax, 0x103
setne r12b
jmp 0x401e09
mov ecx, 0x6e
mov r12d, 1
call sym.output_message
mov rbx, qword [sym.imp.ucrtbase.dll_free]
jmp 0x401e09
xor eax, eax
jmp 0x402060
mov r14d, dword [rsp + 0x8c]
xor edi, edi
jmp 0x401ccc
mov dword [rsp + 0x78], 1
mov r14d, dword [rsp + 0x8c]
jmp 0x401f67
xor r12d, r12d
cmp eax, 0x103
mov r13, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x68]
setne r12b
jmp 0x401e09
mov r14d, ebx
mov r13, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x68]
xor r12d, r12d
cmp r14d, 0x103
setne r12b
jmp 0x401e09
mov rbx, qword [sym.imp.ucrtbase.dll_free]
xor r12d, r12d
jmp 0x401e09
mov rbx, qword [sym.imp.ucrtbase.dll_free]
xor r13d, r13d
mov r12d, 1
jmp 0x401e09
mov r13, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x68]
mov r14d, 8
jmp 0x4021bb