psthrn42 / SCVI_Extract

19 stars 6 forks source link

OSError When trying to run full_extract.py #9

Open pokemontest1234 opened 1 year ago

pokemontest1234 commented 1 year ago

Game: pokemon scarlet version: 1.0.1 When I run full_extract.py it will extract from the files and then fail when trying to extract the trpak files IT says it couldnt find a module if I am missing one could u tell me which one? Full report(Without the extracting pf the trpfs and trpfd): Extraction complete! Parsing output\arc\ymap.trpak Traceback (most recent call last): File ".\full_extract.py", line 130, in ParseFlatbuffer(output_dir) File ".\full_extract.py", line 117, in ParseFlatbuffer decompressed_data = OodleDecompress(bytes(compressed_data), data_size, data["files"][i]["decompressed_size"]) File ".\full_extract.py", line 89, in OodleDecompress handle = cdll.LoadLibrary(filename) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\ctypes__init__.py", line 442, in LoadLibrary return self._dlltype(name) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\ctypes__init.py", line 364, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden

FullLifeGames commented 1 year ago

Make sure that you have the oo2core_6_win64.dll file present, as is stated in the README

m4-used-rollout commented 1 year ago

I had the same issue. It looked like Python was having trouble loading the DLL via a relative path. I added a call to os.path.realpath to the top of the loop in OodleDecompress:

def OodleDecompress(raw_bytes, size, output_size):
    for filename in glob.glob(os.path.join(tool_dir, "oo2core*.dll")):
        filename = os.path.realpath(filename)
        handle = cdll.LoadLibrary(filename)
        output = create_string_buffer(output_size)
        output_bytes = handle.OodleLZ_Decompress(c_char_p(raw_bytes), size, output, output_size, 0, 0, 0, None, None, None, None, None, None, 3)
        return output.raw

And now it seems to be working.