Skip to content

Commit

Permalink
adjusted filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ekknod committed Oct 22, 2024
1 parent 9036be1 commit 77ff519
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Client/scan/mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,24 +324,19 @@ void scan::handle_raw_input(BOOL log_mouse, QWORD timestamp, RAWINPUT *input)
USHORT packetcnt=0;
for (auto &desc : info.interfaces)
{
if (desc.self.bInterfaceClass == 3 &&
desc.self.bInterfaceSubClass == 1 &&
desc.self.bInterfaceProtocol == 2
)
if (desc.self.bInterfaceClass == 3 && desc.self.bInterfaceSubClass == 1 && desc.self.bInterfaceProtocol == 2)
{
protocol_found = 1;

for (auto &end : desc.endpoints)
{
packetcnt = end.wMaxPacketSize;
break;
}

break;
}
}

BOOL heuristic = (info.config.MaxPower << 1) == 500 && packetcnt == 20;
BOOL heuristic = (info.config.MaxPower << 1) == 500 && GET_BIT(info.config.bmAttributes, 6) == 0;

if (!protocol_found || heuristic)
{
Expand All @@ -364,9 +359,11 @@ void scan::handle_raw_input(BOOL log_mouse, QWORD timestamp, RAWINPUT *input)
}
else
{
LOG_YELLOW("potential kmbox device\n");

PrintUsbInformation(info);
if (!protocol_found || packetcnt == 20)
{
LOG_YELLOW("potential kmbox device\n");
PrintUsbInformation(info);
}
}
}

Expand Down

0 comments on commit 77ff519

Please sign in to comment.