1
0
Fork 0
mirror of https://github.com/HACKERALERT/Picocrypt.git synced 2024-09-20 09:46:43 +00:00

Update v1.12.py

This commit is contained in:
Evan Su 2021-04-01 12:33:17 -04:00 committed by GitHub
parent ac31cdcc89
commit 87f01219fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -565,7 +565,7 @@ promptIconVer.place(x=238,y=226,height=64)
confirmOverwrite = tkinter.Frame(tk) confirmOverwrite = tkinter.Frame(tk)
confirmOverwrite.config(bg="#f5f6f7") confirmOverwrite.config(bg="#f5f6f7")
#confirmOverwrite.pack(expand=1,fill=tkinter.BOTH)
confirmOverwriteString = tkinter.StringVar(tk) confirmOverwriteString = tkinter.StringVar(tk)
confirmOverwriteString.set(strings[13]) confirmOverwriteString.set(strings[13])
confirmOverwriteLabel = tkinter.ttk.Label( confirmOverwriteLabel = tkinter.ttk.Label(
@ -576,6 +576,7 @@ confirmOverwriteLabel.place(x=100,y=150)
confirmOverwriteNo = tkinter.ttk.Button( confirmOverwriteNo = tkinter.ttk.Button(
confirmOverwrite, confirmOverwrite,
text="No", text="No",
cursor="hand2",
command=lambda:confirmOverwrite.pack_forget() command=lambda:confirmOverwrite.pack_forget()
) )
confirmOverwriteNo.place(x=100,y=200) confirmOverwriteNo.place(x=100,y=200)
@ -586,6 +587,7 @@ def overwriteConfirmed():
confirmOverwriteYes = tkinter.ttk.Button( confirmOverwriteYes = tkinter.ttk.Button(
confirmOverwrite, confirmOverwrite,
text="Yes", text="Yes",
cursor="hand2",
command=overwriteConfirmed command=overwriteConfirmed
) )
confirmOverwriteYes.place(x=300,y=200) confirmOverwriteYes.place(x=300,y=200)
@ -960,7 +962,7 @@ def work():
except ReedSolomonError: except ReedSolomonError:
# File is really corrupted # File is really corrupted
if not reedsoloErrors and not shouldKeep: if not reedsoloErrors and not shouldKeep:
statusString.set(strings[8]) statusString.set(strings[4])
fin.close() fin.close()
fout.close() fout.close()
remove(outputFile) remove(outputFile)
@ -1061,12 +1063,12 @@ def work():
print(kept,reedsoloFixed) print(kept,reedsoloFixed)
# Show appropriate notice if file corrupted or modified # Show appropriate notice if file corrupted or modified
if not kept: if not kept:
statusString.set(f"Completed. (Click here to show output)") statusString.set(f"Completed. (Click here to show output)")
# Show Reed-Solomon stats if it fixed corrupted bytes # Show Reed-Solomon stats if it fixed corrupted bytes
if mode=="decrypt" and reedsoloFixed: if mode=="decrypt" and reedsoloFixed:
statusString.set( statusString.set(
f"Completed with {reedsoloFixed}"+ f"Completed with {reedsoloFixed}"+
f" bytes fixed. (Click here to show output)" f" bytes fixed. (Click here to show output)"
) )
else: else:
if kept=="modified": if kept=="modified":
@ -1143,7 +1145,7 @@ def updateStats(total):
if reedsolo and mode=="decrypt" and reedsoloFixed: if reedsolo and mode=="decrypt" and reedsoloFixed:
tmp = "s" if reedsoloFixed!=1 else "" tmp = "s" if reedsoloFixed!=1 else ""
info += f", fixed {reedsoloFixed} corrupted byte{tmp}" info += f", fixed {reedsoloFixed} error{tmp}"
if reedsolo and mode=="decrypt" and reedsoloErrors: if reedsolo and mode=="decrypt" and reedsoloErrors:
info += f", {reedsoloErrors} MB unrecoverable" info += f", {reedsoloErrors} MB unrecoverable"
@ -1320,10 +1322,6 @@ def onClose():
global working global working
if not working: if not working:
tk.destroy() tk.destroy()
else:
force = messagebox.askyesno("Confirmation",cancelNotice)
if force:
tk.destroy()
def prepare(): def prepare():
global rs13,rs128 global rs13,rs128