mirror of
https://github.com/elliotnunn/machfs.git
synced 2024-11-25 23:49:16 +00:00
Work around partitioned images
Just scan for the magic BD
This commit is contained in:
parent
fb493a154f
commit
873cce2cc9
@ -121,6 +121,13 @@ class Volume(AbstractFolder):
|
|||||||
self.name = 'Untitled'
|
self.name = 'Untitled'
|
||||||
|
|
||||||
def read(self, from_volume):
|
def read(self, from_volume):
|
||||||
|
for i in range(0, len(from_volume), 512):
|
||||||
|
if from_volume[i+1024:i+1024+2] == b'BD':
|
||||||
|
if i: from_volume = from_volume[i:]
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise ValueError('Magic number not found in image')
|
||||||
|
|
||||||
drSigWord, drCrDate, drLsMod, drAtrb, drNmFls, \
|
drSigWord, drCrDate, drLsMod, drAtrb, drNmFls, \
|
||||||
drVBMSt, drAllocPtr, drNmAlBlks, drAlBlkSiz, drClpSiz, drAlBlSt, \
|
drVBMSt, drAllocPtr, drNmAlBlks, drAlBlkSiz, drClpSiz, drAlBlSt, \
|
||||||
drNxtCNID, drFreeBks, drVN, drVolBkUp, drVSeqNum, \
|
drNxtCNID, drFreeBks, drVN, drVolBkUp, drVSeqNum, \
|
||||||
|
Loading…
Reference in New Issue
Block a user