How to repack umap files?

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

How to repack umap files?

Post by Hexaae »

How to repack a directory of extracted .umap files (thanks to "extract.exe") back into umap?
Last edited by Hexaae on Wed Jan 22, 2020 1:06 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to repack into umap files?

Post by aluigi »

You must provide details or the other users will just ignore this useless topic which means absolutely nothing (umap, extract.exe???)
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack into umap files?

Post by Hexaae »

The game is Off-Road Drive, and uses Unreal 3 engine.
Since the Italian tutorial of this game has inverted voice samples I wanted to extract the file "...\Off-Road Drive\PP3WorkGame\CookedPC\Maps\THA\Thai_Karyer_track6_tutorial.umap", swap sample names and repack it back to original .umap format.
I've found extract tool on http://www.gildor.org/downloads and did work fine to extract the files, but I don't know how to repack it.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to repack into umap files?

Post by aluigi »

Can you upload one of these umap files?

As far as I know the UE umap files are the usual 0x9e2a83c1 archives open with gildor's UE Viewer, while that "Unreal Package Extractor" looks a completely different format.

Basically there are 2 ideas: if the format is simple (maybe like the umod one for which I made a tool 13 years ago) I can make a script and you can use the reimport feature of quickbms, or you can just swap the filenames in the archive with a hex editor.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack into umap files?

Post by Hexaae »

aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to repack into umap files?

Post by aluigi »

Yeah it's a 0x9e2a83c1 archive so option 1 is gone.
And I see compressed data there so option 2 is gone too.
Hope someone else can give you some alternative solutions.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack into umap files?

Post by Hexaae »

The only problem is to repack them :(
I can extract the files with Extract tool http://www.gildor.org/downloads but I'm stuck there...
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack into umap files?

Post by Hexaae »

How can I re-assemble everything back into a new umap file once I modified some files?
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: How to repack into umap files?

Post by LokiReborn »

Hexaae wrote:How can I re-assemble everything back into a new umap file once I modified some files?


There isn't really an easy way to do it. Most of the time when people are editing unreal files they will just swap out 1 mesh file for a custom one etc. most of it requires custom development. I only ever really did it for Blade & Soul to replace the Font Packs so I could support other languages and I had to remake the file by hand adjusting offsets etc. In this circumstance there there are so many file the approach you'd really want to take isn't really extracting all of the files and remaking it from scratch but rather reading the file, injecting the file you want to swap out and fixing what needs to be for offsets & sizes. To do something like that though is custom development for a specific game / file I don't think you'll find a generic tool to do it from my experience.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack into umap files?

Post by Hexaae »

Well, the task would be "much simpler" in my specific case: I just need to swap 2 audio file names inside the .umap file.
Maps\THA\Thai_Karyer_track6_tutorial\Tutorial_Sounds\
7.SoundNodeWave -> 11.SoundNodeWave
7_Cue.SoundCue -> 11_Cue.SoundCue
11.SoundNodeWave -> 7.SoundNodeWave
11_Cue.SoundCue -> 7_Cue.SoundCue
Wanted to fix an annoying bug: these file names were inverted in the original game (Italian voice samples for checkpoint 2-3 of the tutorial are swapped).
I was able to extract the entire dir structure and files using Gildor's Unreal Package Extractor from https://www.gildor.org/downloads but have no idea how to repack everthing back into the original file.
Last edited by Hexaae on Wed Jan 22, 2020 9:35 am, edited 1 time in total.
LokiReborn
Posts: 190
Joined: Fri Aug 26, 2016 3:11 pm

Re: How to repack into umap files?

Post by LokiReborn »

Hexaae wrote:Well, the task would be "much simpler" in my specific case: I just need to swap 2 audio file names inside the .umap file.
Maps\THA\Thai_Karyer_track6_tutorial\Tutorial_Sounds\
7.SoundNodeWave -> 11.SoundNodeWave
7_Cue.SoundCue -> 11_Cue.SoundCue
11.SoundNodeWave -> 7.SoundNodeWave
11_Cue.SoundCue -> 7_Cue.SoundCue
Wanted to fix an annoying bug: these file names were inverted in the original game (Italian voice samples for checkpoint 2-3 of the tutorial are swapped).
I was able to extract the entire dir structure and files using Gildor's Unreal Package Extractor from https://www.gildor.org/downloads bat have no idea how to repack everthing back into the original file.


If that's the case I think you're going about it all wrong. You don't need to do anything with the files themselves I think you should be able to just modify the header. If it's like traditional cooked files. More simply put if everything data wise is correct (aka you're not actually modding anything) then think of it like this

Entry 1) File Name, Location 1, length 2
Entry 2) File Name, Location 2, length 2

In this basic example all you need to change here is the locations values for entry 1 & 2 as everything else is identical, it doesn't involve rename the files etc. like I'm guessing you did as the names are in a data table it's just the location of the data you need to swap.

I'm not sure if the headers are encrypted for that (Gildor support it automatically for lot of the games he's done) but I'm guessing if you change 2 offsets & 2 size values you're basically finished.
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: How to repack umap files?

Post by Hexaae »

Interesting...
Unfortunately from an hex-editor I can't see nothing interesting (probably encrypted or compressed?).
I wish there was a tool to edit this index then...
tashmailok
Posts: 7
Joined: Fri Oct 01, 2021 4:01 am

Re: How to repack umap files?

Post by tashmailok »

I've successfully unpacked, modded and repacked a .umap file. I believe it's possible to do the same on .upk, .pak, .u, any unreal engine files.

https://zenhax.com/viewtopic.php?f=9&t=15902