Use HID path for Location on Ducky Keyboard controller
This commit is contained in:
parent
1618de46b9
commit
96da5d5181
4 changed files with 16 additions and 6 deletions
|
|
@ -10,9 +10,10 @@
|
|||
#include <cstring>
|
||||
#include "DuckyKeyboardController.h"
|
||||
|
||||
DuckyKeyboardController::DuckyKeyboardController(hid_device* dev_handle)
|
||||
DuckyKeyboardController::DuckyKeyboardController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
|
||||
SendInitialize();
|
||||
}
|
||||
|
|
@ -22,6 +23,11 @@ DuckyKeyboardController::~DuckyKeyboardController()
|
|||
|
||||
}
|
||||
|
||||
std::string DuckyKeyboardController::GetDeviceLocation()
|
||||
{
|
||||
return(location);
|
||||
}
|
||||
|
||||
void DuckyKeyboardController::SendColors
|
||||
(
|
||||
unsigned char* color_data,
|
||||
|
|
@ -184,4 +190,4 @@ void DuckyKeyboardController::SendTerminateColorPacket()
|
|||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, (unsigned char *)usb_buf, 65);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@
|
|||
class DuckyKeyboardController
|
||||
{
|
||||
public:
|
||||
DuckyKeyboardController(hid_device* dev_handle);
|
||||
DuckyKeyboardController(hid_device* dev_handle, const char* path);
|
||||
~DuckyKeyboardController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
|
||||
void SendColors
|
||||
(
|
||||
unsigned char* color_data,
|
||||
|
|
@ -28,6 +30,7 @@ public:
|
|||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
|
||||
void SendInitialize();
|
||||
void SendInitializeColorPacket();
|
||||
|
|
@ -38,4 +41,4 @@ private:
|
|||
unsigned int color_size
|
||||
);
|
||||
void SendTerminateColorPacket();
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void DetectDuckyKeyboardControllers(std::vector<RGBController*>& rgb_controllers
|
|||
|
||||
if( dev )
|
||||
{
|
||||
DuckyKeyboardController* controller = new DuckyKeyboardController(dev);
|
||||
DuckyKeyboardController* controller = new DuckyKeyboardController(dev, info->path);
|
||||
|
||||
RGBController_DuckyKeyboard* rgb_controller = new RGBController_DuckyKeyboard(controller);
|
||||
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ RGBController_DuckyKeyboard::RGBController_DuckyKeyboard(DuckyKeyboardController
|
|||
name = "Ducky Keyboard Device";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "Ducky Keyboard Device";
|
||||
location = ducky->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue