Add files via upload

This commit is contained in:
Silica 2018-01-12 01:50:20 +13:00 committed by GitHub
parent 2e027e42a6
commit da3614fe3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 3 deletions

22
gui.py Normal file
View File

@ -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)

View File

@ -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.