Advertisement
xerpi

3DS CTR Decryptor script

Sep 1st, 2014
1,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  1. #3DS CTR Decryptor helper script by xerpi
  2.  
  3. import sys
  4. import glob
  5. import os
  6. import subprocess
  7. from subprocess import check_output
  8.  
  9. print "3DS CTR Decryptor helper script by xerpi"
  10. print "Enter the file you want to decrypt:"
  11. filename = raw_input();
  12. print "\nCreating ncchinfo.bin..."
  13. try:
  14.     check_output([glob.glob("./ctrKeyGen*")[0], filename])
  15. except Exception:
  16.     print "Failed to open ctrKeyGen, is it here?"
  17.     sys.exit()
  18.  
  19.    
  20. print "Done! Now copy the ncchinfo.bin to the root of your SD"
  21. print "And run the Launcher.dat\n"
  22. raw_input("Press Enter to continue...")
  23.  
  24. print "Extracting .3ds FS... (may take a while)"
  25. try:
  26.     check_output([glob.glob("./ctrtool*")[0], "-p", "--exefs=exefs.encrypted.bin", "--exheader=exheader.encrypted.bin", "--romfs=romfs.encrypted.bin", "%s"%filename])
  27. except Exception:
  28.         print "Failed to open ctrtool, is it here?"
  29.         sys.exit()
  30. print "(ignore the error above) Done!"
  31. print "Once the Launcher.dat has finished, copy all the xorpads here"
  32. raw_input("Press Enter to continue...")
  33.  
  34. print "XORing exefs..."
  35. try:
  36.     subprocess.call([glob.glob("./padxorer*")[0], "./exefs.encrypted.bin", glob.glob("./*.exefs.xorpad")[0]])
  37. except Exception:
  38.     print "Failed"
  39.     pass
  40. else:
  41.     os.rename("./exefs.encrypted.bin.out", "./exefs.decrypted.bin")
  42.  
  43. print "XORing exheader..."
  44. try:
  45.     subprocess.call([glob.glob("./padxorer*")[0], "./exheader.encrypted.bin", glob.glob("./*.exheader.xorpad")[0]])
  46. except Exception:
  47.     print "Failed"
  48.     pass
  49. else:
  50.     os.rename("./exheader.encrypted.bin.out", "./exheader.decrypted.bin")
  51.  
  52. print "XORing romfs..."
  53. try:
  54.     subprocess.call([glob.glob("./padxorer*")[0], "./romfs.encrypted.bin", glob.glob("./*.romfs.xorpad")[0]])
  55. except Exception:
  56.     print "Failed"
  57.     pass
  58. else:
  59.     os.rename("./romfs.encrypted.bin.out", "./romfs.decrypted.bin")
  60.  
  61. print "Everything finished :D"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement