gitMenv / UEcastoc

This repository is a work-in-progress to create a simple unpack and packing tool of .ucas and .utoc files. If this succeeds, it would make it possible to create mods for games that use the new .ucas and .utoc file format.
GNU General Public License v3.0
85 stars 16 forks source link

Request: LZ4 compression support #16

Open VaudevillianVeteran opened 1 year ago

VaudevillianVeteran commented 1 year ago

Tried the tool with Gotham Knights and while it can list utoc/ucas files, it can't do anything else because the game uses LZ4 compression.

It would have been fantastic if you could add support for this compression type as the latest update pretty much destroyed modding for that game.

gitMenv commented 1 year ago

I'll be adding LZ4 (de)compression soon!

gitMenv commented 1 year ago

@VaudevillianVeteran Hello, I have just added the lz4 compression and decompression to the program in commit a0665bd. Can you please validate if this works? I'll close this issue if you can make it work!

VaudevillianVeteran commented 1 year ago

Thank you, @gitMenv

Tried the manifest with the new version and unfortunately it didn't work - the executable was silently trying to do something for several minutes and then said "EOF" and quit.

Gotham Knights uses one big chunk with pak being 12Gb, ucas 32Gb and utoc 49Mb. Encrypted (the key was for sure provided).

Gorzagorz commented 1 year ago

Hello

I am attaching a cmd log I got when I tried it with the same game in case it's of any help. Also when I try to use unpack or unpackAll on those files I just get a message "...no AES key was provided..." while I did input one. Gotham Knights Manifest Log.txt

peek6 commented 1 year ago

Just saw this thread and realized it's also about Gotham Knights so the issue I just opened ( https://github.com/gitMenv/UEcastoc/issues/17 ) is kind of a duplicate . As I mentioned there, I made a small test mod in UE4.25plus that works in GK and that doesn't have any compression or AES encryption ( IOSTORE_VERSION_chunk101_robin_metal_mask_on_knightwatch_suit.zip or can be grabbed from here https://www.nexusmods.com/gothamknights/mods/278?tab=files&file_id=881 ) ). Unpacking the mod with UECASTOC complains that the TOC isn't supported, but the unpacking operation nevertheless works well. The manifest generation operation crashes, though:

PS D:\games\tools\uecastoc_2023_031_git\UEcastoc\cpp> .\main.exe manifest .\z_chunk101_robin_metal_mask_on_knightwatch_suit_P.utoc .\z_chunk101_robin_metal_mask_on_knightwatch_suit_P.ucas manifest.json
Warning: this is a version of the utoc file format that may not be supported yet
panic: runtime error: index out of range [227290525] with length 149284656

goroutine 17 [running, locked to thread]:
main.(*parseDependencies).extractDependencies(0xc000194180)
        D:/games/tools/uecastoc_2023_031_git/UEcastoc/manifest.go:118 +0x328
main.ParseDependencies({0xc00027a000, 0x33b36, 0x40000})
        D:/games/tools/uecastoc_2023_031_git/UEcastoc/manifest.go:239 +0x5d5
main.(*UTocData).constructManifest(0xc00001f1e0, {0xc00000e580, 0x38})
        D:/games/tools/uecastoc_2023_031_git/UEcastoc/manifest.go:90 +0xe7
main.createManifestFile(0x7ffa20a16e98, 0xc00001a060, 0x0, 0x1)
        D:/games/tools/uecastoc_2023_031_git/UEcastoc/dllAPI.go:137 +0x407