├── DeserializeAll.py ├── README.md └── cfr-0.151.jar /DeserializeAll.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | import os 4 | import subprocess 5 | import sys 6 | 7 | # 批量反编译 8 | def DeserializeAll(paths,outputpath): 9 | if paths.endswith("jar"): 10 | popen = subprocess.Popen(['java','-jar','cfr-0.151.jar',paths,'--outputpath',outputpath],stdout=subprocess.PIPE) 11 | data = popen.stdout.read() 12 | print(data) 13 | else: 14 | for path in os.listdir(paths): 15 | childpath = os.path.join(paths,path) 16 | if os.path.isfile(childpath): 17 | if childpath.endswith("jar") or childpath.endswith("class"): 18 | popen = subprocess.Popen(['java','-jar','cfr-0.151.jar',childpath,'--outputpath',outputpath],stdout=subprocess.PIPE) 19 | data = popen.stdout.read() 20 | print(data) 21 | elif os.path.isdir(childpath): 22 | DeserializeAll(childpath,outputpath) 23 | 24 | try: 25 | OriginPath = sys.argv[1] 26 | OutputPath = sys.argv[2] 27 | DeserializeAll(OriginPath,OutputPath) 28 | except Exception as e: 29 | print("python DeserializeAll.py ") 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DeserializeAll 2 | 一个简单的批量反编译化jar包的小脚本 3 | 4 | python3 版本,利用了 cfr.jar 5 | 6 | python DeserializeAll.py <待反编译位置> <结果输出位置> 7 | -------------------------------------------------------------------------------- /cfr-0.151.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KpLi0rn/DeserializeAll/4e582c1b169296edcdd99dd70065759b5395069e/cfr-0.151.jar --------------------------------------------------------------------------------