mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-24 23:29:51 +00:00
Added fix for xex with bad segment definitions
This commit is contained in:
parent
59d5f40e10
commit
b2b08df40c
@ -399,7 +399,11 @@ class AtariDosFile(object):
|
|||||||
pos = 0
|
pos = 0
|
||||||
first = True
|
first = True
|
||||||
while pos < self.size:
|
while pos < self.size:
|
||||||
|
if pos + 1 < self.size:
|
||||||
header, = bytes[pos:pos+2].view(dtype=np.uint16)
|
header, = bytes[pos:pos+2].view(dtype=np.uint16)
|
||||||
|
else:
|
||||||
|
self.segments.append(ObjSegment(pos, pos + 1, 0, 1, bytes[pos:pos + 1], "Incomplete Data"))
|
||||||
|
break
|
||||||
if header == 0xffff:
|
if header == 0xffff:
|
||||||
# Apparently 0xffff header can appear in any segment, not just
|
# Apparently 0xffff header can appear in any segment, not just
|
||||||
# the first. Regardless, it is ignored everywhere.
|
# the first. Regardless, it is ignored everywhere.
|
||||||
@ -821,6 +825,7 @@ def run():
|
|||||||
if options.verbose: print "%s: Doesn't look like a supported disk image" % filename
|
if options.verbose: print "%s: Doesn't look like a supported disk image" % filename
|
||||||
try:
|
try:
|
||||||
image = AtariDosFile(data)
|
image = AtariDosFile(data)
|
||||||
|
print "%s:\n%s" % (filename, image)
|
||||||
except InvalidBinaryFile:
|
except InvalidBinaryFile:
|
||||||
if options.verbose: print "%s: Doesn't look like an XEX either" % filename
|
if options.verbose: print "%s: Doesn't look like an XEX either" % filename
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user