- Save the two files below. I put them in '~/.scripts'
- Modify the configuration in konsole-watcher.sh to your liking
- Modify the location of konsole-watcher.sh in konsole-watcher-autostart.sh if you chose to put it somewhere besides ~/.scripts
- Create the directory ~/.konsole (or other location you chose for the save file)
- Create a symlink to konsole-watcher-autostart.sh in '~/.config/autostart-scripts
- or open System Settings > Startup and Shutdown and add a script to the Script Files (it does the same thing as creating the symlink)
- You might want to add a menu entry as well in case KDE autostart doesn't work for some reason
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac, hashlib | |
# Data from I²C trace at https://hackaday.io/project/19480-raspberry-pi-camera-v21-reversed/log/52547-i2c-logic-analyzer-trace | |
# Secret key from VideoCore blob | |
# serial[8], serial[7:4], serial[3:0] | |
serial = bytes.fromhex("EE8C196D8301230B59") | |
# rPi -> camera random number | |
numIn = bytes.fromhex("5805F3C898C3133154498E082F2E703516F2DBD1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline U32 ppcmask(U32 mb, U32 me) | |
{ | |
U32 maskmb = ~0u >> mb; | |
U32 maskme = ~0u << (31 - me); | |
return (mb <= me) ? maskmb & maskme : maskmb | maskme; | |
} | |
static inline U32 rotl32(U32 x, U32 amount) | |
{ | |
return (x << amount) | (x >> ((32 - amount) & 31)); |