Skip to content

Commit

Permalink
styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo committed Jan 6, 2022
1 parent 629de1e commit 735fba4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
43 changes: 42 additions & 1 deletion WUD-Ducky.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,43 @@ SDCard2USB PenDrive;

fs::FS* duckyFS = nullptr;

void MouseDrawLine( String line )
{
String strline = line;
int str_len = strline.length()+1;
char keyarray[str_len];
strline.toCharArray(keyarray, str_len);
char delimiter[] = "+";
char *strblock;
strblock = strtok(keyarray, delimiter);
int8_t move;
while(strblock != NULL) {
switch( strblock[0] ) {
case 'X': // move X axis
move = atoi( &strblock[1] );
for( int i=0; i<abs(move);i++) {
vTaskDelay(25);
KeyboardMouse.move( move>0?1:-1, 0 );
}
break;
case 'Y': // move Y axis
move = atoi( &strblock[1] );
for( int i=0; i<abs(move);i++) {
vTaskDelay(25);
KeyboardMouse.move( 0, move>0?1:-1 );
}
break;
case 'C': // click
vTaskDelay(15);
KeyboardMouse.pressLeft();
break;
default: // ignore
break;
}
strblock = strtok(NULL, delimiter);
}
}

void HIDKeySend( String str )
{
KeyboardMouse.sendString(str+"\n");
Expand Down Expand Up @@ -148,7 +185,7 @@ void runpayload( fs::FS *fs, const char* payload)
int mousemoveamt = cmdinput.toInt();
vTaskDelay(25);
KeyboardMouse.move(0, 0);
KeyboardMouse.move(0, mousemoveamt*-1);
KeyboardMouse.move(0, mousemoveamt-1);
} else if(cmd == "MouseMoveDown") { //If command equals "MouseMoveDown:X"
int mousemoveamt = cmdinput.toInt();
vTaskDelay(25);
Expand Down Expand Up @@ -176,6 +213,10 @@ void runpayload( fs::FS *fs, const char* payload)
} else if(cmd == "MouseDoubleClickLEFT") {
vTaskDelay(25);
KeyboardMouse.doublePressLeft();
} else if(cmd == "MouseDrawLine") {
vTaskDelay(25);
MouseDrawLine( cmdinput );
//KeyboardMouse.doublePressLeft();
} else {
// wut ?
}
Expand Down
2 changes: 1 addition & 1 deletion data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h2>WUD File Server</h2>
var if_payload = '';

if( (i.name).match(/quack/) ) {
if_payload = ` [<a href="/runpayload?file=${i.name}">Run Payload</a>]`;
if_payload = ` [<a class="payload-runner" href="/runpayload?file=${i.name}">Run Payload</a>]`;
}

cont.innerHTML +=
Expand Down

0 comments on commit 735fba4

Please sign in to comment.