Пример #1
0
        sys.exit(-1)

# extract archive

print('%s[*]%s Beginning extraction...' % (Fore.GREEN, Fore.RESET))

if fext == '.sfs' or fext == '.squashfs':

    # extract rootfs from SquashFS

    try:
        img = PySquashfsImage.SquashFsImage(fname)
        path = os.path.join(homedirw, 'rootfs-temp')

        hide_cursor()
        ntfsea.init()

        i = 0
        for file in img.root.findAll():
            name = file.getPath().lstrip('./')
            winpath = path + '/' + escape_ntfs_invalid(name)

            draw_progress(i, img.total_inodes, name)
            i += 1

            try:

                # create directory or extract file

                if file.isFolder():
                    os.makedirs(winpath, exist_ok=True)
		sys.exit(-1)

# extract archive

print('%s[*]%s Beginning extraction...' % (Fore.GREEN, Fore.RESET))

if fext == '.sfs' or fext == '.squashfs':

	# extract rootfs from SquashFS

	try:
		img  = PySquashfsImage.SquashFsImage(fname)
		path = os.path.join(homedirw, 'rootfs-temp')

		hide_cursor()
		ntfsea.init()

		i = 0
		for file in img.root.findAll():
			name = file.getPath().lstrip('./')
			winpath = path + '/' + escape_ntfs_invalid(name)

			draw_progress(i, img.total_inodes, name)
			i += 1

			try:

				# create directory or extract file

				if file.isFolder():
					os.makedirs(winpath, exist_ok = True)