code: def ParseFileObject(self, parser_mediator, file_object):
      
      file_header_map = self._GetDataTypeMap('asl_file_header')
  
      try:
        file_header, _ = self._ReadStructureFromFileObject(
            file_object, 0, file_header_map)
      except (ValueError, errors.ParseError) as exception:
        raise errors.UnableToParseFile(
            'Unable to parse file header with error: {0!s}'.format(
                exception))
  
      if file_header.signature != self._FILE_SIGNATURE:
        raise errors.UnableToParseFile('Invalid file signature.')
  
      # TODO: generate event for creation time.
  
      file_size = file_object.get_size()
  
      if file_header.first_log_entry_offset > 0:
        last_log_entry_offset = 0
        file_offset = file_header.first_log_entry_offset
  
        while file_offset < file_size:
          last_log_entry_offset = file_offset
  
          try:
            file_offset = self._ParseRecord(
                parser_mediator, file_object, file_offset)
          except errors.ParseError as exception:
            parser_mediator.ProduceExtractionWarning(
                'unable to parse record with error: {0!s}'.format(exception))
            return
  
          if file_offset == 0:
            break
  
        if last_log_entry_offset != file_header.last_log_entry_offset:
          parser_mediator.ProduceExtractionWarning(
              'last log entry offset does not match value in file header.')
docs: Parses an ASL file-like object.
  
      Args:
        parser_mediator (ParserMediator): mediates interactions between parsers
            and other components, such as storage and dfvfs.
        file_object (dfvfs.FileIO): file-like object.
  
      Raises:
        UnableToParseFile: when the file cannot be parsed.