# Make dir for writing temp code if not os.path.exists("lcd.tmp"): os.makedirs("lcd.tmp") else: os.system("rm -f lcd.tmp/*") dumpfile = arg if arg.startswith("/dev/"): # # copy of fulldump.py # print("Detecting & reading dpf flash...") d = dpf.open(arg) size = detect.detect_flash(d) # Offset, size print("Reading %x bytes from flash..." % size) buf = d.readFlash(0x00, size) dump_filename="fulldump_" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + ".bin" f = open(dump_filename, "wb") f.write(buf) f.close() d.close() print("Flash written to file '%s'." % dump_filename) print() dumpfile = dump_filename else: ################ WINDOWS ################ if len(sys.argv) != 2: print("Usage: %s dumpfile|DPF_CDROM_driveletter\n" % sys.argv[0])
# Make dir for writing temp code if not os.path.exists("lcd.tmp"): os.makedirs("lcd.tmp") else: os.system("rm -f lcd.tmp/*") dumpfile = arg if arg.startswith("/dev/"): # # copy of fulldump.py # print("Detecting & reading dpf flash...") d = dpf.open(arg) size = detect.detect_flash(d) # Offset, size print("Reading %x bytes from flash..." % size) buf = d.readFlash(0x00, size) dump_filename = "fulldump_" + datetime.datetime.now().strftime( "%Y%m%d-%H%M%S") + ".bin" f = open(dump_filename, "wb") f.write(buf) f.close() d.close() print("Flash written to file '%s'." % dump_filename) print() dumpfile = dump_filename else: ################ WINDOWS ################ if len(sys.argv) != 2: