Subversion Repositories freemyipod

Rev

Rev 179 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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