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.check_issue( os.path.getsize(self.hack_dir / 'game' / 'game.psvimg') > 1000000, "Hack Too Small") 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." )
def setup_dirs(self): base_dir = Path(os.getcwd()) if Utils.check_issue(os.access(Utils.get_home() / 'Desktop', os.W_OK), "No Working Dir Permissions", False): base_dir = Utils.get_home() / 'Desktop' else: Utils.check_issue(os.access(base_dir, os.W_OK), "No Working Dir Permissions") self.working_dir = Utils.make_dir(base_dir / f"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 read_config(self): try: username = None account = None if platform.system() == "Windows": self.apps_path = 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') elif platform.system() == "Linux": self.apps_path = Path(Utils.read_conf('appsPath')) / 'PGAME' account = Utils.read_conf('lastAccountId') username = Utils.read_conf('lastOnlineId') elif platform.system() == "Darwin": self.apps_path = Path(Utils.read_plist('appsPath')) / 'PGAME' account = Utils.read_plist('lastAccountId') username = Utils.read_plist('lastOnlineId') Utils.check_issue(os.path.exists(self.apps_path), "Apps Path Does Not Exist") if username and account: self.user.set_id(account) self.user.set_name(username) self.user.set_path(self.apps_path) while os.path.exists(self.apps_path / account / '_TEMP'): print( '_TEMP folder found alongside game backups. QCMA appears to be backing up a game. We will' ) print( 'wait until this operation completes. Trying again in 15 seconds...' ) sleep(15) except FileNotFoundError: sys.exit("QCMA Settings Missing")