Skip to content

Instantly share code, notes, and snippets.

@doegox
Created October 20, 2016 21:07
Show Gist options
  • Save doegox/af5f2713c96c8d3191d4978747d685d6 to your computer and use it in GitHub Desktop.
Save doegox/af5f2713c96c8d3191d4978747d685d6 to your computer and use it in GitHub Desktop.
Hack.lu 2016 simplepdf write-up
#!/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