Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
179 theseven 1
#!/usr/bin/env python
2
#
3
#
4
#    Copyright 2010 TheSeven
5
#
6
#
7
#    This file is part of TheSeven's iPod tools.
8
#
9
#    TheSeven's iBugger is free software: you can redistribute it and/or
10
#    modify it under the terms of the GNU General Public License as
11
#    published by the Free Software Foundation, either version 2 of the
12
#    License, or (at your option) any later version.
13
#
14
#    TheSeven's iBugger is distributed in the hope that it will be useful,
15
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
16
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
#    See the GNU General Public License for more details.
18
#
19
#    You should have received a copy of the GNU General Public License along
20
#    with TheSeven's iPod tools.  If not, see <http://www.gnu.org/licenses/>.
21
#
22
#
23
 
24
 
25
import sys
26
import libipodcrypto
27
 
28
 
29
def usage():
788 theseven 30
  print("")
31
  print("Please provide a command and (if needed) parameters as command line arguments")
32
  print("")
33
  print("Available commands:")
34
  print("  s5l8701-cryptdfu <infile> <outfile>")
35
  print("  s5l8701-decryptdfu <infile> <outfile>")
36
  print("  s5l8701-cryptfirmware <infile> <outfile>")
37
  print("  s5l8701-decryptfirmware <infile> <outfile>")
38
  print("  s5l8702-cryptnor <infile> <outfile>")
39
  print("  s5l8702-decryptnor <infile> <outfile>")
40
  print("  s5l8702-genpwnage <infile> <outfile>")
41
  print("  s5l8720-genpwnage <infile> <outfile>")
179 theseven 42
  exit(2)
43
 
44
 
45
def parsecommand(argv):
46
  if len(argv) != 4: usage()
47
 
272 theseven 48
  elif argv[1] == "s5l8701-cryptdfu":
49
    libipodcrypto.s5l8701cryptdfufile(argv[2], argv[3])
179 theseven 50
 
272 theseven 51
  elif argv[1] == "s5l8701-decryptdfu":
52
    libipodcrypto.s5l8701decryptdfufile(argv[2], argv[3])
179 theseven 53
 
272 theseven 54
  elif argv[1] == "s5l8701-cryptfirmware":
55
    libipodcrypto.s5l8701cryptfirmwarefile(argv[2], argv[3])
179 theseven 56
 
272 theseven 57
  elif argv[1] == "s5l8701-decryptfirmware":
58
    libipodcrypto.s5l8701decryptfirmwarefile(argv[2], argv[3])
179 theseven 59
 
277 theseven 60
  elif argv[1] == "s5l8702-cryptnor":
61
    libipodcrypto.s5l8702cryptnorfile(argv[2], argv[3])
62
 
63
  elif argv[1] == "s5l8702-decryptnor":
64
    libipodcrypto.s5l8702decryptnorfile(argv[2], argv[3])
65
 
359 theseven 66
  elif argv[1] == "s5l8702-genpwnage":
67
    libipodcrypto.s5l8702genpwnagefile(argv[2], argv[3])
68
 
722 theseven 69
  elif argv[1] == "s5l8720-genpwnage":
70
    libipodcrypto.s5l8720genpwnagefile(argv[2], argv[3])
71
 
179 theseven 72
  else: usage()
73
 
74
 
75
parsecommand(sys.argv)