mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
The files are downloaded from https://www.rockbox.org/tracker/task/11701 Change-Id: Ic6415f76207868661c231cb534cb179160eb60e0
31 lines
711 B
Python
31 lines
711 B
Python
#!/usr/bin/env python
|
|
import sys
|
|
import librbpms
|
|
|
|
|
|
def usage():
|
|
print ""
|
|
print "Please provide a command and (if needed) parameters as command line arguments"
|
|
print ""
|
|
print "Available commands:"
|
|
print ""
|
|
print " download <address> <size> <file>"
|
|
print " Downloads <size> bytes of data from the specified address on the device,"
|
|
print " and stores it in the specified file."
|
|
print ""
|
|
print "All numbers are hexadecimal!"
|
|
exit(2)
|
|
|
|
|
|
def parsecommand(dev, argv):
|
|
if len(argv) < 2: usage()
|
|
|
|
elif argv[1] == "download":
|
|
if len(argv) != 5: usage()
|
|
dev.download(int(argv[2], 16), int(argv[3], 16), argv[4])
|
|
|
|
else: usage()
|
|
|
|
|
|
dev = librbpms.rbpms()
|
|
parsecommand(dev, sys.argv)
|