Created
October 20, 2016 21:07
-
-
Save doegox/af5f2713c96c8d3191d4978747d685d6 to your computer and use it in GitHub Desktop.
Hack.lu 2016 simplepdf write-up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p tmp | |
mount|grep -q $(pwd)/tmp || sudo mount -t tmpfs -o mode=01777,size=200m tmpfs tmp | |
cp simplepdf*.pdf tmp/0.pdf | |
cd tmp | |
for ((i=0;i<11000;i++)); do | |
qpdf --show-object=6 --filtered-stream-data $i.pdf > $(($i+1)).pdf | |
file $(($i+1)).pdf|grep PDF||break | |
rm $i.pdf | |
done | |
mv $i.pdf .. | |
cd .. | |
sudo umount tmp | |
rm -rf tmp | |
evince $i.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment