summaryrefslogtreecommitdiffstats
path: root/oncology/dpfhack_display/fw/fulldump.py
blob: 28c0ad2c3089d1321e1e116f4cf9498f7b54a4c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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()