code: def guess_leb_size(path):
      
  
      f = open(path, 'rb')
      f.seek(0,2)
      file_size = f.tell()+1
      f.seek(0)
      block_size = None
  
      for _ in range(0, file_size, FILE_CHUNK_SZ):
          buf = f.read(FILE_CHUNK_SZ)
  
          for m in re.finditer(UBIFS_NODE_MAGIC, buf):
              start = m.start()
              chdr = nodes.common_hdr(buf[start:start+UBIFS_COMMON_HDR_SZ])
  
              if chdr and chdr.node_type == UBIFS_SB_NODE:
                  sb_start = start + UBIFS_COMMON_HDR_SZ
                  sb_end = sb_start + UBIFS_SB_NODE_SZ
  
                  if chdr.len != len(buf[sb_start:sb_end]):
                      f.seek(sb_start)
                      buf = f.read(UBIFS_SB_NODE_SZ)
                  else:
                      buf = buf[sb_start:sb_end]
  
                  sbn = nodes.sb_node(buf)
                  block_size = sbn.leb_size
                  f.close()
                  return block_size
  
      f.close()
      return block_size
docs: Get LEB size from superblock
  
      Arguments:
      Str:path    -- Path to file.
      
      Returns:
      Int         -- LEB size.
      
      Searches file for superblock and retrieves leb size.