A GUI tool that generates CircuitPython HID scripts from mnemonics for Raspberry Pi Pico Series.
- Simple and clean GUI
- Two large windows one for mnemonics and other for circuit python code
- Convert Button - Convert mnemonics to circuit python
- Copy Button - Copy circuit python code to the clipboard so that it can paste anywhere
- Reset Button - Clear all data from both windows
- Save Button - Save circuit python codes on the system for future use
- Upload Button - Upload circuit python code to the Raspberry Pi Pico or Pico W using file manager.
- Refresh Button - It checks the connection of the Raspberry Pi Pico or Pico W and show its COM Port.
- Exit Button - Close the application
- Windows 10
- Windows 11
- Kali Linux
In Kali Linux, the upload feature is not working.
The mnemoics used in this tool is heavily inspired by Hak5 Ducky Script.
Demo.mp4
- Make sure that latest python and pip3 is installed on your system (Windows/Linux/MacOS).
- Install the pyserial module on your system (Windows/Linux/MacOS) by copy and run the following command :
pip3 install -r requirements.txt
- Download Circuit Python
.uf2
file : - Connect Raspberry Pi Pico or Pico W with a USB cable.
- Press and hold the
BOOTSEL
button and connect to the PC/Laptop.- When it connects, then Raspberry Pi Pico or Pico W show as a removable storage device named
RPI-RP2
. - When
RPI-RP2
is showing, then release the bootsel button.
- When it connects, then Raspberry Pi Pico or Pico W show as a removable storage device named
- Copy the
uf2
file in theRPI-RP2
.- When it is copied, then it disconnects automatically and reconnect as
CIRCUITPY
. - Means circuit python is successfully flashed in the Raspberry Pi Pico or Pico W.
- When it is copied, then it disconnects automatically and reconnect as
- Open
CIRCUITPY
.- There are two important things in it :
lib
folder andcode.py
file.
- There are two important things in it :
- Download Adafruit CircuitPython Bundle from here
- Latest is
adafruit-circuitpython-bundle-9.x-mpy-20240709.zip
.
- Latest is
- Extarct the ZIP file.
- Go to the
lib
folder in the extracted ZIP file. - Copy
adafruit_hid
folder in thelib
folder ofCIRCUITPY
. - Done! Now, Raspberry Pi Pico or Pico W is ready to use as a USB Rubber Ducky.
- Raspberry Pi Pico
- Raspberry Pi Pico W
- Waveshare RP2040 Zero
Mnemonics | Description | Example |
---|---|---|
HID | It adds the time and usb_hid libraries in the code. | Just type HID |
HWD | It adds the board and digitalio libraries in the code. | Just type HWD |
HLIB | It adds the Keycode, Keyboard and KeyboardLayoutUS libraries in the code. | Just type HLIB |
MOUSE | It adds the Mouse library in the code. | Just type MOUSE |
KYBD | It create objects for keycode and keyboard layout in the code. | Just type KYBD |
MSE | It create objects for mouse in the code. | Just type MSE |
PIN | It add pin declaration in the code. | Just type PIN |
LED | It turns on/off the led in the code. Values are ON and OFF. |
LED ON |
WAIT | It add time in the code. Time is in milliseconds. 1000 ms = 1 second. |
WAIT 1000 |
TYPE | It add text want to type in the code. | TYPE Hello World! |
SCODE | It press and release the key(s) immediately. | SCODE A |
PCODE | It press and hold the key(s) and release all key(s). | PCODE S |
MOVE | It moves the mouse pointer according to the values. Values are x-axis, y-axis and scroll. Values may be positive, negative or ZERO. Values in sequence - x-axis, y-axis, scroll. |
MOVE 36 -78 0 |
CLICK | It clicks the mouse buttons. Values are LEFT, MIDDLE and RIGHT. |
CLICK LEFT |
PRESS | It press the mouse buttons and relaese immediately. Values are LEFT, MIDDLE and RIGHT. |
PRESS RIGHT |
The above mnemonic table is in pdf now.
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
LEFT
UP
RIGHT
DOWN
TAB
HOME
END
PGUP
PGDN
CAPS
NUM
SCROLL
GUI
ESC
PRTSCR
PAUSE
INSERT
DEL
BKSP
ENTER
CTRL
SHIFT
ALT
- Download or Clone the Repository.
- Open the folder and just double click on
PicoHIDScripter.py
file. - Type the mnemonics in the left window.
- Click on
Convert
button to get corresponding circuit python script. - Click on
Copy
button to copy the circuit python script to the clipboard. - Paste the code in the
code.py
file in theCIRCUITPY
.- Be Careful! As it is saved the script start executing.
- If want to stop Raspberry Pi Pico or Pico W from execution, then connect the Male-To-Male jumper wires as shown in image below :
- If want to start again the execution, simply remove the jumper wires.
Mnemonic for Open Notepad and Type
HID
HLIB
KYBD
PCODE GUI R
WAIT 1000
TYPE notepad
WAIT 1000
SCODE ENTER
WAIT 1000
TYPE This is a test for Raspberry Pi Pico script developed by PicoHID Scripter!
after click on Convert
button, the circuit python script of the following mnemonic is :
import time
import usb_hid
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)
kbd.press(Keycode.GUI, Keycode.R)
kbd.release_all()
time.sleep(1.0)
layout.write("notepad")
time.sleep(1.0)
kbd.send(Keycode.ENTER)
time.sleep(1.0)
layout.write("This is a test for Raspberry Pi Pico script developed by PicoHID Scripter!")
Just copy this code and paste it in the code.py
file in the CIRCUITPY
.
Mnemonic for Open CMD as Administartor Mode
HID
HLIB
KYBD
SCODE GUI
WAIT 1000
TYPE cmd
WAIT 1000
PCODE CTRL SHIFT ENTER
WAIT 1200
PCODE ALT Y
after click on Convert
button, the circuit python script of the following mnemonic is :
import time
import usb_hid
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)
kbd.send(Keycode.GUI)
time.sleep(1.0)
layout.write("cmd")
time.sleep(1.0)
kbd.press(Keycode.CONTROL, Keycode.SHIFT, Keycode.ENTER)
kbd.release_all()
time.sleep(1.2)
kbd.press(Keycode.ALT, Keycode.Y)
kbd.release_all()
Just copy this code and paste it in the code.py
file in the CIRCUITPY
.
Mnemonic for Create a folder
HID
HLIB
KYBD
PCODE CTRL SHIFT N
WAIT 1200
SCODE ENTER
after click on Convert
button, the circuit python script of the following mnemonic is :
import time
import usb_hid
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)
kbd.press(Keycode.CONTROL, Keycode.SHIFT, Keycode.N)
kbd.release_all()
time.sleep(1.2)
kbd.send(Keycode.ENTER)
Just copy this code and paste it in the code.py
file in the CIRCUITPY
.