无法在Python上启动新线程来破解我的zipFile

2024-09-30 12:29:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用python开发更深入的黑客知识。所以我的第一个任务是破解我自己的zip文件。我知道密码是“xyz”。这就是为什么我让for循环从3开始

我有一台MacOS。不知道线程限制

def crack(zip, pwd):
.... #some code here


zipFile = "url_to_my_zipFile"
myLetters = string.ascii_letters + string.digits + string.punctuation


the_threads = []
for i in range(3,4):
    for jPWD in map(''.join, itertools.product(myLetters, repeat=i)):
            t = threading.Thread(target=crack, args=(zipFile, jPWD))
            the_threads.append(t)
            t.start()

我知道我应该储存我的线程。 我要把它们放进线里。大概1000多块吧。 但我不知道该怎么加上 for循环以及在何处添加.join()函数


Tags: 文件thein密码forstringzip线程

热门问题