dbisu / pico-ducky

Create a USB Rubber Ducky like device using a Raspberry PI Pico
GNU General Public License v2.0
2.43k stars 440 forks source link

Files Are Only Loaded When Programming Switch Is Active. #18

Closed GamehunterKaan closed 3 years ago

GamehunterKaan commented 3 years ago

When Pico Is Plugged It Automatically Launches File Explorer And Interrupts The Payload.To Prevent That Files Should Be Only Loaded When The Board Is In Programming Mode.

dbisu commented 3 years ago

Potentially a call to storage.disable_usb_drive() could be added to boot.py. I might make that a second switch, in case someone wants to use the storage during a script for payload distribution or data dumping.

dbisu commented 3 years ago

Just realized that call is only available in the latest CircuitPython, not CircuitPython 6.3. I would need to test this project against CircuitPython 7.x before being able to turn off the host PC storage.

GamehunterKaan commented 3 years ago

I tried running the code with CircuitPython 7.x but for some reason it goes into read only mode and doesn't work.

GamehunterKaan commented 3 years ago

Ok I Nuked It And Installed Hid Libraries For CircuitPython 7.x.Seems To Be Working Fine For Now.

dbisu commented 3 years ago

OK. I'll look at updating the project once 7.x is officially released. In the meantime, if you want to try with a switch, you can create a boot.py like this.

from board import *
import digitalio
import storage

noStorageStatus = False
noStoragePin = digitalio.DigitalInOut(GP15)
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
noStorageStatus = not noStoragePin.value

if(noStorageStatus == True):
    # don't show USB drive to host PC
    storage.disable_usb_drive()
    print("Disabling USB drive")
else:
    # normal boot
    print("USB drive enabled")
GamehunterKaan commented 3 years ago

I Dont Have Any Jumper Wires Right Now.I Will Give Feedback When They Arrive.(In 2-3 Days Hopefully)

prajwal-bm commented 3 years ago

this is not working for me can any one help, i fallowed all the steps but it is not working

GamehunterKaan commented 3 years ago

It Just Tested It Works Perfectly Fine For Me.Nuke Your Pico First To Reset It,Download CircuitPhyton 7.x,Download Adafruit HID Libraries For 7.x And Then Make Sure You Connect The Correct Pins. https://i.imgur.com/f28d2u4.jpg

GamehunterKaan commented 3 years ago

@dbisu CircuitPython 7.0.0 Is Officially Released.

dbisu commented 3 years ago

I'll get a card added to update the project to version to 7.0.0. Sounds like it will be mostly validation testing.

Decapitater commented 3 years ago

Any updates gentelmen ? The project seems to be updated

dbisu commented 3 years ago

I might have some time this weekend to look at this again.