Function at 0x40b840
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
lea ebp, [esp - 0x540]
sub esp, 0x540
push 0xffffffffffffffff
push 0x41553d
mov eax, dword fs:[0]
push eax
sub esp, 0x98
mov eax, dword [0x41e504]
xor eax, ebp
mov dword [ebp + 0x53c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0x548]
lea esi, [ebp + 0x550]
mov eax, dword [ebp + 0x54c]
lea edi, [ebp + 0x1c]
mov ecx, 0xb6
mov dword [ebp + 0xc], ebx
rep movsd dword es:[edi], dword [esi]
mov dword [ebp + 0x10], eax
mov dword [ebp + 8], 0
push 1
mov dword [ebp - 4], 0
call sub.MSVCP140.dll_private:_static_class_std::locale::_Locimp____cdecl_std::locale::_Init_bool_
add esp, 4
mov dword [ebp + 4], eax
lea eax, [ebp]
mov dword [ebp - 4], 1
push eax
push str.Unknown_Joystick
lea ecx, [ebp + 0x2f4]
call fcn.00412430
mov ecx, dword [ebp + 4]
mov byte [ebp - 4], 4
test ecx, ecx
je 0x40b8f0
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, eax
test ecx, ecx
je 0x40b8f0
mov eax, dword [ecx]
push 1
call dword [eax]
xor eax, eax
mov dword [ebp + 0x334], 0
mov dword [ebp + 0x338], 7
mov word [ebp + 0x324], ax
push 0x38
push str.SystemCurrentControlSetControlMediaResourcesJoystick
lea ecx, [ebp + 0x324]
mov byte [ebp - 4], 5
call fcn.00406600
push 0x5c
lea ecx, [ebp + 0x324]
call fcn.0040ca30
lea ecx, [ebp + 0xac]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b940
sub ecx, edx
lea eax, [ebp + 0xac]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp + 0x324]
call fcn.0040b160
push 0x5c
lea ecx, [ebp + 0x324]
call fcn.0040ca30
push 0x17
push str.CurrentJoystickSettings
lea ecx, [ebp + 0x324]
call fcn.0040b160
cmp dword [ebp + 0x338], 8
lea ecx, [ebp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp + 0x324]
cmovae eax, dword [ebp + 0x324]
push ecx
push 0x20019
push 0
push eax
push 0x80000001
mov dword [ebp + 0xc], 0x80000001
call esi
test eax, eax
je 0x40bab9
cmp dword [ebp + 0x338], 8
lea ecx, [ebp + 0x18]
push ecx
push 0x20019
lea eax, [ebp + 0x324]
mov dword [ebp + 0xc], 0x80000002
cmovae eax, dword [ebp + 0x324]
push 0
push eax
push 0x80000002
call esi
test eax, eax
je 0x40bab9
push eax
lea eax, [ebp + 0x30c]
push eax
call fcn.0040c040
add esp, 8
mov esi, eax
push 0x4170dc
push dword [ebp + 0x10]
mov byte [ebp - 4], 6
push str.Unable_to_open_registry_for_joystick_at_index
call fcn.00413040
push eax
call fcn.00401b80
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int_]
push eax
call fcn.00401b80
mov ecx, dword [esi + 0x10]
add esp, 8
cmp dword [esi + 0x14], 0x10
jb 0x40ba40
mov esi, dword [esi]
push 0x401dd0
push ecx
push esi
push eax
call fcn.00405d40
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea ecx, [ebp + 0x30c]
mov byte [ebp - 4], 5
call fcn.00403490
lea eax, [ebp + 0x2f4]
mov ecx, ebx
push eax
call fcn.00412370
mov edx, dword [ebp + 0x338]
cmp edx, 8
jb 0x40bfe8
mov ecx, dword [ebp + 0x324]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bfde
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40bfde
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
lea ecx, [ebp - 0x54]
mov dword [ebp - 0xa4], 0x41692c
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_ios_wchar_t__struct_std::char_traits_wchar_t__::constructor_void_]
push 0
push 0
lea eax, [ebp - 0xa0]
mov byte [ebp - 4], 7
push eax
lea ecx, [ebp - 0xa4]
mov dword [ebp + 8], 2
call dword [sym.imp.MSVCP140.dll_public:_void___thiscall_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::constructor_class_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t_____bool_]
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 4], 8
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xa4], vtable.std::basic_ostringstream_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__.0
mov eax, dword [ebp - 0xa4]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x50]
mov dword [ebp + ecx - 0xa8], eax
lea ecx, [ebp - 0xa0]
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::constructor_void_]
mov dword [ebp - 0xa0], vtable.std::basic_stringbuf_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__.0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 4
mov edi, dword [ebp + 0x10]
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 9
lea eax, [edi + 1]
push eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______thiscall_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___unsigned_int_]
push 8
push str.Joystick
lea ecx, [ebp + 0x324]
call fcn.00406600
mov ecx, dword [ebp - 0x64]
xor eax, eax
mov byte [ebp - 4], 0xa
mov dword [ebp + 0x31c], 0
mov dword [ebp + 0x320], 7
mov word [ebp + 0x30c], ax
mov dword [ebp + 8], 0xa
test cl, 2
jne 0x40bbb8
mov eax, dword [ebp - 0x80]
mov edx, dword [eax]
test edx, edx
je 0x40bbb8
cmp edx, dword [ebp - 0x68]
mov eax, dword [ebp - 0x90]
cmovb edx, dword [ebp - 0x68]
mov ecx, dword [eax]
sub edx, ecx
sar edx, 1
push edx
jmp 0x40bbdf
test cl, 4
jne 0x40bbeb
mov eax, dword [ebp - 0x84]
mov edx, dword [eax]
test edx, edx
je 0x40bbeb
mov eax, dword [ebp - 0x94]
mov ecx, dword [eax]
mov eax, dword [ebp - 0x74]
mov eax, dword [eax]
add eax, eax
sub eax, ecx
add eax, edx
sar eax, 1
push eax
push ecx
lea ecx, [ebp + 0x30c]
call fcn.00406600
cmp dword [ebp + 0x320], 8
lea eax, [ebp + 0x30c]
push dword [ebp + 0x31c]
cmovae eax, dword [ebp + 0x30c]
lea ecx, [ebp + 0x324]
push eax
mov dword [ebp - 4], 0xb
call fcn.0040b160
mov edx, dword [ebp + 0x320]
mov byte [ebp - 4], 9
cmp edx, 8
jb 0x40bc5e
mov ecx, dword [ebp + 0x30c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bc54
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40bc54
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004137f2
add esp, 8
push 7
push str.OEMName
lea ecx, [ebp + 0x324]
call fcn.0040b160
cmp dword [ebp + 0x338], 8
lea ecx, [ebp + 0x14]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [ebp + 0x324]
cmovae eax, dword [ebp + 0x324]
push ecx
lea ecx, [ebp + 0x33c]
mov dword [ebp + 0x14], 0x200
push ecx
push 0
push 0
push eax
push dword [ebp + 0x18]
call esi
push dword [ebp + 0x18]
mov dword [ebp + 0x10], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40bd89
push eax
lea eax, [ebp + 0x30c]
push eax
call fcn.0040c040
add esp, 8
mov esi, eax
push 0x4170dc
push edi
push str.Unable_to_query_registry_key_for_joystick_at_index
mov byte [ebp - 4], 0xc
call fcn.00413040
push eax
call fcn.00401b80
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int_]
push eax
call fcn.00401b80
mov ecx, dword [esi + 0x10]
add esp, 8
cmp dword [esi + 0x14], 0x10
jb 0x40bd08
mov esi, dword [esi]
push 0x401dd0
push ecx
push esi
push eax
call fcn.00405d40
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea ecx, [ebp + 0x30c]
mov byte [ebp - 4], 9
call fcn.00403490
lea eax, [ebp + 0x2f4]
mov ecx, ebx
push eax
call fcn.00412370
mov eax, dword [ebp - 0xa4]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xa4], vtable.std::basic_ostringstream_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__.0
mov eax, dword [ebp - 0xa4]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x50]
mov dword [ebp + ecx - 0xa8], eax
lea ecx, [ebp - 0xa0]
call fcn.00406160
lea ecx, [ebp - 0x9c]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::destructor_void_]
lea ecx, [ebp - 0x54]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_ios_wchar_t__struct_std::char_traits_wchar_t__::destructor_void_]
jmp 0x40ba75
push 0x4f
push str.SystemCurrentControlSetControlMediaPropertiesPrivatePropertiesJoystickOEM
lea ecx, [ebp + 0x324]
call fcn.00406600
push 0x5c
lea ecx, [ebp + 0x324]
call fcn.0040ca30
mov eax, dword [ebp + 0x14]
lea ecx, [ebp + 0x324]
shr eax, 1
push eax
lea eax, [ebp + 0x33c]
push eax
call fcn.0040b160
cmp dword [ebp + 0x338], 8
lea ecx, [ebp + 0x18]
push ecx
push 0x20019
lea eax, [ebp + 0x324]
cmovae eax, dword [ebp + 0x324]
push 0
push eax
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x40bebd
push eax
lea eax, [ebp + 0x30c]
push eax
call fcn.0040c040
add esp, 8
mov esi, eax
push 0x4170dc
push edi
push str.Unable_to_open_registry_key_for_joystick_at_index
mov byte [ebp - 4], 0xd
call fcn.00413040
push eax
call fcn.00401b80
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int_]
push eax
call fcn.00401b80
mov ecx, dword [esi + 0x10]
add esp, 8
cmp dword [esi + 0x14], 0x10
jb 0x40be3c
mov esi, dword [esi]
push 0x401dd0
push ecx
push esi
push eax
call fcn.00405d40
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea ecx, [ebp + 0x30c]
mov byte [ebp - 4], 9
call fcn.00403490
lea eax, [ebp + 0x2f4]
mov ecx, ebx
push eax
call fcn.00412370
mov eax, dword [ebp - 0xa4]
mov eax, dword [eax + 4]
mov dword [ebp + eax - 0xa4], vtable.std::basic_ostringstream_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__.0
mov eax, dword [ebp - 0xa4]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x50]
mov dword [ebp + ecx - 0xa8], eax
lea ecx, [ebp - 0xa0]
call fcn.00406160
lea ecx, [ebp - 0x9c]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::destructor_void_]
lea ecx, [ebp - 0x54]
call dword [sym.imp.MSVCP140.dll_public_virtual:_void___thiscall_std::basic_ios_wchar_t__struct_std::char_traits_wchar_t__::destructor_void_]
jmp 0x40ba75
lea eax, [ebp + 0x14]
mov dword [ebp + 0x14], 0x200
push eax
lea eax, [ebp + 0x33c]
push eax
push 0
push 0
push str.OEMName
push dword [ebp + 0x18]
call esi
push dword [ebp + 0x18]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x40bf80
lea eax, [ebp + 0x30c]
push esi
push eax
call fcn.0040c040
add esp, 8
mov esi, eax
push 0x4170dc
push edi
push str.Unable_to_query_name_for_joystick_at_index
mov byte [ebp - 4], 0xe
call fcn.00413040
push eax
call fcn.00401b80
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int_]
push eax
call fcn.00401b80
mov ecx, dword [esi + 0x10]
add esp, 8
cmp dword [esi + 0x14], 0x10
jb 0x40bf3b
mov esi, dword [esi]
push 0x401dd0
push ecx
push esi
push eax
call fcn.00405d40
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
lea ecx, [ebp + 0x30c]
mov byte [ebp - 4], 9
call fcn.00403490
lea eax, [ebp + 0x2f4]
mov ecx, ebx
push eax
call fcn.00412370
lea ecx, [ebp - 0xa4]
call fcn.004062e0
jmp 0x40ba75
xor eax, eax
lea ecx, [ebp + 0x30c]
mov word [ebp + 0x53a], ax
lea eax, [ebp + 0x33c]
push eax
call fcn.00412500
lea eax, [ebp + 0x30c]
mov byte [ebp - 4], 0xf
push eax
lea ecx, [ebp + 0x2f4]
call fcn.004125c0
lea ecx, [ebp + 0x30c]
mov byte [ebp - 4], 9
call fcn.004018c0
lea eax, [ebp + 0x2f4]
mov ecx, ebx
push eax
call fcn.00412370
lea ecx, [ebp - 0xa4]
call fcn.004062e0
jmp 0x40ba75
push edx
push ecx
call fcn.004137f2
add esp, 8
xor eax, eax
mov dword [ebp + 0x338], 7
lea ecx, [ebp + 0x2f4]
mov dword [ebp + 0x334], eax
mov word [ebp + 0x324], ax
call fcn.004018c0
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x53c]
xor ecx, ebp
call fcn.004137b4
lea esp, [ebp + 0x540]
pop ebp
ret