Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import sys
- def main():
- archive = sys.argv[1]
- dictionary = sys.argv[2]
- with open(dictionary, "rb") as dic:
- for word in dic.read().splitlines():
- stdout = subprocess.call("7z t -p'{0}' {1}".format(word.decode("utf-8"), archive), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, shell=True)
- if stdout == 0:
- print("Password found: " + word.decode("utf-8"))
- return
- print("Password not found.")
- if __name__ == "__main__":
- if len(sys.argv) == 3:
- main()
- else:
- print("missing args")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement