Subversion Repositories freemyipod

Rev

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():
30
  print ""
31
  print "Please provide a command and (if needed) parameters as command line arguments"
32
  print ""
33
  print "Available commands:"
34
  print "  nano2g-cryptdfu <infile> <outfile>"
35
  print "  nano2g-decryptdfu <infile> <outfile>"
36
  print "  nano2g-cryptfirmware <infile> <outfile>"
37
  print "  nano2g-decryptfirmware <infile> <outfile>"
38
  exit(2)
39
 
40
 
41
def parsecommand(argv):
42
  if len(argv) != 4: usage()
43
 
44
  elif argv[1] == "nano2g-cryptdfu":
45
    libipodcrypto.nano2gcryptdfufile(argv[2], argv[3])
46
 
47
  elif argv[1] == "nano2g-decryptdfu":
48
    libipodcrypto.nano2gdecryptdfufile(argv[2], argv[3])
49
 
50
  elif argv[1] == "nano2g-cryptfirmware":
51
    libipodcrypto.nano2gcryptfirmwarefile(argv[2], argv[3])
52
 
53
  elif argv[1] == "nano2g-decryptfirmware":
54
    libipodcrypto.nano2gdecryptfirmwarefile(argv[2], argv[3])
55
 
56
  else: usage()
57
 
58
 
59
parsecommand(sys.argv)