-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
257 additions
and
107 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,73 @@ | ||
import sys | ||
import shutil | ||
import Utils | ||
from User import User | ||
from Game import Game | ||
|
||
try: | ||
apps_path = Utils.read_hkcu(r"Software\codestation\qcma", 'appsPath') + '/PGAME' | ||
account = Utils.read_hkcu(r"Software\codestation\qcma", 'lastAccountId') | ||
username = Utils.read_hkcu(r"Software\codestation\qcma", 'lastOnlineId') | ||
user = User() | ||
game = Game() | ||
|
||
if username and account: | ||
user.set_id(account) | ||
user.set_name(username) | ||
user.set_path(apps_path) | ||
game = user.games[0] | ||
|
||
if input(f"{game.title} ({game.id}) found for {user.name} ({user.id}). Continue? (yes/no): ")[0] != "y": | ||
sys.exit("Aborted by User") | ||
|
||
working_dir = Utils.make_dir(f"{Utils.get_home()}/Desktop/FinTrinity{Utils.get_timestamp()}") | ||
hack_dir = Utils.make_dir(working_dir / f"{game.id}.hacked") | ||
decrypt_dir = working_dir / f"{game.id}.decrypted" | ||
backup_dir = working_dir / f"{game.id}.backup" | ||
print(f"Created Working Directory: {working_dir}") | ||
|
||
# Backup Game | ||
shutil.copytree(game.path, backup_dir) | ||
shutil.copytree(game.path, decrypt_dir) | ||
|
||
# Download Dependencies | ||
print(f"Downloading and Extracting Dependencies") | ||
Utils.download('https://github.com/TheOfficialFloW/Trinity/releases/download/v1.0/PBOOT.PBP', working_dir) | ||
Utils.download('https://github.com/yifanlu/psvimgtools/releases/download/v0.1/psvimgtools-0.1-win64.zip', | ||
working_dir) | ||
Utils.extract(f'{working_dir}/psvimgtools-0.1-win64.zip', decrypt_dir) | ||
|
||
# Hack | ||
print(f"Applying Trinity Hack:\n\n\n") | ||
Utils.decrypt_game(user.decrypt_key, decrypt_dir, working_dir / "PBOOT.PBP", game.id) | ||
Utils.encrypt_game(user.decrypt_key, decrypt_dir, hack_dir) | ||
Utils.replace_folder(hack_dir, game.path) | ||
|
||
print(f"\n\n\nTrinity Applied. Please refresh your QCMA database and transfer your game back to your Vita.") | ||
except SystemExit: | ||
pass | ||
finally: | ||
input("[PRESS ENTER TO CLOSE]") | ||
from classes import Utils | ||
from classes.User import User | ||
from classes.Game import Game | ||
|
||
|
||
class FinTrinity: | ||
def __init__(self): | ||
self.apps_path = "" | ||
self.working_dir = "" | ||
self.hack_dir = "" | ||
self.decrypt_dir = "" | ||
self.backup_dir = "" | ||
self.user = User() | ||
self.game = Game() | ||
|
||
def read_registry(self): | ||
self.apps_path = Utils.read_hkcu(r"Software\codestation\qcma", 'appsPath') + '/PGAME' | ||
account = Utils.read_hkcu(r"Software\codestation\qcma", 'lastAccountId') | ||
username = Utils.read_hkcu(r"Software\codestation\qcma", 'lastOnlineId') | ||
|
||
if username and account: | ||
self.user.set_id(account) | ||
self.user.set_name(username) | ||
self.user.set_path(self.apps_path) | ||
self.game = self.user.games[0] | ||
|
||
def confirm_find(self): | ||
ans = input( | ||
f"{self.game.title} ({self.game.id}) found for {self.user.name} ({self.user.id}). Continue? (yes/no): ") | ||
if ans[0] != "y" and ans[0] != "Y": | ||
sys.exit("Aborted by User") | ||
|
||
def setup_dirs(self): | ||
self.working_dir = Utils.make_dir(f"{Utils.get_home()}/Desktop/FinTrinity{Utils.get_timestamp()}") | ||
self.hack_dir = Utils.make_dir(self.working_dir / f"{self.game.id}.hacked") | ||
self.decrypt_dir = self.working_dir / f"{self.game.id}.decrypted" | ||
self.backup_dir = self.working_dir / f"{self.game.id}.backup" | ||
print(f"Created Working Directory: {self.working_dir}") | ||
|
||
def backup_game(self): | ||
shutil.copytree(self.game.path, self.backup_dir) | ||
shutil.copytree(self.game.path, self.decrypt_dir) | ||
|
||
def download_dependencies(self): | ||
print(f"Downloading and Extracting Dependencies") | ||
Utils.download('https://github.com/TheOfficialFloW/Trinity/releases/download/v1.0/PBOOT.PBP', self.working_dir) | ||
Utils.download('https://github.com/yifanlu/psvimgtools/releases/download/v0.1/psvimgtools-0.1-win64.zip', | ||
self.working_dir) | ||
Utils.extract(f'{self.working_dir}/psvimgtools-0.1-win64.zip', self.decrypt_dir) | ||
|
||
def hack(self): | ||
print(f"Applying Trinity Hack:\n\n\n") | ||
Utils.decrypt_game(self.user.decrypt_key, self.decrypt_dir, self.working_dir / "PBOOT.PBP", self.game.id) | ||
Utils.encrypt_game(self.user.decrypt_key, self.decrypt_dir, self.hack_dir) | ||
Utils.replace_folder(self.hack_dir, self.game.path) | ||
print(f"\n\n\nTrinity Applied. Please refresh your QCMA database and transfer your game back to your Vita.") | ||
|
||
|
||
if __name__ == "__main__": | ||
try: | ||
fin = FinTrinity() | ||
fin.read_registry() | ||
fin.confirm_find() | ||
fin.setup_dirs() | ||
fin.backup_game() | ||
fin.download_dependencies() | ||
fin.hack() | ||
except SystemExit: | ||
pass | ||
finally: | ||
input("[PRESS ENTER TO CLOSE]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from tkinter import * | ||
from FinTrinity import FinTrinity | ||
from time import sleep | ||
|
||
class GUI: | ||
def __init__(self): | ||
self.fin = FinTrinity() | ||
self.fin.read_registry() | ||
|
||
self.window = Tk() | ||
self.window.title("FinTrinity") | ||
self.window.minsize(250, 0) | ||
|
||
lbl_info = Label(self.window, text="I was able to find this game!\nPlease confirm it is correct.") | ||
lbl_info.pack(pady=10) | ||
|
||
lbl_username = Label(self.window, text=f"{self.fin.user.name} ({self.fin.user.id})") | ||
lbl_username.pack() | ||
|
||
lbl_game = Label(self.window, text=f"{self.fin.game.title} ({self.fin.game.id})") | ||
lbl_game.pack() | ||
|
||
canvas_game = Canvas(self.window, width=144, height=80) | ||
canvas_game.pack() | ||
img = PhotoImage(file=self.fin.game.image) | ||
canvas_game.create_image(0, 0, anchor=NW, image=img) | ||
|
||
self.txt_btn_confirm = StringVar() | ||
self.txt_btn_confirm.set("Confirm") | ||
|
||
btn_confirm = Button(self.window, textvariable=self.txt_btn_confirm, command=self.click_confirm) | ||
btn_confirm.pack(pady=10) | ||
|
||
self.window.mainloop() | ||
|
||
def click_confirm(self): | ||
if self.txt_btn_confirm.get() == "Confirm": | ||
self.txt_btn_confirm.set("Patching...") | ||
self.window.update() | ||
self.fin.setup_dirs() | ||
self.fin.backup_game() | ||
self.fin.download_dependencies() | ||
self.fin.hack() | ||
self.txt_btn_confirm.set("Finished!") | ||
lbl_refresh = Label(self.window, text="Please refresh your QCMA database!") | ||
lbl_refresh.pack(pady=10) | ||
|
||
|
||
gui = GUI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file renamed
BIN
+1.1 KB
__pycache__/Game.cpython-37.pyc → classes/__pycache__/Game.cpython-37.pyc
Binary file not shown.
Binary file renamed
BIN
+1.81 KB
__pycache__/User.cpython-37.pyc → classes/__pycache__/User.cpython-37.pyc
Binary file not shown.
Binary file renamed
BIN
+2.36 KB
__pycache__/utils.cpython-37.pyc → classes/__pycache__/Utils.cpython-37.pyc
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.