How to change item names, action names, radio-subs.
Jul 10, 2014 6:11:09 GMT 10
david flores, verdugo7, and 7 more like this
Post by LegalSoul on Jul 10, 2014 6:11:09 GMT 10
Hi everyone.
I want to share my method of changing texts like item names, action names like OPEN or KICK, radio-subtitles, probably something else. Hope my poor English will let me do that.
Introduction
We all know about great St.Vampyre's RE4TextEdit tool. Unfortunately, RE4 text exists in two different MDT formats. First, mostly is situated in subfolders of "ss" folder. And we can easily edit that with St. Vampyre's tool.
But there is second MDT formant, which is pretty the same but those files include all 6 languages packed in one file, and that's the difference. Item names, action names and subtitles, all these texts have this second format. And we can't edit those files with TextEdit.
This method is splitted in two parts. First is easy, and the second may look a bit crazy for a second.
So let's start.
PART 1. When your new text is shorter or the same size as the original text.
If it is, then you are lucky.
What do we need:
--my little program CharTool (in the archive below)
--hex editor (choose your favourite, and if you have no favourite, you can use that one in the archive below - portable HxD, I'll be using it in my examples)
--zero knowledge about hex editing. You don't even need to know what a hexadecimal numeral system is.
Download HERE
So here I have this awful brick.
And I really don't want it to be a "Brown Chicken Egg". I want it to be the "Bloody Brick".
All item names (and actions as well) are situated right in the etc\core.dat file. If you don't have it, just extract your etc.dat using the gca extractor. Now before any further steps, make sure that Read-Only is
not active for this file (Right click ---> Properties ---> Read-Only box must be empty)
We won't be extracting this file in the Part 1, we'll be doing things directly inside the core.dat. And as I've said, I will be using HxD here, it's not a very advanced hex editor, but that will do, and if you're using something else, I think you'll manage to understand the analogy. And don't forget to make a backup of that file, cause we can mess it up very easy.
STEP 1. Loading the core.dat into the hex editor.
To do that, simply drag your core.dat over the opened hex editor. And then in the top panel of it, type number 4 instead of number 16 and press Enter. And near it, change "hex" to "dec". For the beginners it can seem very confusing, so just try to focus on the column that I've painted with green color on the image below, this is the only column that we need in all these hex-things from this method. You can ignore those on the sides.
STEP 2. Finding the old name that we want to change.
All the item names are situated somewhere in the depths of this file. They are not really encrypted, it's just every character has it's own representation in a form of a short code.
Open CharTool.exe, which is a little tool, that converts what you type into the code, that is used in that file (supports russian letters as well). Just type in your old name under the words "Enter Your Text", and that is Brown Chicken Egg. (careful, the backspace deletes everything)
*Note and remember how many character it has!! (17 here)*
Copy the code, generated below. Now go back to hex editor and press CTRL+F (search). It opens a window, paste the code that you've copied before in the "Search for" line, then change Datatype to Hex-Values.
Press OK:
*Remember to ignore those columns on the sides*
Now this blue selection is our Brown Chicken Egg, we found it.
STEP 3. Deleting the old name.
Simply press Delete, and the selected block is gone. Don't move the blinking cursor from it's position. The core.dat file is a dick and it will easily crash the game if you make the smallest mistake here.
STEP 4. Writing the new name and pasting it.
Going back to CharTool. Press Backspace in that "Enter Your Text" field, and then write your new name.
Pay attention, that it has only 12 charaters. Remember, that the old name, that we've deleted, had 17 charaters. We must make this one the same length. So we need 5 characters more. We could use spaces for that, but that's not
very good, cause if there will be a quesion mark after your Item or smth like this, it will look bad. So there is a better way. Press a very secret key combination which is CTRL+E, right in the CharTool. Do it 5x
times, to raise the character count up to 17. It will enter just spaces, yet generate empty symbols that we want.
Make sure once again, that this character count is THE SAME, as in the old name, that you've deleted.
Copy the code, generated below. Paste it (CTRL+V) into the hex editor, right in the place where that cursor is still blinking. The pasted text will be red, it's okay.
Make sure once again, that you've done everything right and then press CTRL+S (saving the file).
_________________________________________________________________________________
Now it's time to test it
--little note, if your game was opened all this time: the game re-reads core.dat file when you make Game Reset, and not when you are loading the level.
That's all for the Part 1.
If that seemed difficult and unclear, better read no further, cause the next part (which allows name lengthening) will seem freaking hardcore.
I also think that it should go under the spoiler cause that's a long story
Final notes:
--you can do that for any language, I just don't know some special characters like N with a hat etc, so you'll need to find them by experimenting.
--radio-subtitles are situated in the op.dat file. The method is the same. Though I wasn't able to change the radio-names of characters because they are weird stored.
--there is some extracted text from files in that archive, all languages, also Russian (no Japanese ). Just for you to know what kind of text is there in those files, and for you could find it. And also a file with symbols and their hex representations. You can also view it here: 006_core, 017_core, op.dat, table.
That's it. Hope someone understands that
PS. Special thanks to Resident Evil 4 chickens for producing high quality bricks.
I want to share my method of changing texts like item names, action names like OPEN or KICK, radio-subtitles, probably something else. Hope my poor English will let me do that.
Introduction
We all know about great St.Vampyre's RE4TextEdit tool. Unfortunately, RE4 text exists in two different MDT formats. First, mostly is situated in subfolders of "ss" folder. And we can easily edit that with St. Vampyre's tool.
But there is second MDT formant, which is pretty the same but those files include all 6 languages packed in one file, and that's the difference. Item names, action names and subtitles, all these texts have this second format. And we can't edit those files with TextEdit.
This method is splitted in two parts. First is easy, and the second may look a bit crazy for a second.
So let's start.
PART 1. When your new text is shorter or the same size as the original text.
If it is, then you are lucky.
What do we need:
--my little program CharTool (in the archive below)
--hex editor (choose your favourite, and if you have no favourite, you can use that one in the archive below - portable HxD, I'll be using it in my examples)
--zero knowledge about hex editing. You don't even need to know what a hexadecimal numeral system is.
Download HERE
So here I have this awful brick.
And I really don't want it to be a "Brown Chicken Egg". I want it to be the "Bloody Brick".
All item names (and actions as well) are situated right in the etc\core.dat file. If you don't have it, just extract your etc.dat using the gca extractor. Now before any further steps, make sure that Read-Only is
not active for this file (Right click ---> Properties ---> Read-Only box must be empty)
We won't be extracting this file in the Part 1, we'll be doing things directly inside the core.dat. And as I've said, I will be using HxD here, it's not a very advanced hex editor, but that will do, and if you're using something else, I think you'll manage to understand the analogy. And don't forget to make a backup of that file, cause we can mess it up very easy.
STEP 1. Loading the core.dat into the hex editor.
To do that, simply drag your core.dat over the opened hex editor. And then in the top panel of it, type number 4 instead of number 16 and press Enter. And near it, change "hex" to "dec". For the beginners it can seem very confusing, so just try to focus on the column that I've painted with green color on the image below, this is the only column that we need in all these hex-things from this method. You can ignore those on the sides.
STEP 2. Finding the old name that we want to change.
All the item names are situated somewhere in the depths of this file. They are not really encrypted, it's just every character has it's own representation in a form of a short code.
Open CharTool.exe, which is a little tool, that converts what you type into the code, that is used in that file (supports russian letters as well). Just type in your old name under the words "Enter Your Text", and that is Brown Chicken Egg. (careful, the backspace deletes everything)
*Note and remember how many character it has!! (17 here)*
Copy the code, generated below. Now go back to hex editor and press CTRL+F (search). It opens a window, paste the code that you've copied before in the "Search for" line, then change Datatype to Hex-Values.
Press OK:
*Remember to ignore those columns on the sides*
Now this blue selection is our Brown Chicken Egg, we found it.
STEP 3. Deleting the old name.
Simply press Delete, and the selected block is gone. Don't move the blinking cursor from it's position. The core.dat file is a dick and it will easily crash the game if you make the smallest mistake here.
STEP 4. Writing the new name and pasting it.
Going back to CharTool. Press Backspace in that "Enter Your Text" field, and then write your new name.
Pay attention, that it has only 12 charaters. Remember, that the old name, that we've deleted, had 17 charaters. We must make this one the same length. So we need 5 characters more. We could use spaces for that, but that's not
very good, cause if there will be a quesion mark after your Item or smth like this, it will look bad. So there is a better way. Press a very secret key combination which is CTRL+E, right in the CharTool. Do it 5x
times, to raise the character count up to 17. It will enter just spaces, yet generate empty symbols that we want.
Make sure once again, that this character count is THE SAME, as in the old name, that you've deleted.
Copy the code, generated below. Paste it (CTRL+V) into the hex editor, right in the place where that cursor is still blinking. The pasted text will be red, it's okay.
Make sure once again, that you've done everything right and then press CTRL+S (saving the file).
_________________________________________________________________________________
Now it's time to test it
--little note, if your game was opened all this time: the game re-reads core.dat file when you make Game Reset, and not when you are loading the level.
That's all for the Part 1.
If that seemed difficult and unclear, better read no further, cause the next part (which allows name lengthening) will seem freaking hardcore.
I also think that it should go under the spoiler cause that's a long story
{PART 2}PART 2. When your text is longer than the original one.
We will need the same PLUS
--my another little tool ShiftTool (from that same archive)
--St.Vampyre's RE4 DAT Extractor (is there too)
--Windows calculator (programmer mode)
--slightly more than zero skills in hex editing.
Why there is a problem when we increase the length?
Well, core.dat and all those other .dat files are huge packs of files, which are also packs of other files, so there's a lot of data there. In order to let the game know where and which information to read, there are lists of
data's positions all over the file. I don't know how they are called, let it be Sub-headers. So there is a list of sub-headers before every data or text, or files that contain other files, so they are pretty much everywhere. And what
they contain are just the positions of data. So if we simpy enter a longer name, EVERYTHING in the file will be shifted down, and the sub-headers will point on wrong data, and the game will read everything shifted and that will be one big mess. So the biggest problem is to shift those sub-headers. Too bad we don't have any easy tools for that.
This method allows to do that, but only for a single language. I mean, if it's English that you play, then English will be okay, but every other language will be messed up. Still better than nothing.
STEP 1. Unpacking core.dat, using St. Vampyre's tool
In order to not damage the file, we'll have to unpack it. Copy it in the folder with datextract.exe and datrepack.exe. Drag it over datextract.exe. That will create a folder named "Core". There are a lot of files in this folder. Some of them contain text.
006_Core.MDT - contains action names like OPEN, CUT, etc..
017_Core.MDT - contains item names. That's what we need here.
STEP 2. Loading 017_Core.MDT into the hex editor.
We did loading already, the same process here.
STEP 3. Find the old name that we need to replace.
Did that too, repeat the same.
STEP 4. Deleting the old name.
Did already, repeat.
STEP 5. Writing a new longer name and pasting it in hex editor.
We want a longer name. For instance, Horrible Bloody Brick. Back to CharTool, write the name there.
Note that there are 21 characters in this name. The old name had 17. So we deleted 17 but added 21. There are 4 extra characters added. The game actually can crash at loading, when you add different numbers of characters characters, so you may need to experiment sometimes with the number of added characters. I recommend to add 20 characters each time. It was stable for me all the time. So we already have 4 characterd added, and now we press 16x times CTRL+E.
Now we have 37 characters. The old name had 17, now it's 37. 20 characters difference. Keep that in mind. Copy the code, generated below.
Back to hex editor, paste (CTRL+V) right in the place where the blinking cursor is.
STEP 6. Finding the postition, from which we need to shift the sub-headers.
Run standard Windows calculator by pressing WIN+R, then typing "calc". Then press Mode ---> Programmer. And choose the "Dec" option in the left.
Go back to hex redactor. Put the cursor in the beginning of that name that you've pasted (in the beginning of the red block). In this example it's a cell with "AE" value. And then look at the bottom of that window, you'll see the "Offset" word. Enter in the calculator those numbers next to it. In this example it's 9108.
Now we need to find the position, where sub-headers end, and the names data begins. This is actually a constant number for the english file. And it is number 8806, but that's only for English. For other languages you need to find manually. To do that, you need to scroll the wheel UP, untill you notice a lot of zeros in the right two little columns. And then put the cursor right after those zeros. I scrolled up just a little, and here it is on the picture with some explanations.
And now we look at the "Offset" at the bottom, and you can see that 8806 number, that I've been talking about.
Back to our calculator, that still has that value 9108, that we entered before.
Now press MINUS and enter this number 8806, that we've figured out. The result is 302. Now switch "Dec" to "Hex" in the calculator's left options. The number has changed to 12E:
Now we need to add here the first sub-header. It is also a constant, and this time it is the same for every language. And it's a hex number 448. So we press PLUS and enter 448 in the calculator. The result is 576.
Let's do a little trick now. We take this value 576 and put a space after the first number of it. So it is 5 76. And now we swap the parts before space and after the space. And that gives us 76 5. And now just write 05 instead of 5. We get 76 05. And this is how this subheader that we've calculated(576) looks in the file(76 05).
Scroll the wheel UP until you find a line, starting with 76 05. And place the cursor at the beginning of the NEXT line. Like on the picture.
This is the position from which the sub-headers need to be shifted.
STEP 7. Shifting the sub-headers.
We need to select all the sub-headers, starting from current cursor location and finishing at that place, where the sub-headers end, and names data begins (the place where the pattern changes). So press and hold left mouse button and scroll the wheel DOWN until those zeros end. The selection must end like it does on the picture:
Press CTRL+C (copy). And then press DELETE (delete the block). Don't lose the position of blinking cursor.
Open ShiftTool.exe. Paste that you've copied in the big area on the left of the program. Then press "Delete all spaces and line breaks". Under the words "How many characters did you add" you should write how many characters did you add, oh, that's unexpectedly Remember, we've deleted 17 characters (Brown Chicken Egg), and then we pasted 37 (Horrible Bloody Brick + 16x empty symbols), so there are 20 extra characters. Type 20 in that field.
Now press "Shift sub-headers button". The code on the left will change. Right click it, press Select All. Then press CTRL+C (Copy). Go back to hex redactor, paste it (CTRL+V) in the place, where the cursor is blinking. Press CTRL+S (saving the file).
STEP 8. Repacking the core.dat, using St. Vampyre's tool
Go in that folder that has datrepack.exe in it, and also that extracted Core folder. Press right click while holding Shift, choose Open Command Window Here. If you're on Windows XP it's a bit longer, google how to run cmd and to move into a folder in it. In the opened black cmd window type this: datrepack core\core.index core.dat
Then press Enter. If there was a core.dat file in this folder, it will replace it, otherwise it will create a new one.
Copy this modified core.dat into your "etc\" directory and replace the old one.
_________________________________________________________________
Time to test if we didn't make any mistakes.
And you can see that all other names are on their places:
We will need the same PLUS
--my another little tool ShiftTool (from that same archive)
--St.Vampyre's RE4 DAT Extractor (is there too)
--Windows calculator (programmer mode)
--slightly more than zero skills in hex editing.
Why there is a problem when we increase the length?
Well, core.dat and all those other .dat files are huge packs of files, which are also packs of other files, so there's a lot of data there. In order to let the game know where and which information to read, there are lists of
data's positions all over the file. I don't know how they are called, let it be Sub-headers. So there is a list of sub-headers before every data or text, or files that contain other files, so they are pretty much everywhere. And what
they contain are just the positions of data. So if we simpy enter a longer name, EVERYTHING in the file will be shifted down, and the sub-headers will point on wrong data, and the game will read everything shifted and that will be one big mess. So the biggest problem is to shift those sub-headers. Too bad we don't have any easy tools for that.
This method allows to do that, but only for a single language. I mean, if it's English that you play, then English will be okay, but every other language will be messed up. Still better than nothing.
STEP 1. Unpacking core.dat, using St. Vampyre's tool
In order to not damage the file, we'll have to unpack it. Copy it in the folder with datextract.exe and datrepack.exe. Drag it over datextract.exe. That will create a folder named "Core". There are a lot of files in this folder. Some of them contain text.
006_Core.MDT - contains action names like OPEN, CUT, etc..
017_Core.MDT - contains item names. That's what we need here.
STEP 2. Loading 017_Core.MDT into the hex editor.
We did loading already, the same process here.
STEP 3. Find the old name that we need to replace.
Did that too, repeat the same.
STEP 4. Deleting the old name.
Did already, repeat.
STEP 5. Writing a new longer name and pasting it in hex editor.
We want a longer name. For instance, Horrible Bloody Brick. Back to CharTool, write the name there.
Note that there are 21 characters in this name. The old name had 17. So we deleted 17 but added 21. There are 4 extra characters added. The game actually can crash at loading, when you add different numbers of characters characters, so you may need to experiment sometimes with the number of added characters. I recommend to add 20 characters each time. It was stable for me all the time. So we already have 4 characterd added, and now we press 16x times CTRL+E.
Now we have 37 characters. The old name had 17, now it's 37. 20 characters difference. Keep that in mind. Copy the code, generated below.
Back to hex editor, paste (CTRL+V) right in the place where the blinking cursor is.
STEP 6. Finding the postition, from which we need to shift the sub-headers.
Run standard Windows calculator by pressing WIN+R, then typing "calc". Then press Mode ---> Programmer. And choose the "Dec" option in the left.
Go back to hex redactor. Put the cursor in the beginning of that name that you've pasted (in the beginning of the red block). In this example it's a cell with "AE" value. And then look at the bottom of that window, you'll see the "Offset" word. Enter in the calculator those numbers next to it. In this example it's 9108.
Now we need to find the position, where sub-headers end, and the names data begins. This is actually a constant number for the english file. And it is number 8806, but that's only for English. For other languages you need to find manually. To do that, you need to scroll the wheel UP, untill you notice a lot of zeros in the right two little columns. And then put the cursor right after those zeros. I scrolled up just a little, and here it is on the picture with some explanations.
And now we look at the "Offset" at the bottom, and you can see that 8806 number, that I've been talking about.
Back to our calculator, that still has that value 9108, that we entered before.
Now press MINUS and enter this number 8806, that we've figured out. The result is 302. Now switch "Dec" to "Hex" in the calculator's left options. The number has changed to 12E:
Now we need to add here the first sub-header. It is also a constant, and this time it is the same for every language. And it's a hex number 448. So we press PLUS and enter 448 in the calculator. The result is 576.
Let's do a little trick now. We take this value 576 and put a space after the first number of it. So it is 5 76. And now we swap the parts before space and after the space. And that gives us 76 5. And now just write 05 instead of 5. We get 76 05. And this is how this subheader that we've calculated(576) looks in the file(76 05).
Scroll the wheel UP until you find a line, starting with 76 05. And place the cursor at the beginning of the NEXT line. Like on the picture.
This is the position from which the sub-headers need to be shifted.
STEP 7. Shifting the sub-headers.
We need to select all the sub-headers, starting from current cursor location and finishing at that place, where the sub-headers end, and names data begins (the place where the pattern changes). So press and hold left mouse button and scroll the wheel DOWN until those zeros end. The selection must end like it does on the picture:
Press CTRL+C (copy). And then press DELETE (delete the block). Don't lose the position of blinking cursor.
Open ShiftTool.exe. Paste that you've copied in the big area on the left of the program. Then press "Delete all spaces and line breaks". Under the words "How many characters did you add" you should write how many characters did you add, oh, that's unexpectedly Remember, we've deleted 17 characters (Brown Chicken Egg), and then we pasted 37 (Horrible Bloody Brick + 16x empty symbols), so there are 20 extra characters. Type 20 in that field.
Now press "Shift sub-headers button". The code on the left will change. Right click it, press Select All. Then press CTRL+C (Copy). Go back to hex redactor, paste it (CTRL+V) in the place, where the cursor is blinking. Press CTRL+S (saving the file).
STEP 8. Repacking the core.dat, using St. Vampyre's tool
Go in that folder that has datrepack.exe in it, and also that extracted Core folder. Press right click while holding Shift, choose Open Command Window Here. If you're on Windows XP it's a bit longer, google how to run cmd and to move into a folder in it. In the opened black cmd window type this: datrepack core\core.index core.dat
Then press Enter. If there was a core.dat file in this folder, it will replace it, otherwise it will create a new one.
Copy this modified core.dat into your "etc\" directory and replace the old one.
_________________________________________________________________
Time to test if we didn't make any mistakes.
And you can see that all other names are on their places:
Final notes:
--you can do that for any language, I just don't know some special characters like N with a hat etc, so you'll need to find them by experimenting.
--radio-subtitles are situated in the op.dat file. The method is the same. Though I wasn't able to change the radio-names of characters because they are weird stored.
--there is some extracted text from files in that archive, all languages, also Russian (no Japanese ). Just for you to know what kind of text is there in those files, and for you could find it. And also a file with symbols and their hex representations. You can also view it here: 006_core, 017_core, op.dat, table.
That's it. Hope someone understands that
PS. Special thanks to Resident Evil 4 chickens for producing high quality bricks.