HaydenMeloche / USB-Rubber-Ducky-Toolkit

A toolkit for the USB Rubber ducky. Featuring an emulator, code validator & encoder.
MIT License
43 stars 16 forks source link

Check script is still there before encoding #13

Closed HaydenMeloche closed 7 years ago

HaydenMeloche commented 7 years ago

When formEncoding loads, it copies over the current script to Duckys location. There is no check that the file is there before it goes and loads CMD with this file. This will most likely not be a problem but if the user deletes the script after loading formEncode it will break the encode button. Idea for fix:

  1. Create function in main class that copies the file.
  2. Call that function before the formEncode opens
  3. When user clicks encode, check the file is still there and if it isn't then fun the function from 1.
nicklit commented 7 years ago

@HaydenMeloche Your version looked like it was creating a "script.txt" and then immediately deleting it if it existed. My thought was to delete anything that is there beforehand, then create a "script.txt" in its place. I still don't think it's perfect as I still get an error in the debug console when encoding the file, although it may work. I do not have my ducky on me currently to check if the .bin file is legitimate

nicklit commented 7 years ago

Currently, the debug console spits "Error: " with no error attached. Maybe that's just bad syntax, looking into it

nicklit commented 7 years ago

I realized the Error: I was reading in Console was just messy debug statements. Cleaning that up now. Please also verify my commit here is logical @HaydenMeloche

HaydenMeloche commented 7 years ago

Reverted to original