import rarfile
import zipfile
import py7zr
c = 0
a = 0
print("本软件只支持 7z , zip , rar格式的压缩包")
zd = input("请输入字典位置:")
try:
    ozd = open(zd,"r",encoding="utf8").read().split("\n")
except:
    print("字典读取失败")
print(f"检测到字典里有{len(ozd)}个密码")
file = input("请输入要破解的压缩包位置:")
if file.endswith(".zip"):
    print("检测到是zip压缩包")
    print("正在破解.....")
    zip = zipfile.ZipFile(file)
    for pas in ozd:
        c = c + 1
        pasw = bytes(pas.encode("utf8"))
        try:
            zip.extractall(pwd=pasw)
            print("破解成功,密码是:" + pas)
            a = a + 1
            break
        except:
            pass
    if a == 0:
            print("破解失败")
elif file.endswith(".rar"):
    print("检测到是rar压缩包")
    print("正在破解.....")
    rar = rarfile.RarFile(file)
    for pas in ozd:
        c = c + 1
        pasw = bytes(pas.encode("utf8"))
        try:
            rar.extractall(pwd=pasw)
            print("破解成功,密码是:" + pas)
            a = a + 1
            break
        except:
            pass
    if a == 0:
        print("破解失败")
elif file.endswith(".7z"):
    print("检测到是7z压缩包")
    print("正在破解.....")
    for pas in ozd:
        c = c + 1
        pasw = bytes(pas.encode("utf8"))
        try:
            qz = py7zr.SevenZipFile(file,password=pasw)
            qz.extractall()
            print("破解成功,密码是" + pas)
            a = a + 1
            break
        except:
                pass
    if a == 0:
        print("破解失败")
else:
    print("此文件不是压缩包文件")
print(f"已经尝试了{c}个密码")
input("破解完成,请按任意键继续.....")

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

import rarfile

import zipfile

import py7zr

= 0

= 0

print("本软件只支持 7z , zip , rar格式的压缩包")

zd = input("请输入字典位置:")

try:

    ozd = open(zd,"r",encoding="utf8").read().split("\n")

except:

    print("字典读取失败")

print(f"检测到字典里有{len(ozd)}个密码")

file = input("请输入要破解的压缩包位置:")

if file.endswith(".zip"):

    print("检测到是zip压缩包")

    print("正在破解.....")

    zip = zipfile.ZipFile(file)

    for pas in ozd:

        = + 1

        pasw = bytes(pas.encode("utf8"))

        try:

            zip.extractall(pwd=pasw)

            print("破解成功,密码是:" + pas)

            = + 1

            break

        except:

            pass

    if == 0:

            print("破解失败")

elif file.endswith(".rar"):

    print("检测到是rar压缩包")

    print("正在破解.....")

    rar = rarfile.RarFile(file)

    for pas in ozd:

        = + 1

        pasw = bytes(pas.encode("utf8"))

        try:

            rar.extractall(pwd=pasw)

            print("破解成功,密码是:" + pas)

            = + 1

            break

        except:

            pass

    if == 0:

        print("破解失败")

elif file.endswith(".7z"):

    print("检测到是7z压缩包")

    print("正在破解.....")

    for pas in ozd:

        = + 1

        pasw = bytes(pas.encode("utf8"))

        try:

            qz = py7zr.SevenZipFile(file,password=pasw)

            qz.extractall()

            print("破解成功,密码是" + pas)

            = + 1

            break

        except:

                pass

    if == 0:

        print("破解失败")

else:

    print("此文件不是压缩包文件")

print(f"已经尝试了{c}个密码")

input("破解完成,请按任意键继续.....")

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐