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
Pepita
Posts: 36
Joined: Sun Sep 30, 2018 1:58 pm

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

Post by Pepita »

Can someone check out "Port Royal 4"

Would be nice, if I can import files as well.

It is "FUK" as ending, but it uses a Win64-Shipping.dll so it uses some kind of Unreal Engine for sure?

Uploaded example here:
https://mega.nz/file/PQxl0KyC#byEj7w8we ... R1R5X1Qv5Y
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 »

@Pepita: https://blog.kalypsomedia.com/en/port-royale-4-faq/ -> "What engine does Port Royale 4 use?". You can take a look at this topic, maybe format is still the same.
EOS SDK dll is Epic Online Services library, used by EGS in games from the store (like steam_api.dll in steam games).


@mage200: You can't just open uproject in Unreal Editor, because all assets in pak archive are "cooked" (serialized) and editor doesn't understand them. If you need only models, use umodel.
And what do you mean by decompiling uplugin? This file is plain text config for UE4 plugin, used by the game (like ini file). You can change some options in it, but most of them will be ignored, since plugin's code is being compiled into main game executable (except some third-party libraries) and most of their parameters are hardcoded in the process. At least, I never saw someone using this stuff for mods or anything.
mage200
Posts: 6
Joined: Sat Dec 17, 2016 10:16 am

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

Post by mage200 »

hmm becuse i am using that script and its created a uproject file
so i when i run and disable the plugins , and unreal engine show empty folders
maybe its becuse of the plugins that what i think maybe you know why is that?

well after review the executable i see its unreal engine 4.17.2
however i guess its from the source himself becuse i see this line maybe becuse of that the asset refust to show ?
check the photo please
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 »

@mage200: You're trying to do impossible. Please understand that
spiritovod wrote:You can't just open uproject in Unreal Editor, because all assets in pak archive are "cooked" (serialized) and editor doesn't understand them. If you need only models, use umodel.
Bafteam
Posts: 9
Joined: Thu Oct 05, 2017 1:07 pm

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

Post by Bafteam »

I used this instruction to pack back to the .pak archive

https://gbatemp.net/threads/how-to-unpa ... es.531784/

But I do not understand these actions:

4.2. For Find what: paste
Code:
" offset: (.*)$
Replace with:
Code:
"
Click Replace All

When all my lines look like this:

cove_sequencer.uasset" offset: 0, size: 13248 bytes, sha1: 45D1F87013C099A1B33CADDE00B0D5DD6DA0A889.

I need to replace strings like this

" offset: 0, size: 13248 bytes, sha1: 45D1F87013C099A1B33CADDE00B0D5DD6DA0A889.

on this

"
?
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 »

@Bafteam: If you need to use unrealpak, I suggest more simple solution - like this one. And also read this post, it may help you as well.
Bafteam
Posts: 9
Joined: Thu Oct 05, 2017 1:07 pm

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

Post by Bafteam »

spiritovod wrote:@Bafteam: If you need to use unrealpak, I suggest more simple solution - like this one. And also read this post, it may help you as well.

Thank you, but I figured out the link that I threw off. The problem is different, the game has an archive check, the game gives an archive check error at startup, if you just repack the .pak file back to the obb. You do not know what to rely on in the .so library when searching for verification?
GabrielProudmore
Posts: 13
Joined: Sun Apr 07, 2019 4:42 pm

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

Post by GabrielProudmore »

Question: Is there a way for unpack Movie or CG when they are in the the .pak? I am trying to unpack the Samurai Showdown Intros, because they are movie, not textures as I open and search every archive using the UE Viewer and hadn't not see anything like what the movies in-game look like.
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 »

@GabrielProudmore: umodel doesn't support some assets, usually present in game archives (maps, movies, scripts, localization files and others), that's why you can't see them. Simply extract all assets from paks with quickbms and latest UE4 bms script and you'll find movies around SamuraiShodown\Content\Movies - but only if they're pre-rendered.

@Bafteam: So you're 100% sure that you packed it back correctly, right? Well, it's not an easy question even for pc games. I was planning to dig into that after I'm done with aes keys on android, but here are some thoughts (valid for ue4 games on pc):
1) For almost all games you can't repack base pak, only add modded one, usually with archive version less than used by the game (probably because checksum is being integrated in main binary during compilation). And you should also pay attention, if original game archive has standard format or not.
2) There is such thing as signing. I don't have an idea how it's implemented on android, but on pc it's possible to re-use existing signature, because UE4 only validates signature itself, not the related pak integrity (unless specific check is added manually). Though I can't remember if I even saw signed pak on android.
3) It's worth to check UE4 source code for responsible parts (IPlatformFilePak and SignedArchiveReader) to find out is that error belongs to UE4 core or it's due to additional changes by devs - btw, you can find out where this error is occurring by searching for the string in libUE4.so via IDA or something. If it's from core part, there is high possibility that you've messed up with the pak, since those checks are mostly to prevent a game using incompatible/broken archives.
4) If the error is not from UE4 core, it may belong to side checks (especially on android, since UE4 is present as library there). In that case this check can be anywhere - in main classes, other libraries, etc.

Actually, basic check for this kind of stuff would be simple repacking original assets without modifications. But even before that I would try to create mods instead of repacking the whole archive and check it out.
Bafteam
Posts: 9
Joined: Thu Oct 05, 2017 1:07 pm

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

Post by Bafteam »

spiritovod wrote:@GabrielProudmore: umodel doesn't support some assets, usually present in game archives (maps, movies, scripts, localization files and others), that's why you can't see them. Simply extract all assets from paks with quickbms and latest UE4 bms script and you'll find movies around SamuraiShodown\Content\Movies - but only if they're pre-rendered.

@Bafteam: So you're 100% sure that you packed it back correctly, right?

I repackaged the original .pak file without any changes, took it from the obb and threw it back and the game says that it cannot find the files to download.
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 »

AES keys finder for mobile UE4 games added to the base post: viewtopic.php?f=9&t=1005&p=56251#p56251

Please note that this is just POC (proof of concept) and due to its brute-forcing nature it works much longer than usual finder for pc games (up to 40 minutes). I know that there are more proper and optimized ways to do the same thing out there, but it's out of my league. At least, this solution is user friendly and doesn't involve debugging or third-party software, except JRE.
I'm not going to work on it in near future, except fixing possible critical bugs and adding support for custom paks. Feel free to leave your feedback on rin forums though.
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 »

Specific scripts bundle updated with Dragon Quest XI script (thanks to infogram) and also with the fix for some additionally xored normals from the game (more about the issue in this topic).
You can find the bundle in the base post: viewtopic.php?f=9&t=1005&p=56251#p56251
runa_g7
Posts: 2
Joined: Mon Jul 27, 2020 3:56 am

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

Post by runa_g7 »

Could someone post AES key for this game? https://raymondafcripps.itch.io/feline
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 »

@runa_g7: You can find it in the list now.
runa_g7
Posts: 2
Joined: Mon Jul 27, 2020 3:56 am

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

Post by runa_g7 »

@spiritovod Thanks!
zeaofsuos
Posts: 104
Joined: Sun Jan 13, 2019 11:45 pm

ADMIN, DELETE.

Post by zeaofsuos »

ADMIN, DELETE.
Last edited by zeaofsuos on Thu Apr 15, 2021 10:34 am, edited 1 time in total.
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 »

@zeaofsuos: Game archives are not encrypted. If you're looking for passcode, the default one is fine (xiB6LnPxcxIDl2CrCJC7eBnZ1wQXvjNm), though it works only on the base game and some early patches.
zeaofsuos
Posts: 104
Joined: Sun Jan 13, 2019 11:45 pm

ADMIN, DELETE.

Post by zeaofsuos »

ADMIN, DELETE.
Last edited by zeaofsuos on Thu Apr 15, 2021 10:35 am, edited 1 time in total.
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 »

@zeaofsuos: That's strange. Last time I've checked the game all was fine by default. Try latest UE4 bms script from my signature, if it will not work, use filecutter script on any pak and upload resulting files here.
zeaofsuos
Posts: 104
Joined: Sun Jan 13, 2019 11:45 pm

ADMIN, DELETE.

Post by zeaofsuos »

ADMIN, DELETE.
Last edited by zeaofsuos on Thu Apr 15, 2021 10:35 am, edited 1 time in total.