最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

ZIP文件解密[Termux,Python]

2023-08-06 00:54 作者:真雷神托兒  | 我要投稿


################### 目錄 ###################
#PATH_home = '/storage/emulated/0' ?#以'/storage/emulated/0'為初始目錄

PATH_home = '' ? #以__file__的上一級目錄為初始目錄
################### 目錄 ###################
import os
os.system('pip list > pip_list.txt')
PIP = ['textual','pyzipper']
with open('pip_list.txt','r') as f :
 ? ?pip_list = f.read().split()
for i in PIP :
 ? ?if i not in pip_list :
 ? ? ? ?os.system(f'pip install {i} -i https://pypi.tuna.tsinghua.edu.cn/simple')
 ? ? ? ?
import pyzipper
from sys import argv
from textual.app import App
from textual.screen import Screen
from textual.widgets import DirectoryTree,Header,Button

pwd_path = None
file_path = None
out_path = os.path.dirname(os.path.realpath(argv[0]))

if PATH_home[-1:] != '/' and len(PATH_home) > 1 :
 ? ?PATH_home+='/'
if not os.path.exists(PATH_home) :
 ? ?PATH_home = out_path

def pwd_list() :
 ? ?if os.path.isfile(pwd_path) :
 ? ? ? ?pwd_L = [pwd_path]
 ? ?else :
 ? ? ? ?pwd_L = os.listdir(pwd_path)
 ? ? ? ?pwd_L = [str(pwd_path)+'/'+i for i in pwd_L]
 ? ?for i in pwd_L :
 ? ? ? ?print('\n當(dāng)前字典 : ',i,end='\n')
 ? ? ? ?with open(i,'r') as f:
 ? ? ? ? ? ?for line in f:
 ? ? ? ? ? ? ? ?yield line.strip()
 ? ? ? ?
def zip_pwd(a) :
 ? ?_s = 0
 ? ?zip_file = pyzipper.AESZipFile(file_path, 'r')
 ? ?while True :
 ? ? ? ?try :
 ? ? ? ? ? ?passwd = next(a)
 ? ? ? ? ? ?zip_file.extractall(path=out_path,pwd=passwd.encode())
 ? ? ? ? ? ?zip_file.close()
 ? ? ? ? ? ?print('\r',_s, end='\n')
 ? ? ? ? ? ?print('密碼是 : ',passwd)
 ? ? ? ? ? ?return passwd
 ? ? ? ?except RuntimeError :
 ? ? ? ? ? ?print('\r',_s, end='')
 ? ? ? ?except StopIteration :
 ? ? ? ? ? ?print('\r',_s, end='\n')
 ? ? ? ? ? ?print('未能匹配到密碼')
 ? ? ? ? ? ?return None
 ? ? ? ?except Exception as e :
 ? ? ? ? ? ?pass
 ? ? ? ? ? ?#print('\n異常值 : "',passwd,'"\n',e,end='\n')
 ? ? ? ?_s+=1
 ? ? ? ?
class zipp_1(Screen):
 ? ?def compose(self) :
 ? ? ? ?yield Header()
 ? ? ? ?yield DirectoryTree(PATH_home)
 ? ? ? ?self.notify('選擇一個加密的ZIP文件',title='選擇文件',timeout=10)
 ? ? ? ?
class zipp_2(Screen):
 ? ?def compose(self) :
 ? ? ? ?yield Header()
 ? ? ? ?yield DirectoryTree(PATH_home)
 ? ? ? ?yield Button('R U N',variant='success')
 ? ? ? ?self.notify('''
選擇一個字典文件,
或者含有多個字典
文件的文件夾,點(diǎn)
擊RUN開始任務(wù)。
''', ? ?
 ? ? ? ?title='選擇字典',timeout=30)
 ? ? ? ? ? ?
class zipp(App):
 ? ?CSS = '''
 ? ?Header {height: 3 ;background: $error;text-style:bold}
 ? ?Button {width: 50}
 ? ?'''
 ? ?
 ? ?TITLE = '選擇需要破解的ZIP文件'
 ? ?
 ? ?SCREENS = {
 ? ?'zip': zipp_1(),
 ? ?'dic': zipp_2()
 ? ?}
 ? ?
 ? ?def on_mount(self) :
 ? ? ? ?self.push_screen('zip')
 ? ? ? ?
 ? ?def on_tree_node_highlighted(self,event) :
 ? ? ? ?global pwd_path,file_path
 ? ? ? ?if not file_path :
 ? ? ? ? ? ?return
 ? ? ? ?pwd_path = event.node.data.path
 ? ?
 ? ?def on_directory_tree_file_selected(self,event) :
 ? ? ? ?global file_path
 ? ? ? ?if file_path :
 ? ? ? ? ? ?return
 ? ? ? ?if str(event.path)[-4:].lower() == '.zip' :
 ? ? ? ? ? ?file_path = event.path
 ? ? ? ? ? ?self.title = '選擇一個字典文件'
 ? ? ? ? ? ?self.switch_screen('dic')
 ? ?
 ? ?def on_button_pressed(self) :
 ? ? ? ?self.exit()
 ? ? ? ?
if __name__ == '__main__' :
 ? ?zipp().run()
 ? ?PWD = pwd_list()
 ? ?os.system('clear')
 ? ?zip_pwd(PWD)


ZIP文件解密[Termux,Python]的評論 (共 條)

分享到微博請遵守國家法律
通化市| 越西县| 曲靖市| 西城区| 石泉县| 杭锦旗| 滨海县| 东兰县| 旬邑县| 手游| 蚌埠市| 遂川县| 蒙阴县| 察雅县| 东乌| 股票| 白朗县| 嘉黎县| 长寿区| 泸溪县| 昌邑市| 弋阳县| 穆棱市| 双牌县| 安溪县| 敦化市| 宁河县| 临洮县| 汕头市| 兰西县| 社会| 延吉市| 康定县| 东乡县| 中超| 汪清县| 湖州市| 工布江达县| 盐山县| 宜阳县| 金山区|