Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 31-10-2022, 11:38
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,016 Times in 2,658 Posts
KaktoR is on a distinguished road
How to patch languages out of game files (xtool erase decode)

Introduction
Sometimes you have game archives which contains all the language files, but you don't need all of them. I will tell you what to do, what you need and giving you a example.

Side Notes
There is already another topic from Masquerade. He teached you how to cut language files out of UE4 game archives using SFK and such. Here is a different way.

What do you need?
How to? (UE4)
I will start with the game "The Dark Pictures Anthology Man of Medan", which is a UE4 game with some pak files. Language files are found in "pakchunk1-WindowsNoEditor.pak".
  1. First make a "testing/temporary folder" somewhere outside of the game folder
  2. In this folder you have to copy all files you need, like xtool.exe, quickbms_4gb_files.exe, bms script and the target pak file
  3. In this folder unpack the pak file. You can use this batch code to do it:
    Code:
    for %%f in (*.pak) do quickbms_4gb_files -d -o -Y unreal_tournament_4.bms "%%f"
    The output in this case is a folder called "pakchunk1-WindowsNoEditor.pak_extract"

Now comes the xtool part (erase command)
Make another batch code for xtool, like this:
Code:
xtool erase "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\de" "pakchunk1-WindowsNoEditor.pak" dpamom.xtl
xtool erase "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\es" "pakchunk1-WindowsNoEditor.pak" dpamom.xtl
xtool erase "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\fr" "pakchunk1-WindowsNoEditor.pak" dpamom.xtl
xtool erase "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\it" "pakchunk1-WindowsNoEditor.pak" dpamom.xtl
xtool erase "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\ru" "pakchunk1-WindowsNoEditor.pak" dpamom.xtl
What it is doing exactly?
Xtool's erase command is nulling all files in "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\XX " folder and replace this nulled files with original data inside the pak file.

The "dpamom.xtl" file is optional and may be neccessary for later uses, if you want to restore the original files into the modified pak file again. The file is named after the game name in short (you can name this file like whatever you want to). XTool is storing original file informations like file positions/offsets and such in this xtl file.

I will tell you later how to restore the original files back to modified pak file.

Ok I've done this, but modified pak file is the same size as original pak file? What's wrong?
Nothing is wrong. The nulled files have replaced the original files inside the pak file. You can open the modified pak file with a hex editor, for example HxD and you will see that most of the file is replaced with "00" or "." (dots).

Same goes to the extracted files. Here is a example from "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\de \Audio\ExternalSourceBanks\Scene\alexpath\alexpath .uasset" file.


Both files have the exact same size, but the file contents are clearly different (and also the checksum of course). In terms of compression, nulled parts of the pak file will have a ratio nearly zero (0%).

What now? Can I repack?
Yes. Replace modified pak file with original pak file but make a backup of the original pak file first, just to be sure.

I want to restore original files back into modified pak file. What to do?
For this you need
  • "dpamom.xtl" file which was created before
  • Original (not nulled) extracted files
  • Modified pak file

Take original pak file and extract it again in some other folder.
Copy extracted original (not nulled) files into the directory which contains modified pak file and xtool.exe and use the following code to restore:
Code:
xtool decode dpamom.xtl "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\de" "pakchunk1-WindowsNoEditor.pak"
xtool decode dpamom.xtl "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\es" "pakchunk1-WindowsNoEditor.pak"
xtool decode dpamom.xtl "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\fr" "pakchunk1-WindowsNoEditor.pak"
xtool decode dpamom.xtl "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\it" "pakchunk1-WindowsNoEditor.pak"
xtool decode dpamom.xtl "pakchunk1-WindowsNoEditor.pak_extract\SMG019\Content\L10N\ru" "pakchunk1-WindowsNoEditor.pak"
Take note that the checksum of the file may differ from original (untouched) file. In this case you could make a diff file to patch the file back to original checksum (you can use hdiffz/hpatchz for example). This was the case for this game "The Dark Pictures Anthology Man of Medan", but I have played it with modified (nulled) pak file and it works normally.

Another example
Now I will give you another example, namely "A Plague Tale Requiem", which won't need any file patching afterwards (if you want to restore original files back).

Voice files are stored in "SOUNDBANKS\VO_MEDIA.PC.PCK".
Copy this file into testing/temporary folder, including xtool.exe, quickbms_4gb_files.exe and wwise.bms script.
Use the following code to extract the file
Code:
for %%f in (*.pck) do quickbms_4gb_files -d -o -Y wwise.bms "%%f"
Extracted files are stored in "VO_MEDIA.PC.PCK_extract" folder.

The following code erases all files except english
Code:
XTool erase "VO_MEDIA.PC.PCK_extract\chinese(simplified)" "VO_MEDIA.PC.PCK" aptr.xtl
XTool erase "VO_MEDIA.PC.PCK_extract\french(france)" "VO_MEDIA.PC.PCK" aptr.xtl
XTool erase "VO_MEDIA.PC.PCK_extract\german" "VO_MEDIA.PC.PCK" aptr.xtl
XTool erase "VO_MEDIA.PC.PCK_extract\spanish(spain)" "VO_MEDIA.PC.PCK" aptr.xtl
Unlike in the previous UE4 example, xtool is not nulling the extracted files here, but is nulling them directly in the PCK file (god knows why, maybe the engine file structure takes effect here), therefore you don't need to extract original PCK file again to get original extracted files to restore.

To restore original files back to modified PCK file, you can use this code
Code:
xtool decode aptr.xtl "VO_MEDIA.PC.PCK_extract\chinese(simplified)" "VO_MEDIA.PC.PCK"
xtool decode aptr.xtl "VO_MEDIA.PC.PCK_extract\french(france)" "VO_MEDIA.PC.PCK"
xtool decode aptr.xtl "VO_MEDIA.PC.PCK_extract\german" "VO_MEDIA.PC.PCK"
xtool decode aptr.xtl "VO_MEDIA.PC.PCK_extract\spanish(spain)" "VO_MEDIA.PC.PCK"
In this example you can use WemTool on the extracted files to compress them better, for example if you want to give the choice to install languages in your repack (of course you have to include the extracted files in your repack too, inclusive the xtl file).



I did the same with "A Plague Tale Innocence", ripping all languages except german, played the game twice without any errors.

However I would suggest (or strongly recommend) to this stuff if the game is fully patched out. If there are patched to come, these patches updates modified file, you have f*cked up if you don't have the original files anymore, which leads to redownloading original files first.
__________________
Haters gonna hate
Reply With Quote
The Following 14 Users Say Thank You to KaktoR For This Useful Post:
Cesar82 (31-10-2022), dixen (31-10-2022), fabrieunko (01-11-2022), Gehrman (01-11-2022), Guravkov2010 (31-10-2022), kuyhaa (31-10-2022), L0v3craft (02-11-2022), Masquerade (31-10-2022), mausschieber (31-10-2022), Razor12911 (01-11-2022), sakila(playboy) (01-11-2022), ScarAce1989 (31-10-2022), shazzla (31-10-2022), Wanterlude (31-10-2022)
Sponsored Links
  #2  
Old 01-11-2022, 00:38
Guravkov2010 Guravkov2010 is offline
Registered User
 
Join Date: Apr 2021
Location: Somewhere very Far Away
Posts: 4
Thanks: 12
Thanked 0 Times in 0 Posts
Guravkov2010 is on a distinguished road
Hello Tell me how to deal with encrypted files PAK

Last edited by Guravkov2010; 01-11-2022 at 00:41.
Reply With Quote
  #3  
Old 01-11-2022, 02:43
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,412
Thanks: 1,078
Thanked 7,016 Times in 2,658 Posts
KaktoR is on a distinguished road
I think it is not possible, because you can not give xtool a key in erase/decode mode.
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
Guravkov2010 (01-11-2022)
  #4  
Old 01-11-2022, 04:10
Guravkov2010 Guravkov2010 is offline
Registered User
 
Join Date: Apr 2021
Location: Somewhere very Far Away
Posts: 4
Thanks: 12
Thanked 0 Times in 0 Posts
Guravkov2010 is on a distinguished road
Thanks a lot for your answer
Reply With Quote
  #5  
Old 01-11-2022, 09:48
dixen dixen is offline
Registered User
 
Join Date: Sep 2014
Location: Russia
Posts: 396
Thanks: 450
Thanked 436 Times in 200 Posts
dixen is on a distinguished road
Quote:
Originally Posted by Guravkov2010 View Post
Hello Tell me how to deal with encrypted files PAK
For UE4 *.pak - https://fileforums.com/showpost.php?...1&postcount=25
Reply With Quote
The Following User Says Thank You to dixen For This Useful Post:
Guravkov2010 (01-11-2022)
  #6  
Old 01-11-2022, 09:54
Guravkov2010 Guravkov2010 is offline
Registered User
 
Join Date: Apr 2021
Location: Somewhere very Far Away
Posts: 4
Thanks: 12
Thanked 0 Times in 0 Posts
Guravkov2010 is on a distinguished road
Quote:
Originally Posted by dixen View Post
Thanks a lot
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASIS: Advanced Simple Installer Script KaktoR Conversion Tutorials 1387 29-11-2024 12:27
Ultimate Conversion Compressor (UCC) vollachr Conversion Tutorials 55 26-04-2021 10:27
Avg eakinsme Software 11 07-09-2009 01:32



All times are GMT -7. The time now is 16:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com