3.1 KiB
Rigol setup.stp Crypter
A utility for encrypting, decrypting, and parsing Rigol DG[89]00 Pro Arbitrary Waveform Generator setup.stp.
Command-Line Options
usage: rigol_setup_crypter.py [-h] (-e | -d | -p) (-t INPUT_TEXT | -f INPUT_FILE) [-k CPU_SERIAL] [-o FILEPATH]
Encrypt or Decrypt Rigol DG[89]00 Pro setup.stp using the CPU SN.
options:
-h, --help show this help message and exit
-e, --encrypt Encrypt plain text data
-d, --decrypt Decrypt hex string data
-p, --parse Parse Rigol CSV data string
-t, --text INPUT_TEXT
Input data as text (Plain for Encrypt/Parse, Hex for Decrypt)
-f, --file INPUT_FILE
Path to read input data from file
-k, --key CPU_SERIAL CPU Serial Number (Required for -e/-d modes)
-o, --output FILEPATH
Optional path to save output. Console if omitted
Setup and Workflow
Prerequisites
-
Install ADB (Android Debug Bridge) on your system:
- Linux:
sudo apt install adb(or equivalent for your distribution) - Windows: Download and install Android Platform Tools
- Linux:
-
Connect your Rigol AFG to your local network and note its IP address
Extracting the Setup File
-
Connect to your device via ADB:
adb connect IP:55555Replace
IPwith your device's IP address -
Pull the setup file from the device:
adb pull /rigol/data/setup.stp -
Read your CPU serial:
adb shell -- /rigol/shell/get_cpu_serial_num.sh -
IMPORTANT: Create a backup of the original file:
cp setup.stp setup.stp.backup
Modifying the Setup File
-
Decrypt the setup file:
python rigol_setup_crypter.py -d -f setup.stp -k YOUR_CPU_SERIAL -o setup.csvReplace
YOUR_CPU_SERIALwith your device's CPU serial number -
Parse the file to better understand its structure:
python rigol_setup_crypter.py -p -f setup.csv -
Edit the CSV file using a text editor of your choice
-
Verify your changes by parsing again:
python rigol_setup_crypter.py -p -f setup.csv -
Encrypt the modified file:
python rigol_setup_crypter.py -e -f setup.csv -k YOUR_CPU_SERIAL -o setup.stp.new
Uploading the Modified File
-
Push the modified file back to the device:
adb push setup.stp.new /rigol/data/setup.stp -
Restart your device to apply the changes
adb shell -- reboot
Examples
Decrypt a setup file
python rigol_setup_crypter.py -d -f setup.stp -k d95ebe35672e20c2fc08 -o decrypted.csv
Decrypt a text string and output to console
python rigol_setup_crypter.py -d -t "FBC6BDDB0E..." -k d95ebe35672e20c2fc08
Parse a decrypted CSV
python rigol_setup_crypter.py -p -f decrypted.csv
Encrypt a modified CSV
python rigol_setup_crypter.py -e -f modified.csv -k d95ebe35672e20c2fc08 -o new_setup.stp
Warning
Keep a backup of the original setup.csv.