A read-only recovery and forensic-analysis utility for SageThumbs.db3 caches created by SageThumbs on Windows.
The tool analyzes the SQLite cache, recovers surviving image BLOBs, preserves original path information, calculates cryptographic hashes, validates recovered image data, identifies duplicate cached images, and produces forensic reports.
- Read-only SQLite database access
- SQLite
integrity_checkandquick_check - Enumeration of
PathesandEntities - Recovery of surviving image BLOBs
- JPEG, PNG, GIF, WebP, BMP and ICO signature detection
- Optional Pillow-based image validation
- SHA-256 and MD5 hashes
- Duplicate-thumbnail analysis
- Recovery manifest in CSV format
- Empty-BLOB report
- Creation/last-write timeline
- Conservative decoding of known
ImageInfofields - Collision-safe output filenames
- Preservation of original Windows path information
- Optional searchable HTML galleries
- Human-readable forensic recovery report
The source database is opened using SQLite's read-only mode.
The source SageThumbs.db3 is never modified by the tool.
For forensic work:
- Preserve the original evidence separately.
- Work from a forensic acquisition or verified working copy.
- Record the source database hash before analysis.
- Run the tool against the working copy.
- Preserve the generated reports and recovered files.
- Correlate the results with other forensic artifacts.
An Empty BLOB finding means that an Entities record exists but its Image BLOB is NULL or zero-length. It does not, by itself, prove that the corresponding original source file was deleted.
- Python 3.9 or newer
- Pillow
Install the dependency:
python -m pip install -r requirements.txtRecommended virtual-environment setup:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txtpython .\sagethumbs_recover.pyThe default input is:
SageThumbs.db3
and the default output directory is:
SageThumbs_Recovered
python .\sagethumbs_recover.py --database "C:\Evidence\SageThumbs.db3"python .\sagethumbs_recover.py `
--database "C:\Evidence\SageThumbs.db3" `
--output "C:\Case\Recovered\SageThumbs"Gallery generation is disabled by default.
Enable it with:
python .\sagethumbs_recover.py `
--database "C:\Evidence\SageThumbs.db3" `
--output "C:\Case\Recovered\SageThumbs" `
--galleryThe gallery is a convenience view and should not replace the CSV manifest or other forensic records.
A typical run looks like:
==============================================================================
SageThumbs.db3 Recovery Tool v1.0
Read-only recovery and forensic analysis
==============================================================================
[+] Evidence
Database : C:\Evidence\SageThumbs.db3
Output : C:\Case\Recovered\SageThumbs
Pillow : AVAILABLE
Access : READ-ONLY
[+] SQLite integrity
integrity_check : OK
quick_check : OK
[+] Recovery
Pathes : 639
Entities : 8,292
Processed 8,250/8,292 | Recovered 8,052 | Empty BLOBs 198
Processed 8,292/8,292 | Recovered 8,092 | Empty BLOBs 200
[+] Complete
Entities processed : 8,292
Cached images : 8,092
Cached but invalid : 0
Empty BLOBs : 200
Extraction errors : 0
Recovered data : ...
Duplicate groups : ...
Gallery : DISABLED (default)
The source database was not modified.
Recovered and Empty BLOBs are cumulative counters. The final progress line is always printed, even when the total entity count is not an exact multiple of 250.
A normal run produces:
SageThumbs_Recovered/
├── manifest.csv
├── missing_thumbnails.csv
├── duplicates.csv
├── timeline.csv
├── recovery_report.txt
└── recovered files...
When --gallery is enabled:
├── gallery.html
└── missing_gallery.html
The primary machine-readable recovery manifest.
It contains:
- database record IDs
- original paths
- original filenames
- original file size
- original dimensions when available
- thumbnail dimensions
- raw and interpreted timestamps
ImageInfometadata- cached image size
- detected format
- validation status
- SHA-256
- MD5
- extracted filename
- extraction errors
Despite the historical filename, this report specifically records empty or NULL Image BLOBs.
An entry means the database record exists but no cached image bytes are currently present in that record.
Lists recovered records that share the same SHA-256 digest.
Contains CreationTime and LastWriteTime events with both raw database values and interpreted timestamps.
Human-readable summary covering:
- SQLite integrity
- database counts
- recovery classifications
- image formats
- validation results
- hash and duplicate statistics
- recovered byte count
- decoded
ImageInfofields - forensic interpretation notes
Image data existed, was extracted successfully, and Pillow validation succeeded.
Image data existed and was extracted, but validation did not establish it as a valid image.
The Entities record exists, but the Image BLOB is NULL or zero-length.
This is reported in the interface as Empty BLOBs.
This finding does not prove deletion of the original source file.
Image data existed, but the recovered bytes could not be written to the output location.
The tool first examines the binary image signature.
When Pillow is installed, the recovered data is also opened and passed through Image.verify().
Validation describes the recovered cached bytes. It does not establish the condition of the original source image.
Each recovered image BLOB is hashed with:
- SHA-256
- MD5
SHA-256 is the preferred evidentiary identifier. MD5 is retained for compatibility and comparison.
Hashes are calculated over the cached BLOB exactly as stored in the database.
The current decoder conservatively handles the known 192-byte structure and extracts:
0x04 Original width
0x08 Original height
0x10 Codec identifier
0x18 Codec description
0x64 Original FileSize for JPEG ImageInfo
Unknown or malformed structures are reported rather than guessed.
Do not:
- modify the original evidence database;
- treat an Empty-BLOB finding as proof of source-file deletion;
- treat the HTML gallery as the primary evidence record;
- discard raw timestamp values;
- silently overwrite recovered files.
Keep recovered files associated with their manifest records and preserve the generated reports.
This is a SageThumbs database recovery utility, not a general filesystem undelete or file-carving program.
It cannot:
- recover thumbnail bytes that no longer exist in the database;
- reconstruct an original full-quality image from a thumbnail;
- prove source-file deletion solely from an Empty-BLOB finding;
- guarantee identical internal structures across every SageThumbs release;
- replace a complete forensic examination.
SageThumbs-Recovery/
├── sagethumbs_recover.py
├── README.md
├── requirements.txt
├── LICENSE
├── .gitignore
└── .github/
└── workflows/
└── python.yml
Run a basic syntax check:
python -m py_compile .\sagethumbs_recover.pyInstall dependencies:
python -m pip install -r requirements.txtThis project is released under the MIT License. See LICENSE.
This software is intended for legitimate forensic examination, incident response, research and data-recovery purposes. The user is responsible for ensuring that its use complies with applicable law, organizational policy and evidence-handling requirements.