# Below is the code of rpaExtract GPLv3.0 licensed. It was converted to an exe using pyinstaller with python 3.8 print("rpaExtract v5, using unrpa by Lattyware licensed under GPLv3.0, see readme for details and code") import sys,os,colorama from unrpa import UnRPA from unrpa.versions import official_rpa from typing import BinaryIO, Tuple, Optional, Type #hack from unrpa.versions.version import HeaderBasedVersion # hack from colorama import init as colorama_init from colorama import Fore, Back, Style colorama_init() class WHATEVER(HeaderBasedVersion): #hack name = "WHATEVER" header = b"WHATEVER" def find_offset_and_key(self, archive: BinaryIO) -> Tuple[int, Optional[int]]: line = archive.readline() offset = int(line[8:24], 16) key = int(line[25:33], 16) return offset, key if len(sys.argv) == 1: print('') print("You have to drag-and-drop one or more .rpa file(s) on the file for it to work") print('') for file in sys.argv[1:]: try: base = os.path.basename(file) path = os.path.dirname(file) print(Back.BLUE + Fore.WHITE + 'rpaExtract extracting to ' + path + Style.RESET_ALL) print(base + ' STARTING...') rpaExtract = UnRPA(filename=file,path=path, continue_on_error=True, verbosity=2) rpaExtract.extract_files() print(Back.GREEN + Fore.WHITE + base + ' DONE' + Style.RESET_ALL) except Exception as e: print(Back.RED + Fore.WHITE + 'something weird happened, here is the error (hopefully):' + Style.RESET_ALL) print(e) print(Back.RED + Fore.WHITE + 'Forcing RPA-3.0' + Style.RESET_ALL) try: print('') print(Back.BLUE + Fore.WHITE + 'rpaExtract extracting to ' + path + Style.RESET_ALL) print(base + ' STARTING...') rpaExtract = UnRPA(filename=file,path=path,version=official_rpa.RPA3, verbosity=2) rpaExtract.extract_files() print(Back.GREEN + Fore.WHITE + base + ' DONE' + Style.RESET_ALL) except Exception as e: print(Back.RED + Fore.WHITE + 'something weird happened, here is the error (hopefully):' + Style.RESET_ALL) print(e) print(Back.RED + Fore.WHITE + '*REALLY* Forcing RPA-3.0' + Style.RESET_ALL) try: print('') print(Back.BLUE + Fore.WHITE + 'rpaExtract extracting to ' + path + Style.RESET_ALL) print(base + ' STARTING...') rpaExtract = UnRPA(filename=file,path=path,version=WHATEVER, verbosity=2) rpaExtract.extract_files() print(Back.GREEN + Fore.WHITE + base + ' DONE' + Style.RESET_ALL) except Exception as e: print(Back.RED + Fore.WHITE + 'something weird happened, here is the error (hopefully):' + Style.RESET_ALL) print(e) print('First, try moving all of this to C:\\rpaExtract\\ or a similarly simple path and try there again') print('If that still does not work, tell iwanPlays what the error was and what game you were trying to extract') print('') os.system('pause')