Advertisement
metalx1000

recovery PDF files with GREP - Notes for tutorial

Jul 18th, 2014
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. #See if you can find the file
  2. sudo grep “Android” /dev/sdc1
  3. sudo grep -a "Xorg on Android" /dev/sdc1
  4.  
  5. #pull the files and other things around it
  6. #if it’s a large file increase -B and -A
  7. sudo grep -a -B 10000 -A 10000 "Xorg on Android" /dev/sdc1 > recovery.img
  8.  
  9. #glance at what you’ve got
  10. strings recovery.img
  11.  
  12. #check and see if you’ve got the PDF header and footer
  13. #if not increase -B and -A and try again
  14. grep -a -e '%PDF' -e '%%EOF' recovery.img
  15.  
  16. #recover file
  17. sed -n '/%PDF/,/%%EOF/p' recovery.img > recovered.pdf
  18.  
  19.  
  20. #notes
  21. #**** Warning: File has some garbage before %PDF- .
  22. head recovered.pdf
  23. sed -i 's/        self.projectfile //' recovered.pdf
  24.  
  25. #”        self.projectfile “ being what you found before ‘%PDF’ with ‘head’
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement