jonsth131 / ggtool

Tools for ggpack files used in Return to Monkey Island
MIT License
10 stars 0 forks source link

Key extraction on macOS #1

Closed legendofmi closed 2 years ago

legendofmi commented 2 years ago

Would this also work with macOS version? Or it’s only fir Windows?

r1sc commented 2 years ago

I dont' know, I don't own the mac-version so I can't test it. But the code searches for a byte-pattern so chances are it will work on mac binaries as well. Try it and report back.

legendofmi commented 2 years ago

I will give it a go! Thanks for the reply!

legendofmi commented 2 years ago

It seems it worked, so far I managed to extract the keys and the list of the files inside the ggpack.

I was having some issues extracting the keys until I realised I had to create the "keys" folder otherwise, it would not extract them.

legendofmi commented 2 years ago

Extraction is working on macOS. I was able to extract the files, but the ".ktxbz" files are not being converted to PNG when I extract them, even though I used "decompress_ktx" to build the ggtool.

r1sc commented 2 years ago

Did you get an error or what happened? It should spit out both the ktx and a png

legendofmi commented 2 years ago

I got the following error and the ktxbz file got extracted:

Extracting Locksmith1-hd.ktxbz. Size = 11416, offset = 1088884480
Inflating...
Decompressing BPTC texture...
thread 'main' panicked at 'Contexts must be destroyed explicitly with `destroy_context`!', /Users/myusername/.cargo/registry/src/github.com-1ecc6299db9ec823/surfman-0.4.3/src/platform/macos/cgl/context.rs:95:13

There are other files that aren't getting extracted:

Extracting MonkeyHead2-hd.ktxbz. Size = 9530480, offset = 1006135040
Inflating...
thread 'main' panicked at 'Failed to inflate compressed data: "unknown ZLIB method CM=0x0"', libdinky/src/ggpack.rs:136:52
r1sc commented 2 years ago

I got the following error and the ktxbz file got extracted:

Extracting Locksmith1-hd.ktxbz. Size = 11416, offset = 1088884480
Inflating...
Decompressing BPTC texture...
thread 'main' panicked at 'Contexts must be destroyed explicitly with `destroy_context`!', /Users/myusername/.cargo/registry/src/github.com-1ecc6299db9ec823/surfman-0.4.3/src/platform/macos/cgl/context.rs:95:13

There are other files that aren't getting extracted:

Extracting MonkeyHead2-hd.ktxbz. Size = 9530480, offset = 1006135040
Inflating...
thread 'main' panicked at 'Failed to inflate compressed data: "unknown ZLIB method CM=0x0"', libdinky/src/ggpack.rs:136:52

Would you like to create two separate issues with these problem, so we can track and fix them?

For housekeeping I'll close this issue since the key extraction seems to be resolved on macOS binaries.

Thanks for your help testing this out!