Exemplo n.º 1
0
                # create directory or extract file

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

                else:
                    with open(winpath, 'wb') as f:
                        f.write(file.getContent())

                # apply lxattrb

                os.chmod(winpath, stat.S_IWRITE)

                attrb = lxattrb.fromsfs(file).generate()
                ntfsea.writeattr(winpath, 'lxattrb', attrb)

            except Exception as err:
                clear_progress()
                print('%s[!]%s Failed to extract %s: %s' %
                      (Fore.YELLOW, Fore.RESET, name, err))
                pass

    finally:
        img.close()
        clear_progress()
        show_cursor()

else:

    # the TarFile class has a list of supported compression methods, but this is stored
Exemplo n.º 2
0
                # create directory or extract file

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

                else:
                    with open(winpath, 'wb') as f:
                        f.write(file.getContent())

                # apply lxattrb

                os.chmod(winpath, 0o777)

                attrb = lxattrb.fromsfs(file).generate()
                ntfsea.writeattr(path_trans(winpath), 'lxattrb', attrb)

            except Exception as err:
                clear_progress()
                print('%s[!]%s Failed to extract %s: %s' %
                      (Fore.YELLOW, Fore.RESET, name, err))
                pass

    finally:
        img.close()
        clear_progress()
        show_cursor()

else:

    # the TarFile class has a list of supported compression methods, but this is stored
				# create directory or extract file

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

				else:
					with open(winpath, 'wb') as f:
						f.write(file.getContent())

				# apply lxattrb

				os.chmod(winpath, 0o777)

				attrb = lxattrb.fromsfs(file).generate()
				ntfsea.writeattr(path_trans(winpath), 'lxattrb', attrb)

			except Exception as err:
				clear_progress()
				print('%s[!]%s Failed to extract %s: %s' % (Fore.YELLOW, Fore.RESET, name, err))
				pass

	finally:
		img.close()
		clear_progress()
		show_cursor()

else:

	# the TarFile class has a list of supported compression methods, but this is stored
	# in a dictionary, which somehow becomes randomized during each run. since the 'tar'