anybrain/utils.c aktualisiert

This commit is contained in:
2026-10-20 11:34:56 +00:00
parent a3e7385d6d
commit d402b8cdca
+120
View File
@@ -1,3 +1,123 @@
int __fastcall R5::EnumerateHidDevicesAndExtractVidAndPid(GUID *InterfaceClassGuid)
{
HDEVINFO ClassDevsA; // rax
void *v3; // rsi
int v4; // r14d
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r8
void *v8; // rax
__int64 v9; // rbx
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A *v10; // rax
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A *v11; // rdi
void *v12; // rcx
__int64 v13; // rdx
__int64 v14; // rcx
__int64 v15; // r8
HANDLE FileA; // rax
void *v17; // rbx
__int64 v18; // rcx
void *v19; // rax
struct _HIDD_ATTRIBUTES Attributes; // [rsp+40h] [rbp-48h] BYREF
struct _SP_DEVICE_INTERFACE_DATA DeviceInterfaceData; // [rsp+50h] [rbp-38h] BYREF
DWORD RequiredSize; // [rsp+98h] [rbp+10h] BYREF
HidD_GetHidGuid(HidGuid: InterfaceClassGuid);
ClassDevsA = SetupDiGetClassDevsA(
ClassGuid: InterfaceClassGuid,
Enumerator: nullptr,
hwndParent: nullptr,
Flags: 0x12u);
v3 = ClassDevsA;
if ( ClassDevsA != (HDEVINFO)-1LL )
{
DeviceInterfaceData.cbSize = 32;
v4 = 0;
if ( SetupDiEnumDeviceInterfaces(
DeviceInfoSet: ClassDevsA,
DeviceInfoData: nullptr,
InterfaceClassGuid,
MemberIndex: 0,
&DeviceInterfaceData) )
{
while ( 1 )
{
RequiredSize = 0;
SetupDiGetDeviceInterfaceDetailA(
DeviceInfoSet: v3,
&DeviceInterfaceData,
DeviceInterfaceDetailData: nullptr,
DeviceInterfaceDetailDataSize: 0,
&RequiredSize,
DeviceInfoData: nullptr);
v8 = off_5A64E50;
v9 = RequiredSize;
if ( off_5A64E50 == nullptr )
{
v8 = (void *)sub_1DC6600(a1: v6, a2: v5, a3: v7);
off_5A64E50 = v8;
}
v10 = (struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A *)(*(__int64 (__fastcall **)(void *, __int64))(*(_QWORD *)v8 + 8LL))(
a1: v8,
a2: v9);
v11 = v10;
v12 = v3;
if ( v10 == nullptr )
break;
v10->cbSize = 8;
if ( SetupDiGetDeviceInterfaceDetailA(
DeviceInfoSet: v3,
&DeviceInterfaceData,
DeviceInterfaceDetailData: v10,
DeviceInterfaceDetailDataSize: RequiredSize,
RequiredSize: nullptr,
DeviceInfoData: nullptr) )
{
FileA = CreateFileA(
lpFileName: v11->DevicePath,
dwDesiredAccess: 0,
dwShareMode: 3u,
lpSecurityAttributes: nullptr,
dwCreationDisposition: 3u,
dwFlagsAndAttributes: 0,
hTemplateFile: nullptr);
v17 = FileA;
if ( FileA != (HANDLE)-1LL )
{
Attributes.Size = 12;
if ( HidD_GetAttributes(HidDeviceObject: FileA, &Attributes) != 0 )
R5::SomeHelperHidDevices(a1: v18, a2: Attributes.VendorID, a3: Attributes.ProductID);
CloseHandle(hObject: v17);
}
}
v19 = off_5A64E50;
if ( off_5A64E50 == nullptr )
{
v19 = (void *)sub_1DC6600(a1: v14, a2: v13, a3: v15);
off_5A64E50 = v19;
}
(*(void (__fastcall **)(void *, struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A *))(*(_QWORD *)v19 + 40LL))(
a1: v19,
a2: v11);
if ( !SetupDiEnumDeviceInterfaces(
DeviceInfoSet: v3,
DeviceInfoData: nullptr,
InterfaceClassGuid,
MemberIndex: ++v4,
&DeviceInterfaceData) )
goto LABEL_14;
}
}
else
{
LABEL_14:
v12 = v3;
}
LODWORD(ClassDevsA) = SetupDiDestroyDeviceInfoList(DeviceInfoSet: v12);
}
return (int)ClassDevsA;
}
unsigned __int8 *__fastcall Anybrain::RawInputBuffer2InputDeviceRecord(__int64 a1, unsigned __int8 *a2, __int64 a3) unsigned __int8 *__fastcall Anybrain::RawInputBuffer2InputDeviceRecord(__int64 a1, unsigned __int8 *a2, __int64 a3)
{ {
unsigned int v6; // r10d unsigned int v6; // r10d