From da3614fe3fd0c976d7e9961bc0f85f48a9fc47c7 Mon Sep 17 00:00:00 2001 From: Silica Date: Fri, 12 Jan 2018 01:50:20 +1300 Subject: [PATCH] Add files via upload --- gui.py | 22 ++++++++++++++++++++++ mvDecryptor.py | 6 +++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 gui.py diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..81a0b3c --- /dev/null +++ b/gui.py @@ -0,0 +1,22 @@ +import Tkinter # Imports the "Tkinter" library +import tkFileDialog # Imports the "tkFileDialog" library +import tkMessageBox # Imports the "tkMessageBox" library +import os # Imports the "os" library +import mvDecryptor # Imports "mvDecryptor.py" + +window = Tkinter.Tk() # Create tkinter object +window.wm_withdraw() # Hide blank "tk" window + +tkMessageBox.showinfo(title="INFORMATION",message="Please select the game directory.\n(The one that contains the main executable)") # Display a message on screen explaining what directory they need to choose. +dir = tkFileDialog.askdirectory(title="Select Game DIR") # Show a directory selection screen + +if dir == (): # If they click cancel + os._exit(0) # Exit the program + +if os.path.exists(dir+"/www/data/System.json"): # If they click OK, check if System.json exists. + mvDecryptor.decryptEntireGame(dir) # If so, decrypt the game. + tkMessageBox.showinfo(title="INFORMATION",message="DONE!\nGame has been decrypted.\nAnd an editable file has been created.") # Now show a message saying its done. +else: # If it is not found + tkMessageBox.showerror(title="ERROR",message="Could not find System.json.\nDid you select the correct directory?") #Display an error message +window.destroy() # Destroy tkinter object +os._exit(0) # Exit the application (avoids memory leaks) diff --git a/mvDecryptor.py b/mvDecryptor.py index df24b47..c747ad4 100644 --- a/mvDecryptor.py +++ b/mvDecryptor.py @@ -4,11 +4,11 @@ # # -import binascii #Imports the "binascii" library -import os #Imports the "OS" library +import binascii # Imports the "binascii" library +import os # Imports the "OS" library -def xor(data, key): #XOR Encryption / Decryption Algorythm +def xor(data, key): # XOR Encryption / Decryption Algorithm l = len(key) # Sets l to length of key. return bytearray(((data[i] ^ key[i % l]) for i in range(0,len(data)))) # Do complex MATH stuff and convert the result to a bytearray.