DevKitty-io / USB-Nugget

Run DuckyScript payloads on a USB Nugget!
https://usbnugget.com
MIT License
149 stars 16 forks source link

Make it so we don't have to dump flash to produce a build #62

Closed brandonpaiz closed 1 year ago

brandonpaiz commented 1 year ago

For some reason, creating a FAT filesystem locally, via mkfs or otherwise, then flashing it to memory doesn't work. The nug really doesn't like it. However, if you allow the nug to format the filesystem itself, then dump the flash memory it works just fine -- you can mount, add files to and then reflash and everything will be fine.

The problem is that generating a release binary requires us to flash the code and overwrite the flash memory, then dump the entirety of the contents. Gross. This also means that we need a physical device to generate the release binary and it can only be partially automated.

The work:

  1. Find out why our generated FAT fs aren't well received by the nug
  2. Store the default scripts as normal files
  3. During build / script flashing, create the FAT fs from these scripts, then generate the final binary in the docker container instead of dumping flash