Wolfenstein Youngblood (Text Tool)

How to translate the files of a game
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

Hello, I opened the "resources" archive files of the game.
I think the language file is "english.json". Can you help me how to open this?

I have uploaded the sample file.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

Looks like compressed with oodle... First int should be decompressed size. And second int is comprerssed size.
Here you go... decompressed. See attachment. But be careful because there is Null byte on the end of file. Not sure for what it is.
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Looks like compressed with oodle... First int should be decompressed size. And second int is comprerssed size.
Here you go... decompressed. See attachment. But be careful because there is Null byte on the end of file. Not sure for what it is.


Thank you very much bro. This is the language file of the game.
But how do I restore this file after editing it. So should we revert the file to its previous state?
Or if I pack this file into the archive after editing, will the game read?
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

First of all you are using outdate version of english.json. You must get the one from the patch_4_pc.resources.
I downloaded the demo so i can try it.
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:First of all you are using outdate version of english.json. You must get the one from the patch_4_pc.resources.
I downloaded the demo so i can try it.


Yes you are right, I got the latest update from patch_4_pc.resources

Can you make an import export tool for this please
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

There's no need to create tool for it. I just figured out that table with entry is somehow protected against editing. So editing offset or anything leads to crash.
But good news is that game accept recompressed files. But it can't be in the end bigger then original.
Also game has cvar "com_loadlooseLanguages" which is unfortunately dissabled. Needs to be patched in exe. It's for loading loose language files. This apply only on english.json.
See attachment decompressed lang from patch_4_pc.resources
Image
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:There's no need to create tool for it. I just figured out that table with entry is somehow protected against editing. So editing offset or anything leads to crash.
But good news is that game accept recompressed files. But it can't be in the end bigger then original.
Also game has cvar "com_loadlooseLanguages" which is unfortunately dissabled. Needs to be patched in exe. It's for loading loose language files. This apply only on english.json.
See attachment decompressed lang from patch_4_pc.resources


Thank you so much for your time and attention.

So, is it necessary to translate the english.json file and then complete this work with exe?
However, there is something I don't understand, if you edit and repackage the attached english.json file, will it not work?
What exactly are the steps we need to do, can you tell me, if you don't mind.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

Well i don't know how to debug things so we can stick with editing resources. I saw at our localization that there are changed bytes in archive header. But not sure what they actually represents.
But if we maintain original size of english.json as compressed then we can simply replace data with new one. There are only 2 things to do.

Once you are done with translation, use this open source oodle compressor/decompressor "you must build it" to compress file.

Code: Select all

https://github.com/rarten/ooz/

Also found this one but not sure if it does what it should does. Not tested.

Code: Select all

https://github.com/jamesbloom/ozip

NOTE: You must compress file under original file size.
1. Open compressed file and chceck file size. Now subtract 8 bytes from file size and paste result at 0x4 offset as a int32/long.
2. Fill the file with Null bytes till you reach original file size. 401155 is original size if i remember correctly.

Now you can replace data in resources with new one. If you know where to find the offset of those data... I don't remember. Good luck!
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Well i don't know how to debug things so we can stick with editing resources. I saw at our localization that there are changed bytes in archive header. But not sure what they actually represents.
But if we maintain original size of english.json as compressed then we can simply replace data with new one. There are only 2 things to do.

Once you are done with translation, use this open source oodle compressor/decompressor "you must build it" to compress file.

Code: Select all

https://github.com/rarten/ooz/

Also found this one but not sure if it does what it should does. Not tested.

Code: Select all

https://github.com/jamesbloom/ozip

NOTE: You must compress file under original file size.
1. Open compressed file and chceck file size. Now subtract 8 bytes from file size and paste result at 0x4 offset as a int32/long.
2. Fill the file with Null bytes till you reach original file size. 401155 is original size if i remember correctly.

Now you can replace data in resources with new one. If you know where to find the offset of those data... I don't remember. Good luck!



Thank you very much for your interest and hard work bro.
Is there a tool that can do this? So I guess we should translate it this way.

I will try to do what you said, thanks again.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

Once i get home i will send you compiled compressor/decompressor and instructions.
+ I can made 010 Hex editor script or template to edit compressed file before being exported to resources.

BTW you can easily find offset by searching at lest 12 original bytes of compressed file.
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Once i get home i will send you compiled compressor/decompressor and instructions.
+ I can made 010 Hex editor script or template to edit compressed file before being exported to resources.

BTW you can easily find offset by searching at lest 12 original bytes of compressed file.


Unfortunately, I don't know a lot of things you know. So you know more about this than me.
So I would really appreciate if you could create a Command or Tool where I can do this in an easier way.
NoobInCoding
Posts: 127
Joined: Sat Aug 07, 2021 9:49 am

Re: Wolfenstein Youngblood (Text Tool)

Post by NoobInCoding »

Compiled ooz
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

NoobInCoding wrote:Compiled ooz


executing this exe gives error (0xc00007b)
it doesn't work with cmd
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Once i get home i will send you compiled compressor/decompressor and instructions.
+ I can made 010 Hex editor script or template to edit compressed file before being exported to resources.

BTW you can easily find offset by searching at lest 12 original bytes of compressed file.


I did an experiment. I changed a language pack from the original languages to English and repackaged it and it worked.

I mean, I guess it doesn't need to be exactly the same size as the original language.
So I guess it accepts even if it's close to the original size. I just wanted to say that maybe it will make your job easier.
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Once i get home i will send you compiled compressor/decompressor and instructions.
+ I can made 010 Hex editor script or template to edit compressed file before being exported to resources.

BTW you can easily find offset by searching at lest 12 original bytes of compressed file.



Hi bro you were going to send me a tool is it still working or did you quit?
Because I couldn't compress the json file you extracted. Could you please tell me how to compress it?
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

Hi and sorry i forgot. Here you go...
You must copy oo2core_6_win64.dll from game folder to folder of compressor and rename it to oo2core_7_win64.dll.

Rename also your decompressed language file you modifiyng to "english_pt4.json" or specify in bat file and put it to compressor. You can set compression level in bat to 10.

Once you have file compressed open it in hex editor and go to offset 0x4 and write int value of compressed size.
You get compressed size from size of file - "minus" 8 bytes = compressed size.

Or if you have 010 Hex Editor then you can use this script which will do the same but with minimum effort.

Code: Select all

//------------------------------------------------
//--- 010 Editor v11.0.1 Script File
//
//      File:
//   Authors:
//   Version:
//   Purpose:
//  Category:
//   History:
//------------------------------------------------
uint size;
size=FileSize()-8;
WriteUInt(4,size);
FileSave();

Fill rest of file with null bytes till you reach original compressed size.
Skalia16
Posts: 29
Joined: Sat Sep 25, 2021 5:45 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by Skalia16 »

h3x3r wrote:Hi and sorry i forgot. Here you go...
You must copy oo2core_6_win64.dll from game folder to folder of compressor and rename it to oo2core_7_win64.dll.

Rename also your decompressed language file you modifiyng to "english_pt4.json" or specify in bat file and put it to compressor. You can set compression level in bat to 10.

Once you have file compressed open it in hex editor and go to offset 0x4 and write int value of compressed size.
You get compressed size from size of file - "minus" 8 bytes = compressed size.

Or if you have 010 Hex Editor then you can use this script which will do the same but with minimum effort.

Code: Select all

//------------------------------------------------
//--- 010 Editor v11.0.1 Script File
//
//      File:
//   Authors:
//   Version:
//   Purpose:
//  Category:
//   History:
//------------------------------------------------
uint size;
size=FileSize()-8;
WriteUInt(4,size);
FileSave();

Fill rest of file with null bytes till you reach original compressed size.


Thank you very much for your interest.
I managed to compress it, hopefully I can do the rest with the hex editor.
lazenes
Posts: 22
Joined: Sat Feb 13, 2021 8:32 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by lazenes »

h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by h3x3r »

Here: size=FileSize()-30;
Should be: size=FileSize()-8;
lazenes
Posts: 22
Joined: Sat Feb 13, 2021 8:32 pm

Re: Wolfenstein Youngblood (Text Tool)

Post by lazenes »

I succeeded but now the font is incompatible :(
https://prnt.sc/xflAm-AaTgbu

fonts/countach/64_df.dat i don't found this directory