import time
import zipfile
def extractFile(zFile,password):
try:
zFile.extractall(pwd=str.encode(password))
# 如果成功返回密码
return password
except:
return
def main():
start = time.time()
zFile = zipfile.ZipFile(r"C:\Users\A\Downloads\1000000769160334.zip", "r")
for id in range(1000000):
password = str(id).zfill(6)
guess = extractFile(zFile,password)
if (guess):
print("=========密码是:"+password+"\n")
print(f'耗时:{time.time() - start}')
exit(0)
if __name__ == '__main__':
main()
网友评论