|
|
|
|
|
by d33
889 days ago
|
|
This inspired me to do this experiment: dd if=/dev/zero bs=1K count=$(( 256 * 3 )) of=a.ext4 mfks.ext4 a.ext4 mkdir a sudo mount a.ext4 a cd a sudo chown 1000:1000 . python3 -c 'open("a", "wb").write(b"\xff\x00\x00" * 2000)' python3 -c 'open("b", "wb").write(b"\xff\xff\x00" * 2000)' python3 -c 'open("c", "wb").write(b"\xff\x00\xff" * 2000)' cd .. sudo umount a (echo -n 'P6\n512 512\n255\n' ; cat a.ext4 ) > a.ppm convert a.ppm a.png The resulting a.png is reversible - you can convert it back to .ppm file, skip first 15 bytes and you should get a valid .ext4 back. |
|