summaryrefslogtreecommitdiffstats
path: root/oncology/dpfhack_display/fw/fulldump.py
diff options
context:
space:
mode:
authortv <tv@xso>2011-08-22 12:48:27 +0200
committertv <tv@xso>2011-08-22 12:48:27 +0200
commitc2117a9064fcee0d287fbd8d164eef57d6b6c275 (patch)
tree60eda265a3ee69195c86ce8d1ee16c014fd75d52 /oncology/dpfhack_display/fw/fulldump.py
parent45ceee319c70522d821f65505735bc514d123df5 (diff)
parent5e102279a72d77305d84f3cab9aef464a76ecb68 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'oncology/dpfhack_display/fw/fulldump.py')
-rwxr-xr-xoncology/dpfhack_display/fw/fulldump.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/oncology/dpfhack_display/fw/fulldump.py b/oncology/dpfhack_display/fw/fulldump.py
new file mode 100755
index 00000000..28c0ad2c
--- /dev/null
+++ b/oncology/dpfhack_display/fw/fulldump.py
@@ -0,0 +1,29 @@
+# Script to extract flash
+#
+# <hackfin@section5.ch>
+#
+# Argument is either:
+#
+# /dev/sgX : scsi device (unhacked mode)
+# usb0 : developer mode (already hacked)
+
+import sys
+sys.path.append("./Debug")
+import dpf
+
+import detect
+
+d = dpf.open(sys.argv[1])
+
+size = detect.detect_flash(d)
+
+# Offset, size
+print "Reading %x bytes..." % size
+buf = d.readFlash(0x00, size)
+
+f = open("full.bin", "wb")
+f.write(buf)
+f.close()
+
+d.close()
+