def hexbin(inp, out):
 ifp = HexBin(inp)
 finfo = ifp.FInfo
 if (not out):
  out = ifp.FName
 ofp = open(out, 'wb')
 while 1:
  d = ifp.read(128000)
  if (not d):
   break
  ofp.write(d)
 ofp.close()
 ifp.close_data()
 d = ifp.read_rsrc(128000)
 if d:
  ofp = openrsrc(out, 'wb')
  ofp.write(d)
  while 1:
   d = ifp.read_rsrc(128000)
   if (not d):
    break
   ofp.write(d)
  ofp.close()
 ifp.close()

def hexbin ( inp , out ) : ifp = HexBin ( inp ) finfo = ifp . FInfo if ( not out ) : out = ifp . FName ofp = open ( out , 'wb' ) while 1 : d = ifp . read ( 128000 ) if ( not d ) : break ofp . write ( d ) ofp . close ( ) ifp . close_data ( ) d = ifp . read_rsrc ( 128000 ) if d : ofp = openrsrc ( out , 'wb' ) ofp . write ( d ) while 1 : d = ifp . read_rsrc ( 128000 ) if ( not d ) : break ofp . write ( d ) ofp . close ( ) ifp . close ( )
hexbin - decode binhexed file .