def next_object(self):
    # read warts object header
    self.header = self.fd.read(8)
    # sanity check
    if len(self.header) != 8:
      return None
    (magic, typ, length) = struct.unpack('!HHI', self.header)
    if self.verbose:
      print "Magic: %02X Obj: %02X Len: %02x" % (magic, typ, length)
    assert(magic == obj_type['MAGIC'])
    # read remainder of object
    data = self.fd.read(length)
    if typ == obj_type['LIST']:
      return WartsList(data, verbose=self.verbose)
    elif typ == obj_type['CYCLESTART']:
      return WartsCycle(data, verbose=self.verbose)
    elif typ == obj_type['CYCLE']:
      return WartsCycle(data, verbose=self.verbose)
    elif typ == obj_type['CYCLE_STOP']:
      return WartsCycleStop(data, verbose=self.verbose)
    elif typ == TRACEBOXTYPE:
      return WartsTraceBox(data, verbose=self.verbose) 
    else:
      print "Unsupported object: %02x Len: %d" % (typ, length)
      assert False