Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
mositive
Posts: 2
Joined: Wed Jul 06, 2022 5:39 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by mositive »

Hello everyone, today i learned using bms and ueviewer. But i have a problem with loading uasset files. My umodel cannot open 3D models. Can anyone help me? Thanks in advance... Here's the screenshot of it:
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@mositive: This topic is for quickbms scripts, so if you have questions about other tools, please address them to respective places. For example, there is a solution for this game in the game topic at gildor's forum.
mositive
Posts: 2
Joined: Wed Jul 06, 2022 5:39 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by mositive »

spiritovod wrote:@mositive: This topic is for quickbms scripts, so if you have questions about other tools, please address them to respective places. For example, there is a solution for this game in the game topic at gildor's forum.


Thanks brother. Sorry again for disturbing you.
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by michalss »

Can anyone check stray game pls ?
michalss
Posts: 320
Joined: Sun Aug 10, 2014 12:49 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by michalss »

In Stay game is used compression method Oodle: https://docs.unrealengine.com/4.27/en-U ... tion/Oodle . - do you have any idea please ? I never seen this before...

Never mind i got it extracted..
Sruffy
Posts: 11
Joined: Wed Jun 15, 2022 4:27 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by Sruffy »

Hi there, I use latest version of Quick BMS along with a script for unpacking .pak files. I have attached the script as reference and below is the error that occurs while unpacking some of .pak files:

Can someone please help fixing this?
Last edited by Sruffy on Sun Jul 31, 2022 10:55 pm, edited 1 time in total.
DewiMorgan
Posts: 1
Joined: Thu Jul 21, 2022 2:56 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by DewiMorgan »

michalss wrote:Never mind i got it extracted..

How?
(https://imgs.xkcd.com/comics/wisdom_of_the_ancients.png)
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@Sruffy: Provide the package you have problems with. Though I will not be able to check it until I get home next week.

@DewiMorgan: Even though I can't check it by myself at the moment, people are reporting that the game is using default format for respective engine version, which means 4.27 script from my signature or any compatible tool (like umodel/fmodel) should work with the game without additional steps.
Sruffy
Posts: 11
Joined: Wed Jun 15, 2022 4:27 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by Sruffy »

spiritovod wrote:@Sruffy: Provide the package you have problems with. Though I will not be able to check it until I get home next week.

@DewiMorgan: Even though I can't check it by myself at the moment, people are reporting that the game is using default format for respective engine version, which means 4.27 script from my signature or any compatible tool (like umodel/fmodel) should work with the game without additional steps.


Heres the link to the pak file:
Last edited by Sruffy on Tue Jul 26, 2022 1:17 pm, edited 1 time in total.
Sruffy
Posts: 11
Joined: Wed Jun 15, 2022 4:27 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by Sruffy »

spiritovod wrote:@Sruffy: Provide the package you have problems with. Though I will not be able to check it until I get home next week.

@DewiMorgan: Even though I can't check it by myself at the moment, people are reporting that the game is using default format for respective engine version, which means 4.27 script from my signature or any compatible tool (like umodel/fmodel) should work with the game without additional steps.


Apologies for the ping, wanted to check if you managed to download the file and have a look at it? Its completely fine if you havent, I can wait for sure.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@Sruffy: This looks like self-invented obfuscation from modders - first entry is corrupted on purpose, so the game will simply skip it, but most tools would be troubled while trying to extract it. You can use attached script or any common tools without batch extracting (both umodel and fmodel can process valid entries separately without any issue).

Update: Updated script now extract everything, including invalid data (which obviously can't be used).
Last edited by spiritovod on Wed Jul 27, 2022 10:04 am, edited 2 times in total.
Sruffy
Posts: 11
Joined: Wed Jun 15, 2022 4:27 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by Sruffy »

spiritovod wrote:@Sruffy: This looks like self-invented obfuscation from modders - first entry is corrupted on purpose, so the game will simply skip it, but most tools would be troubled while trying to extract it. You can use attached script or any common tools without batch extracting (both umodel and fmodel can process valid entries separately without any issue).


Thank you so very much for this, it actually worked. Would you mind sharing how could I achieve such kind of encryption while packing my pak files.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@Sruffy: It's out of scope of this topic. Besides, the same scheme may not work correctly in some cases and in different games.
ardvent
Posts: 10
Joined: Wed Oct 25, 2017 3:22 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by ardvent »

I am working on trying to extract Multiversus, I found the AES key and can view the models in UModel, but I'm looking for the config files, subtitles, etc.

Using the QuickBMS unreal_tournament_4_0.4.27c_paks_only.bms script I get the following error:

Code: Select all

Error: the requested amount of bytes to allocate is negative (0xfcf29114)

Last script line before the error or that produced the error:
  285 getdstring BASE_PATH NAMESZ TOC_FILE5
  coverage file 0     0%   25817486   4078076790 . offset 00000000
  coverage file -5    0%   4          25817376   . offset 00000004


AES Key: 0x419DFFC484F1CED86842DD4E6DD914F02E3E119725F556C4B9AA44432021A9AC

Smallest PAK attached
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@ardvent: All works fine here with the provided package. Make sure you didn't accidentally corrupted the script (for example, by trying to embed key in a wrong way) or package itself.
ardvent
Posts: 10
Joined: Wed Oct 25, 2017 3:22 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by ardvent »

spiritovod wrote:@ardvent: All works fine here with the provided package. Make sure you didn't accidentally corrupted the script (for example, by trying to embed key in a wrong way) or package itself.


Yeah, I think the issue is that I embedded the key wrong, what's the syntax for this?

Code: Select all

# set your AES_KEY here as text or C string ("\x11\x22...") or umodel hex (0x1122...)
set AES_KEY binary "0x419DFFC484F1CED86842DD4E6DD914F02E3E119725F556C4B9AA44432021A9AC"
putarray 10 -1 ""
math AES_KEY_IS_SET = 1


Edit: Additionally I can list the files, but trying to extract them or write the list to a text file freezes quickbms and nothing happens.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@ardvent: Actually this thing should be adjusted a long time ago. Please try updated script, embedding keys is now supported in more convenient way.

-------------------------------------------------------------------------------------------------

Base 4.25 and 4.27 scripts are updated, they can now handle embedded keys set via [set AES_KEY binary ""] option in both common hex (0xAABB...) and C string (\xAA\xBB...) forms - previously only C string representation worked correctly. Note that from now on you don't need to change other option (AES_KEY_IS_SET), it will be handled automatically.

Most scripts from specific scripts bundle will be updated in the same way in a few days.
Sruffy
Posts: 11
Joined: Wed Jun 15, 2022 4:27 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by Sruffy »

spiritovod wrote:@Sruffy: It's out of scope of this topic. Besides, the same scheme may not work correctly in some cases and in different games.


Firstly, thank you for all your help. I wanted to bring in your notice that the script you provided works pretty well for some pak files but there are some which still gives the same error. Can there be a generic script which would work for all such pak files?
Last edited by Sruffy on Sun Jul 31, 2022 10:53 pm, edited 1 time in total.
JackDev
Posts: 39
Joined: Tue Dec 26, 2017 6:36 am

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by JackDev »

Hello everyone, I found a new Nexon game called Argent Twilight, requires AES KEY, thanks!
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Unreal Engine 4 pak-file Unpacker / unreal_tournament_4.bms [UE4 global topic]

Post by spiritovod »

@Sruffy: I don't want to bother with it much, so I've updated the script in the post above to extract everything from such packages, including invalid data. Different people are using different obfuscations, which can't be properly combined in one script. It's up to you to find out invalid data among extracted assets.

@JackDev: Those requests belongs to the separate topic from my signature.