FREE Reverse Engineering Self-Study Course HERE
Join DC540 Discord HERE
Raspberry Pi 4
Raspberry Pi Pico
Breadboard
Breadboard Jumper Wires
wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh
chmod +x pico_setup.sh
./pico_setup.sh
cd ~/
wget https://raw.githubusercontent.com/cyrus-and/gdb-dashboard/master/.gdbinit
sudo reboot
git clone https://github.com/mytechnotalent/pico-micropython-debug-template.git
from utime import sleep
from machine import Pin
led = Pin(25, Pin.OUT)
while True:
led.toggle()
sleep(5)
./build.sh
./flash.sh
openocd -f interface/raspberrypi-swd.cfg -f target/rp2040.cfg
gdb-multiarch firmware.elf
>>> target remote localhost:3333
>>> load
>>> monitor reset init
>>> b main
>>> b *(mp_execute_bytecode)
>>> c
>>> n # until r4 holds a value of 100XXXXX
>>> x/x $r4 # check if this value is fun_
gdb-multiarch
>>> target remote localhost:3333
>>> monitor reset init
>>> b *0xXXXXXXXX # replace X's with actual address of main (1st push to r0, r1, r2, r4, r5, lr followed by 2 bl's to functions)
>>> b *0xXXXXXXXX # replace X's with actual address of where mp_execute_bytecode is called (manual no shortcut here)
>>> c
sudo picotool save -a firmware.bin