1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

BdUSBadded WAIT_FOR_BUTTON_PRESS functionality (#2544)

Co-authored-by: p4p1 <p4p1@vivaldi.net>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Leo Smith
2023-04-04 05:40:19 +02:00
committed by GitHub
parent f98ac4c48a
commit efc52ab469
6 changed files with 49 additions and 0 deletions

View File

@@ -143,6 +143,14 @@ static int32_t ducky_fnc_release(BadUsbScript* bad_usb, const char* line, int32_
return 0;
}
static int32_t ducky_fnc_waitforbutton(BadUsbScript* bad_usb, const char* line, int32_t param) {
UNUSED(param);
UNUSED(bad_usb);
UNUSED(line);
return SCRIPT_STATE_WAIT_FOR_BTN;
}
static const DuckyCmd ducky_commands[] = {
{"REM ", NULL, -1},
{"ID ", NULL, -1},
@@ -160,8 +168,12 @@ static const DuckyCmd ducky_commands[] = {
{"ALTCODE ", ducky_fnc_altstring, -1},
{"HOLD ", ducky_fnc_hold, -1},
{"RELEASE ", ducky_fnc_release, -1},
{"WAIT_FOR_BUTTON_PRESS", ducky_fnc_waitforbutton, -1},
};
#define TAG "BadUSB"
#define WORKER_TAG TAG "Worker"
int32_t ducky_execute_cmd(BadUsbScript* bad_usb, const char* line) {
for(size_t i = 0; i < COUNT_OF(ducky_commands); i++) {
if(strncmp(line, ducky_commands[i].name, strlen(ducky_commands[i].name)) == 0) {