Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError When trying to run full_extract.py #9

Open
pokemontest1234 opened this issue Nov 16, 2022 · 2 comments
Open

OSError When trying to run full_extract.py #9

pokemontest1234 opened this issue Nov 16, 2022 · 2 comments

Comments

@pokemontest1234
Copy link

pokemontest1234 commented Nov 16, 2022

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_x64__qbz5n2kfra8p0\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_x64__qbz5n2kfra8p0\lib\ctypes_init
.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden

@FullLifeGames
Copy link
Collaborator

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

@m4-used-rollout
Copy link

m4-used-rollout commented Nov 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants