Guest User

Untitled

a guest
Sep 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. ipsw=$(find . -name "*.ipsw")
  2. for f in $ipsw;do
  3. unzip -o $f "kernelcache.*" -d $f.d
  4. done
  5.  
  6. kernels=$(find . -name "kernelcache.*" -not -name "*.dec")
  7. for k in $kernels;do
  8. offset=$(LANG=C grep -obUaP "\xff\xcf\xfa\xed" $k | head -n1 | cut -d':' -f1)
  9. ./lzssdec -o $offset < $k > $k.dec
  10. echo $offset
  11. name=$(strings $k.dec | grep "Darwin Kernel Version" | egrep -o 'xnu-\S+')
  12. echo $name
  13. if [ ! -d "$(dirname $name)" ]; then
  14. mkdir $(dirname $name)
  15. fi
  16. mv $k.dec $name
  17. rm $k
  18. done
Add Comment
Please, Sign In to add comment