Example image and altered version

This commit is contained in:
Davide Berardi 2024-02-19 11:58:58 +01:00
parent 1ab89978ea
commit 9d56e5c281
6 changed files with 40 additions and 2 deletions

View File

@ -4,8 +4,9 @@
<img alt="GitHub" src="https://img.shields.io/github/license/berdav/snappy-fox.svg?color=blue"> <img alt="GitHub" src="https://img.shields.io/github/license/berdav/snappy-fox.svg?color=blue">
</a> </a>
Snappy-fox is a morgue cache decompressor for Firefox which does not have Snappy-fox is a Snappy file decompressor (i.e. morgue cache of Firefox)
dependencies. which does not have dependencies. It can also reconstruct corrupted
files.
## Why? ## Why?
Online applications such as whatsapp web (web.whatsapp.com) save cache Online applications such as whatsapp web (web.whatsapp.com) save cache
@ -56,3 +57,22 @@ done
it will extract all your cache files in the it will extract all your cache files in the
`/tmp/extracted-cache-whatsapp` directory. `/tmp/extracted-cache-whatsapp` directory.
## Example
You can try the application with the example image present in the
example directory:
```bash
./snappy-fox example/exampleimage.snappy example/exampleimage.jpg
```
![example image](https://github.com/berdav/snappy-fox/blob/staging/example/exampleimage.jpg?raw=true)
`alteredimage.snappy` is a corrupted version of the image, you can see
the retrival performance of the tool using:
```bash
./snappy-fox --ignore_offset_errors example/alteredimage.snappy example/alteredimage.jpg
```
![altered image](https://github.com/berdav/snappy-fox/blob/staging/example/alteredimage.jpg?raw=true)

BIN
example/alteredimage.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
example/alteredimage.snappy Normal file

Binary file not shown.

18
example/alterrandom.py Normal file
View File

@ -0,0 +1,18 @@
import sys
import random
prob = int(sys.argv[3])
substbyte = int(sys.argv[4])
with open(sys.argv[1], "rb") as f:
indata = bytearray(f.read())
for b in range(len(indata)):
x = random.randint(0, 10000)
if x < prob:
# Alter the data
indata[b] = substbyte
with open(sys.argv[2], "wb") as f:
f.write(indata)

BIN
example/exampleimage.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
example/exampleimage.snappy Normal file

Binary file not shown.