Created
August 27, 2024 09:42
-
-
Save theevilbit/985d4f1f21737c68e4c123817c3aabe8 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Check if the database path is provided as an argument | |
if [ -z "$1" ]; then | |
echo "Usage: $0 /path/to/your/database.sqlite" | |
exit 1 | |
fi | |
# Use the first argument as the database file path | |
DB_PATH="$1" | |
# Query to select the data column as hex from the record table | |
SQL_QUERY="SELECT hex(data) FROM record;" | |
# Execute the query and process each row | |
sqlite3 "$DB_PATH" "$SQL_QUERY" | while read -r HEXDATA; do | |
# Convert hex to binary and then to plist format | |
echo "$HEXDATA" | xxd -r -p - | plutil -p - | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment