| 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:"
|
| 272 |
theseven |
34 |
print " s5l8701-cryptdfu <infile> <outfile>"
|
|
|
35 |
print " s5l8701-decryptdfu <infile> <outfile>"
|
|
|
36 |
print " s5l8701-cryptfirmware <infile> <outfile>"
|
|
|
37 |
print " s5l8701-decryptfirmware <infile> <outfile>"
|
| 277 |
theseven |
38 |
print " s5l8702-cryptnor <infile> <outfile>"
|
|
|
39 |
print " s5l8702-decryptnor <infile> <outfile>"
|
| 359 |
theseven |
40 |
print " s5l8702-genpwnage <infile> <outfile>"
|
| 179 |
theseven |
41 |
exit(2)
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
def parsecommand(argv):
|
|
|
45 |
if len(argv) != 4: usage()
|
|
|
46 |
|
| 272 |
theseven |
47 |
elif argv[1] == "s5l8701-cryptdfu":
|
|
|
48 |
libipodcrypto.s5l8701cryptdfufile(argv[2], argv[3])
|
| 179 |
theseven |
49 |
|
| 272 |
theseven |
50 |
elif argv[1] == "s5l8701-decryptdfu":
|
|
|
51 |
libipodcrypto.s5l8701decryptdfufile(argv[2], argv[3])
|
| 179 |
theseven |
52 |
|
| 272 |
theseven |
53 |
elif argv[1] == "s5l8701-cryptfirmware":
|
|
|
54 |
libipodcrypto.s5l8701cryptfirmwarefile(argv[2], argv[3])
|
| 179 |
theseven |
55 |
|
| 272 |
theseven |
56 |
elif argv[1] == "s5l8701-decryptfirmware":
|
|
|
57 |
libipodcrypto.s5l8701decryptfirmwarefile(argv[2], argv[3])
|
| 179 |
theseven |
58 |
|
| 277 |
theseven |
59 |
elif argv[1] == "s5l8702-cryptnor":
|
|
|
60 |
libipodcrypto.s5l8702cryptnorfile(argv[2], argv[3])
|
|
|
61 |
|
|
|
62 |
elif argv[1] == "s5l8702-decryptnor":
|
|
|
63 |
libipodcrypto.s5l8702decryptnorfile(argv[2], argv[3])
|
|
|
64 |
|
| 359 |
theseven |
65 |
elif argv[1] == "s5l8702-genpwnage":
|
|
|
66 |
libipodcrypto.s5l8702genpwnagefile(argv[2], argv[3])
|
|
|
67 |
|
| 179 |
theseven |
68 |
else: usage()
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
parsecommand(sys.argv)
|