diff --git a/README.md b/README.md index bdb67d1..334c017 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ GitHub -Snappy-fox is a morgue cache decompressor for Firefox which does not have -dependencies. +Snappy-fox is a Snappy file decompressor (i.e. morgue cache of Firefox) +which does not have dependencies. It can also reconstruct corrupted +files. ## Why? 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 `/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) + diff --git a/example/alteredimage.jpg b/example/alteredimage.jpg new file mode 100644 index 0000000..56dc0ea Binary files /dev/null and b/example/alteredimage.jpg differ diff --git a/example/alteredimage.snappy b/example/alteredimage.snappy new file mode 100644 index 0000000..7ddf0e5 Binary files /dev/null and b/example/alteredimage.snappy differ diff --git a/example/alterrandom.py b/example/alterrandom.py new file mode 100644 index 0000000..c70979b --- /dev/null +++ b/example/alterrandom.py @@ -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) + diff --git a/example/exampleimage.jpg b/example/exampleimage.jpg new file mode 100644 index 0000000..f83e402 Binary files /dev/null and b/example/exampleimage.jpg differ diff --git a/example/exampleimage.snappy b/example/exampleimage.snappy new file mode 100644 index 0000000..0d95620 Binary files /dev/null and b/example/exampleimage.snappy differ