New file using Struct
This commit is contained in:
parent
69a49be099
commit
1971d427a2
|
@ -0,0 +1,15 @@
|
|||
from struct import unpack
|
||||
|
||||
#Is File a SOS DRIVER file?
|
||||
SOSfile = open('SOSCFFA.DRIVER', 'rb')
|
||||
SOS = SOSfile.read(10)
|
||||
filetype, offset = unpack('< 8s H', SOS)
|
||||
print "Filetype is: %s. Offset is: %04x" % (filetype, offset)
|
||||
|
||||
#Seek to first driver
|
||||
SOSfile.seek(offset,1)
|
||||
SOS = SOSfile.read(2) # Read two bytes
|
||||
marker = unpack('< H', SOS)
|
||||
if marker == \x0000 :
|
||||
|
||||
SOSfile.close()
|
Loading…
Reference in New Issue