Function at 0x180040520
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.1800450ec
mov qword [rsp + 0x58], rax
lea r8, [rsp + 0x50]
lea rdx, str.Unknown_Joystick
mov rcx, rdi
call fcn.18002f410
nop
mov dword [rsp + 0x30], 1
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1800405ba
mov rax, qword [rcx]
call qword [rax + 0x10]
mov rcx, rax
test rax, rax
je 0x1800405ba
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.18003d120
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
mov r12d, 0x5c
cmp rcx, rdx
jae 0x18004061b
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 0x18004062f
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002eab0
lea r9, [rbx + 0x90]
mov rdi, 0xffffffffffffffff
nop dword [rax]
inc rdi
cmp word [r9 + rdi*2], 0
jne 0x180040640
mov rsi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rsi
cmp rdi, rax
ja 0x18004068e
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.180085fd0
lea rax, [rsi + rdi]
mov word [rbx + rax*2], r15w
jmp 0x1800406a2
mov qword [rsp + 0x20], rdi
xor r8d, r8d
mov rdx, rdi
lea rcx, [rbp + 0x60]
call fcn.18003d280
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
cmp rcx, rdx
jae 0x1800406cd
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 0x1800406e1
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002eab0
mov rdi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rdi
cmp rax, 0x17
jb 0x180040728
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.180085fd0
mov word [rbx + rdi*2 + 0x2e], r15w
jmp 0x180040749
mov qword [rsp + 0x20], 0x17
lea r9, str.CurrentJoystickSettings
xor r8d, r8d
mov edx, 0x17
lea rcx, [rbp + 0x60]
call fcn.18003d280
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 0x1800408d0
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 0x1800408d0
mov edx, eax
lea rcx, [rbp + 0x80]
call fcn.180041070
mov rbx, rax
call fcn.180030400
mov rcx, rax
lea rdx, str.Unable_to_open_registry_for_joystick_at_index
call fcn.180003a30
mov rcx, rax
mov edx, r14d
call fcn.180005950
mov rcx, rax
lea rdx, [0x18008a9e8]
call fcn.180003a30
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040807
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b560
mov rcx, rax
call fcn.180004920
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x18004085e
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040858
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004104e
call fcn.18005b918
nop
mov rdx, qword [rbp + 0x78]
cmp rdx, 7
jbe 0x18004089e
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x60]
cmp rdx, 0x1000
mov rax, rcx
jb 0x180040899
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041042
call fcn.18005b918
mov rbx, qword [rsp + 0x38]
mov rax, rbx
mov rcx, qword [rbp + 0x2a0]
xor rcx, rsp
call fcn.18005ba30
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.18003d730
nop
lea edx, [r14 + 1]
lea rcx, [rsp + 0x70]
call fcn.18003dbb0
mov rax, qword [rbp + 0x78]
cmp rax, 8
jb 0x180040929
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.180085fd0
mov word [rbx + 0x10], r15w
jmp 0x180040942
lea r9, str.Joystick
xor r8d, r8d
mov edx, 8
lea rcx, [rbp + 0x60]
call fcn.18003d120
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 0x18004099f
mov rax, qword [rbp - 0x48]
mov rdx, qword [rax]
test rdx, rdx
je 0x18004099f
mov rax, qword [rbp - 0x68]
mov r9, qword [rax]
cmp rdx, qword [rbp - 0x20]
cmovb rdx, qword [rbp - 0x20]
sub rdx, r9
jmp 0x1800409c7
test cl, 4
jne 0x180040a15
mov rax, qword [rbp - 0x50]
mov rcx, qword [rax]
test rcx, rcx
je 0x180040a15
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 0x180040a15
lea rcx, [rbp + 0x80]
cmp rdx, rdi
ja 0x1800409ff
mov qword [rbp + 0x90], rdx
lea rbx, [rdx + rdx]
mov r8, rbx
mov rdx, r9
call fcn.180085fd0
mov word [rbp + rbx + 0x80], r15w
jmp 0x180040a07
xor r8d, r8d
call fcn.18003d120
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 0x180040a79
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.180085fd0
lea rax, [r15 + r14]
xor r14d, r14d
mov word [rbx + rax*2], r14w
jmp 0x180040a9e
mov qword [rsp + 0x20], r14
xor r8d, r8d
mov rdx, r14
lea rcx, [rbp + 0x60]
call fcn.18003d280
mov rdi, qword [rbp + 0x98]
mov rsi, qword [rbp + 0x80]
xor r14d, r14d
cmp rdi, 7
jbe 0x180040ad9
lea rdx, [rdi*2 + 2]
mov rax, rsi
cmp rdx, 0x1000
jb 0x180040ad1
add rdx, 0x27
mov rsi, qword [rsi - 8]
sub rax, rsi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041054
mov rcx, rsi
call fcn.18005b918
mov rdi, qword [rbp + 0x70]
mov rcx, qword [rbp + 0x78]
mov rax, rcx
sub rax, rdi
cmp rax, 7
jb 0x180040b20
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.180085fd0
mov word [rbx + rdi*2 + 0xe], r14w
jmp 0x180040b41
mov qword [rsp + 0x20], 7
lea r9, str.OEMName
xor r8d, r8d
mov edx, 7
lea rcx, [rbp + 0x60]
call fcn.18003d280
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 0x180040cac
mov edx, ebx
lea rcx, [rbp + 0x80]
call fcn.180041070
mov rbx, rax
call fcn.180030400
mov rcx, rax
lea rdx, str.Unable_to_query_registry_key_for_joystick_at_index
call fcn.180003a30
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005950
mov rcx, rax
lea rdx, [0x18008a9e8]
call fcn.180003a30
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040be0
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b560
mov rcx, rax
call fcn.180004920
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040c36
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040c31
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x18004105a
call fcn.18005b918
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.18003d930
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.180045998
nop
jmp 0x18004085e
mov rax, qword [rbp + 0x78]
cmp rax, 0x4f
jb 0x180040cea
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.180085fd0
mov word [rbx + 0x9e], r14w
jmp 0x180040d02
lea r9, str.SystemCurrentControlSetControlMediaPropertiesPrivatePropertiesJoystickOEM
xor r8d, r8d
mov edx, 0x4f
lea rcx, [rbp + 0x60]
call fcn.18003d120
mov rcx, qword [rbp + 0x70]
mov rdx, qword [rbp + 0x78]
cmp rcx, rdx
jae 0x180040d2d
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 0x180040d41
mov r9d, r12d
xor r8d, r8d
mov edx, 1
lea rcx, [rbp + 0x60]
call fcn.18002eab0
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 0x180040d8f
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.180085fd0
lea rax, [rsi + rdi]
mov word [rbx + rax*2], r14w
jmp 0x180040daa
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 0xa0]
xor r8d, r8d
mov rdx, rdi
lea rcx, [rbp + 0x60]
call fcn.18003d280
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 0x180040e8f
mov edx, eax
lea rcx, [rbp + 0x80]
call fcn.180041070
mov rbx, rax
call fcn.180030400
mov rcx, rax
lea rdx, str.Unable_to_open_registry_key_for_joystick_at_index
call fcn.180003a30
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005950
mov rcx, rax
lea rdx, [0x18008a9e8]
call fcn.180003a30
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040e29
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b560
mov rcx, rax
call fcn.180004920
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040e80
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040e7a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041060
call fcn.18005b918
nop
lea rcx, [rsp + 0x70]
call fcn.18003deb0
jmp 0x18004085e
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 0x180040f85
mov edx, ebx
call fcn.180041070
mov rbx, rax
call fcn.180030400
mov rcx, rax
lea rdx, str.Unable_to_query_name_for_joystick_at_index
call fcn.180003a30
mov rcx, rax
mov edx, dword [rsp + 0x40]
call fcn.180005950
mov rcx, rax
lea rdx, [0x18008a9e8]
call fcn.180003a30
mov rdx, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x180040f27
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001b560
mov rcx, rax
call fcn.180004920
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 0xf
jbe 0x180040e80
inc rdx
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040e7a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041048
jmp 0x180040e7a
mov word [rbp + 0x29e], r14w
lea rdx, [rbp + 0xa0]
call fcn.18002f500
nop
lea rdx, [rbp + 0x80]
mov rbx, qword [rsp + 0x38]
mov rcx, rbx
call fcn.18002f6a0
nop
mov rdx, qword [rbp + 0x98]
cmp rdx, 3
jbe 0x180040ff2
lea rdx, [rdx*4 + 4]
mov rcx, qword [rbp + 0x80]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180040fec
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041066
call fcn.18005b918
nop
lea rcx, [rsp + 0x70]
call fcn.18003deb0
nop
mov rdx, qword [rbp + 0x78]
cmp rdx, 7
jbe 0x1800408a3
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp + 0x60]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180041038
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x180041042
call fcn.18005b918
jmp 0x1800408a3
call fcn.180061dd4
nop
call fcn.180061dd4
nop
call fcn.180061dd4
nop
call fcn.180061dd4
int3
call fcn.180061dd4
int3
call fcn.180061dd4
int3
call fcn.180061dd4
int3