Function at 0x180040540
Capabilities:
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x2b0]
sub rsp, 0x3b0
mov rax, qword [0x1800af380]
xor rax, rsp
mov qword [rbp + 0x2a0], rax
mov rbx, r8
mov r14d, edx
mov dword [rsp + 0x40], edx
mov rdi, rcx
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x68], rcx
mov dword [rsp + 0x30], 1
mov cl, 1
call fcn.18004510c
mov qword [rsp + 0x58], rax
lea r8, [rsp + 0x50]
lea rdx, str.Unknown_Joystick
mov rcx, rdi
call fcn.18002f430
nop
mov dword [rsp + 0x30], 1
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1800405da
mov rax, qword [rcx]
call qword [rax + 0x10]
mov rcx, rax
test rax, rax
je 0x1800405da
mov rax, qword [rax]
mov edx, 1
call qword [rax]
xorps xmm0, xmm0
movups xmmword [rbp + 0x60], xmm0
xor r15d, r15d
mov qword [rbp + 0x70], r15
mov qword [rbp + 0x78], 7
mov word [rbp + 0x60], r15w
lea r9, str.SystemCurrentControlSetControlMediaResourcesJoystick
xor r8d, r8d
mov edx, 0x38
lea rcx, [rbp + 0x60]
call fcn.18003d140
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
mov r12d, 0x5c
cmp rcx, rdx
jae 0x18004063b
lea rax, [rcx + 1]
mov qword [rbp + 0x70], rax
lea rax, [rbp + 0x60]
cmp rdx, 7
cmova rax, qword [rbp + 0x60]
mov dword [rax + rcx*2], r12d
jmp 0x18004064f
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002ead0
lea r9, [rbx + 0x90]
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp word [r9 + rdi*2], 0
jne 0x180040660
mov rsi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rsi
cmp rdi, rax
ja 0x1800406ae
lea rax, [rsi + rdi]
mov qword [rbp + 0x70], rax
lea rbx, [rbp + 0x60]
cmp rcx, 7
cmova rbx, qword [rbp + 0x60]
lea rcx, [rbx + rsi*2]
lea r8, [rdi + rdi]
mov rdx, r9
call fcn.1800861c0
lea rax, [rsi + rdi]
mov word [rbx + rax*2], r15w
jmp 0x1800406c2
mov qword [rsp + 0x20], rdi
xor r8d, r8d
mov rdx, rdi
lea rcx, [rbp + 0x60]
call fcn.18003d2a0
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
cmp rcx, rdx
jae 0x1800406ed
lea rax, [rcx + 1]
mov qword [rbp + 0x70], rax
lea rax, [rbp + 0x60]
cmp rdx, 7
cmova rax, qword [rbp + 0x60]
mov dword [rax + rcx*2], 0x5c
jmp 0x180040701
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002ead0
mov rdi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rdi
cmp rax, 0x17
jb 0x180040748
lea rax, [rdi + 0x17]
mov qword [rbp + 0x70], rax
lea rbx, [rbp + 0x60]
cmp rcx, 7
cmova rbx, qword [rbp + 0x60]
lea rcx, [rbx + rdi*2]
mov r8d, 0x2e
lea rdx, str.CurrentJoystickSettings
call fcn.1800861c0
mov word [rbx + rdi*2 + 0x2e], r15w
jmp 0x180040769
mov qword [rsp + 0x20], 0x17
lea r9, str.CurrentJoystickSettings
xor r8d, r8d
mov edx, 0x17
lea rcx, [rbp + 0x60]
call fcn.18003d2a0
mov r13, 0xffffffff80000001
lea rdx, [rbp + 0x60]
cmp qword [rbp + 0x78], 7
cmova rdx, qword [rbp + 0x60]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x1800408f0
mov r13, 0xffffffff80000002
lea rdx, [rbp + 0x60]
cmp qword [rbp + 0x78], 7
cmova rdx, qword [rbp + 0x60]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x1800408f0
mov edx, eax
lea rcx, [rbp + 0x80]
call fcn.180041090
mov rbx, rax
call fcn.180030420
mov rcx, rax
lea rdx, str.Unable_to_open_registry_for_joystick_at_index
call fcn.180003a50
mov rcx, rax
mov edx, r14d
call fcn.180005970
mov rcx, rax
lea rdx, [0x18008a9f8]
call fcn.180003a50
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040827
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b580
mov rcx, rax
call fcn.180004940
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x18004087e
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040878
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004106e
call fcn.18005b938
nop
mov rdx, qword [rbp + 0x78]
cmp rdx, 7
jbe 0x1800408be
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x60]
cmp rdx, 0x1000
mov rax, rcx
jb 0x1800408b9
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041062
call fcn.18005b938
mov rbx, qword [rsp + 0x38]
mov rax, rbx
mov rcx, qword [rbp + 0x2a0]
xor rcx, rsp
call fcn.18005ba50
mov rbx, qword [rsp + 0x408]
add rsp, 0x3b0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov edx, 1
lea rcx, [rsp + 0x70]
call fcn.18003d750
nop
lea edx, [r14 + 1]
lea rcx, [rsp + 0x70]
call fcn.18003dbd0
mov rax, qword [rbp + 0x78]
cmp rax, 8
jb 0x180040949
lea rbx, [rbp + 0x60]
cmp rax, 7
cmova rbx, qword [rbp + 0x60]
mov qword [rbp + 0x70], 8
mov r8d, 0x10
lea rdx, str.Joystick
mov rcx, rbx
call fcn.1800861c0
mov word [rbx + 0x10], r15w
jmp 0x180040962
lea r9, str.Joystick
xor r8d, r8d
mov edx, 8
lea rcx, [rbp + 0x60]
call fcn.18003d140
nop
xorps xmm0, xmm0
movups xmmword [rbp + 0x80], xmm0
mov r14, r15
mov qword [rbp + 0x90], r15
mov edi, 7
mov qword [rbp + 0x98], rdi
mov word [rbp + 0x80], r15w
mov dword [rsp + 0x30], 5
mov rcx, qword [rbp - 0x18]
mov eax, ecx
and al, 0x22
cmp al, 2
je 0x1800409bf
mov rax, qword [rbp - 0x48]
mov rdx, qword [rax]
test rdx, rdx
je 0x1800409bf
mov rax, qword [rbp - 0x68]
mov r9, qword [rax]
cmp rdx, qword [rbp - 0x20]
cmovb rdx, qword [rbp - 0x20]
sub rdx, r9
jmp 0x1800409e7
test cl, 4
jne 0x180040a35
mov rax, qword [rbp - 0x50]
mov rcx, qword [rax]
test rcx, rcx
je 0x180040a35
mov rax, qword [rbp - 0x70]
mov r9, qword [rax]
mov rax, qword [rbp - 0x38]
movsxd rdx, dword [rax]
add rdx, rdx
sub rdx, r9
add rdx, rcx
mov rax, r9
sar rdx, 1
test rax, rax
je 0x180040a35
lea rcx, [rbp + 0x80]
cmp rdx, rdi
ja 0x180040a1f
mov qword [rbp + 0x90], rdx
lea rbx, [rdx + rdx]
mov r8, rbx
mov rdx, r9
call fcn.1800861c0
mov word [rbp + rbx + 0x80], r15w
jmp 0x180040a27
xor r8d, r8d
call fcn.18003d140
mov r14, qword [rbp + 0x90]
mov rdi, qword [rbp + 0x98]
mov dword [rsp + 0x30], 3
lea r9, [rbp + 0x80]
mov rsi, qword [rbp + 0x80]
cmp rdi, 7
cmova r9, rsi
mov r15, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, r15
cmp r14, rax
ja 0x180040a99
lea rax, [r15 + r14]
mov qword [rbp + 0x70], rax
lea rbx, [rbp + 0x60]
cmp rcx, 7
cmova rbx, qword [rbp + 0x60]
lea rcx, [rbx + r15*2]
lea r8, [r14 + r14]
mov rdx, r9
call fcn.1800861c0
lea rax, [r15 + r14]
xor r14d, r14d
mov word [rbx + rax*2], r14w
jmp 0x180040abe
mov qword [rsp + 0x20], r14
xor r8d, r8d
mov rdx, r14
lea rcx, [rbp + 0x60]
call fcn.18003d2a0
mov rdi, qword [rbp + 0x98]
mov rsi, qword [rbp + 0x80]
xor r14d, r14d
cmp rdi, 7
jbe 0x180040af9
lea rdx, [rdi*2 + 2]
mov rax, rsi
cmp rdx, 0x1000
jb 0x180040af1
add rdx, 0x27
mov rsi, qword [rsi - 8]
sub rax, rsi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041074
mov rcx, rsi
call fcn.18005b938
mov rdi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rdi
cmp rax, 7
jb 0x180040b40
lea rax, [rdi + 7]
mov qword [rbp + 0x70], rax
lea rbx, [rbp + 0x60]
cmp rcx, 7
cmova rbx, qword [rbp + 0x60]
lea rcx, [rbx + rdi*2]
mov r8d, 0xe
lea rdx, str.OEMName
call fcn.1800861c0
mov word [rbx + rdi*2 + 0xe], r14w
jmp 0x180040b61
mov qword [rsp + 0x20], 7
lea r9, str.OEMName
xor r8d, r8d
mov edx, 7
lea rcx, [rbp + 0x60]
call fcn.18003d2a0
mov dword [rsp + 0x34], 0x200
lea rdx, [rbp + 0x60]
cmp qword [rbp + 0x78], 7
cmova rdx, qword [rbp + 0x60]
lea rax, [rsp + 0x34]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xa0]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov ebx, eax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebx, ebx
je 0x180040ccc
mov edx, ebx
lea rcx, [rbp + 0x80]
call fcn.180041090
mov rbx, rax
call fcn.180030420
mov rcx, rax
lea rdx, str.Unable_to_query_registry_key_for_joystick_at_index
call fcn.180003a50
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005970
mov rcx, rax
lea rdx, [0x18008a9f8]
call fcn.180003a50
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040c00
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b580
mov rcx, rax
call fcn.180004940
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040c56
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040c51
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004107a
call fcn.18005b938
mov dword [rsp + 0x30], r14d
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostringstream_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__.0
mov qword [rsp + rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rsp + rcx + 0x6c], edx
lea rcx, [rsp + 0x78]
call fcn.18003d950
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__.0
mov qword [rsp + rcx + 0x70], rax
mov rax, qword [rsp + 0x70]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x10]
mov dword [rsp + rcx + 0x6c], edx
lea rax, vtable.std::ios_base.0
mov qword [rbp - 8], rax
lea rcx, [rbp - 8]
call fcn.1800459b8
nop
jmp 0x18004087e
mov rax, qword [rbp + 0x78]
cmp rax, 0x4f
jb 0x180040d0a
lea rbx, [rbp + 0x60]
cmp rax, 7
cmova rbx, qword [rbp + 0x60]
mov qword [rbp + 0x70], 0x4f
mov r8d, 0x9e
lea rdx, str.SystemCurrentControlSetControlMediaPropertiesPrivatePropertiesJoystickOEM
mov rcx, rbx
call fcn.1800861c0
mov word [rbx + 0x9e], r14w
jmp 0x180040d22
lea r9, str.SystemCurrentControlSetControlMediaPropertiesPrivatePropertiesJoystickOEM
xor r8d, r8d
mov edx, 0x4f
lea rcx, [rbp + 0x60]
call fcn.18003d140
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
cmp rcx, rdx
jae 0x180040d4d
lea rax, [rcx + 1]
mov qword [rbp + 0x70], rax
lea rax, [rbp + 0x60]
cmp rdx, 7
cmova rax, qword [rbp + 0x60]
mov dword [rax + rcx*2], 0x5c
jmp 0x180040d61
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002ead0
mov edi, dword [rsp + 0x34]
shr rdi, 1
mov rsi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rsi
cmp rdi, rax
ja 0x180040daf
lea rax, [rsi + rdi]
mov qword [rbp + 0x70], rax
lea rbx, [rbp + 0x60]
cmp rcx, 7
cmova rbx, qword [rbp + 0x60]
lea rcx, [rbx + rsi*2]
lea r8, [rdi + rdi]
lea rdx, [rbp + 0xa0]
call fcn.1800861c0
lea rax, [rsi + rdi]
mov word [rbx + rax*2], r14w
jmp 0x180040dca
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 0xa0]
xor r8d, r8d
mov rdx, rdi
lea rcx, [rbp + 0x60]
call fcn.18003d2a0
lea rdx, [rbp + 0x60]
cmp qword [rbp + 0x78], 7
cmova rdx, qword [rbp + 0x60]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x180040eaf
mov edx, eax
lea rcx, [rbp + 0x80]
call fcn.180041090
mov rbx, rax
call fcn.180030420
mov rcx, rax
lea rdx, str.Unable_to_open_registry_key_for_joystick_at_index
call fcn.180003a50
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005970
mov rcx, rax
lea rdx, [0x18008a9f8]
call fcn.180003a50
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040e49
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b580
mov rcx, rax
call fcn.180004940
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040ea0
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040e9a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041080
call fcn.18005b938
nop
lea rcx, [rsp + 0x70]
call fcn.18003ded0
jmp 0x18004087e
mov dword [rsp + 0x34], 0x200
lea rax, [rsp + 0x34]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xa0]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, str.OEMName
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov ebx, eax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rcx, [rbp + 0x80]
test ebx, ebx
je 0x180040fa5
mov edx, ebx
call fcn.180041090
mov rbx, rax
call fcn.180030420
mov rcx, rax
lea rdx, str.Unable_to_query_name_for_joystick_at_index
call fcn.180003a50
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005970
mov rcx, rax
lea rdx, [0x18008a9f8]
call fcn.180003a50
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040f47
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b580
mov rcx, rax
call fcn.180004940
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040ea0
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040e9a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041068
jmp 0x180040e9a
mov word [rbp + 0x29e], r14w
lea rdx, [rbp + 0xa0]
call fcn.18002f520
nop
lea rdx, [rbp + 0x80]
mov rbx, qword [rsp + 0x38]
mov rcx, rbx
call fcn.18002f6c0
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 3
jbe 0x180041012
lea rdx, [rdx*4 + 4]
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x18004100c
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041086
call fcn.18005b938
nop
lea rcx, [rsp + 0x70]
call fcn.18003ded0
nop
mov rdx, qword [rbp + 0x78]
cmp rdx, 7
jbe 0x1800408c3
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x60]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180041058
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041062
call fcn.18005b938
jmp 0x1800408c3
call fcn.180061df4
nop
call fcn.180061df4
nop
call fcn.180061df4
nop
call fcn.180061df4
int3
call fcn.180061df4
int3
call fcn.180061df4
int3
call fcn.180061df4
int3