def METHOD_NAME(self, file: File, start_offset: int) -> Optional[ValidChunk]:
    file.seek(0, io.SEEK_END)
    eof = file.tell()
    file.seek(start_offset)
    endian = self.guess_endian(file)
    current_offset = start_offset
    while current_offset < eof:
        node_start_offset = current_offset
        file.seek(current_offset)
        try:
            header = self.parse_header(file, endian=endian)
        except EOFError:
            break
        if header.magic not in JFFS2_MAGICS:
            # JFFS2 allows padding at the end with 0xFF or 0x00, usually
            # to the size of an erase block.
            if header.magic in [0x0000, 0xFFFF]:
                file.seek(-len(header), io.SEEK_CUR)
                current_offset = read_until_past(file, b"\x00\xFF")
                continue
            logger.debug(
                "unexpected header magic",
                header_magic=header.magic,
                _verbosity=2,
            )
            break
        if not self.valid_header(header, node_start_offset, eof):
            return None
        node_len = round_up(header.totlen, BLOCK_ALIGNMENT)
        current_offset += node_len
    if current_offset > eof:
        raise InvalidInputFormat("Corrupt file or last chunk isn't really JFFS2")
    return ValidChunk(
        start_offset=start_offset,
        end_offset=current_offset,
    )