code: def read_null_terminated_string(f):
      
      x = bytearray()
      while True:
          z = f.read(1)
          if ord(z) == 0:
              return x
          else:
              x.append(ord(z))
docs: Read a null terminated string from a file-like object.
  
      :param f: file-like object
      :rtype: bytearray