canon-mf644
canon-mf644 copied to clipboard
loaders-canon.py parsing issue
Hey there, While extracting the firmware, it seems that towards the end bytesIO returns NoneType when 4 bytes are read from the stream:
def peek_magic(stream):
""" retrieve block type """
try:
magic = unpack("<4s", stream.read(Container.MAGIC_SIZE))[0]
stream.seek(-Container.MAGIC_SIZE, 1) # os.SEEK_SET)
return magic
except error:
return None
I've fixed that we type checking for the stream.read() results.