| 179 |
theseven |
1 |
#!/usr/bin/env python
|
|
|
2 |
#
|
|
|
3 |
#
|
|
|
4 |
# Copyright 2010 TheSeven
|
|
|
5 |
#
|
|
|
6 |
#
|
| 810 |
theseven |
7 |
# This file is part of emCORE.
|
| 179 |
theseven |
8 |
#
|
| 810 |
theseven |
9 |
# emCORE is free software: you can redistribute it and/or
|
| 179 |
theseven |
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 |
#
|
| 810 |
theseven |
14 |
# emCORE is distributed in the hope that it will be useful,
|
| 179 |
theseven |
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 |
#
|
| 810 |
theseven |
19 |
# You should have received a copy of the GNU General Public License
|
|
|
20 |
# along with emCORE. If not, see <http://www.gnu.org/licenses/>.
|
| 179 |
theseven |
21 |
#
|
|
|
22 |
#
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
import sys
|
|
|
26 |
import libipodcrypto
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
def usage():
|
| 795 |
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(" s5l8702-genpwnage800 <infile> <outfile>")
|
|
|
42 |
print(" s5l8720-genpwnage <infile> <outfile>")
|
| 179 |
theseven |
43 |
exit(2)
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
def parsecommand(argv):
|
|
|
47 |
if len(argv) != 4: usage()
|
|
|
48 |
|
| 272 |
theseven |
49 |
elif argv[1] == "s5l8701-cryptdfu":
|
|
|
50 |
libipodcrypto.s5l8701cryptdfufile(argv[2], argv[3])
|
| 179 |
theseven |
51 |
|
| 272 |
theseven |
52 |
elif argv[1] == "s5l8701-decryptdfu":
|
|
|
53 |
libipodcrypto.s5l8701decryptdfufile(argv[2], argv[3])
|
| 179 |
theseven |
54 |
|
| 272 |
theseven |
55 |
elif argv[1] == "s5l8701-cryptfirmware":
|
|
|
56 |
libipodcrypto.s5l8701cryptfirmwarefile(argv[2], argv[3])
|
| 179 |
theseven |
57 |
|
| 272 |
theseven |
58 |
elif argv[1] == "s5l8701-decryptfirmware":
|
|
|
59 |
libipodcrypto.s5l8701decryptfirmwarefile(argv[2], argv[3])
|
| 179 |
theseven |
60 |
|
| 277 |
theseven |
61 |
elif argv[1] == "s5l8702-cryptnor":
|
|
|
62 |
libipodcrypto.s5l8702cryptnorfile(argv[2], argv[3])
|
|
|
63 |
|
|
|
64 |
elif argv[1] == "s5l8702-decryptnor":
|
|
|
65 |
libipodcrypto.s5l8702decryptnorfile(argv[2], argv[3])
|
|
|
66 |
|
| 359 |
theseven |
67 |
elif argv[1] == "s5l8702-genpwnage":
|
|
|
68 |
libipodcrypto.s5l8702genpwnagefile(argv[2], argv[3])
|
|
|
69 |
|
| 793 |
theseven |
70 |
elif argv[1] == "s5l8702-genpwnage800":
|
|
|
71 |
libipodcrypto.s5l8702genpwnagefile800(argv[2], argv[3])
|
|
|
72 |
|
| 722 |
theseven |
73 |
elif argv[1] == "s5l8720-genpwnage":
|
|
|
74 |
libipodcrypto.s5l8720genpwnagefile(argv[2], argv[3])
|
|
|
75 |
|
| 179 |
theseven |
76 |
else: usage()
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
parsecommand(sys.argv)
|