Store name in DuckyKeyboardController to avoid setting it in detector

This commit is contained in:
Adam Honse 2025-08-07 11:17:54 -05:00
parent a8500a2a8a
commit a73a879238
4 changed files with 16 additions and 8 deletions

View file

@ -13,10 +13,11 @@
#include "DuckyKeyboardController.h"
#include "StringUtils.h"
DuckyKeyboardController::DuckyKeyboardController(hid_device* dev_handle, const char* path, const unsigned short pid)
DuckyKeyboardController::DuckyKeyboardController(hid_device* dev_handle, const char* path, const unsigned short pid, std::string dev_name)
{
dev = dev_handle;
location = path;
name = dev_name;
usb_pid = pid;
SendInitialize();
@ -27,11 +28,16 @@ DuckyKeyboardController::~DuckyKeyboardController()
hid_close(dev);
}
std::string DuckyKeyboardController::GetDeviceLocation()
std::string DuckyKeyboardController::GetLocationString()
{
return("HID: " + location);
}
std::string DuckyKeyboardController::GetNameString()
{
return(name);
}
std::string DuckyKeyboardController::GetSerialString()
{
wchar_t serial_string[128];