mirror of https://github.com/berdav/snappy-fox
Example image and altered version
This commit is contained in:
parent
1ab89978ea
commit
9d56e5c281
24
README.md
24
README.md
|
@ -4,8 +4,9 @@
|
|||
<img alt="GitHub" src="https://img.shields.io/github/license/berdav/snappy-fox.svg?color=blue">
|
||||
</a>
|
||||
|
||||
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)
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 164 KiB |
Binary file not shown.
|
@ -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)
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 164 KiB |
Binary file not shown.
Loading…
Reference in New Issue