[TUTORIAL] Renaming

User avatar
Patch Team
Posts: 2291
Joined: Wed Nov 25, 2020 5:01 am
Has thanked: 197 times
Been thanked: 794 times

[TUTORIAL] Renaming

Post by Xeno »

This Saturn's renaming tutorial is transferred from >>> https://champman0102.co.uk/showthread.php?t=8267 and modified some parts to clarify process.
If you have any question or issues about Renaming , related technical support thread is here >>> viewtopic.php?f=35&t=4202

Here is how you can fully rename any competition in the game. The method was first discovered by JohnLocke here (http://champman0102.co.uk/showthread.ph ... post183956) so all credit goes to him, but I'm going to expand upon it a little.

Competition names are stored in three parts. The long name (English Premier Division) can be up to 50 characters, the short name (Premier Division) 25, and the abbreviation (PRM) three. Whenever we want to change a competition's name, we have to make sure that all three parts of a competition's name in the data (club_comp.dat) match what's in the exe (cm0102.exe). Thankfully there's a program available that makes the changes in both, although it can't rename every competition.

Zozoa's Names Editor (viewtopic.php?f=77&t=3010) allows you to rename all three parts of a competition. However, the competition's new long name must not exceed* the amount of characters in the competition's old long name. The full 25 characters can be used for the competition's new short name, as well as the three characters for the abbreviation. The Names Editor is very straight-forward to use and will always keep your data and exe matched up. But due to the long name restrictions, it can't fully rename everything.

(*You might have room to add up to three extra characters in your new long name, due to how the names are stored in the exe. If your new name is only longer by a couple of characters, then try renaming it in the Names Editor first before resorting to the below method.)

To rename competitions that have more characters in their new long names than in their original, we have to use JohnLocke's method from above. You will need two programs to edit your exe and data: Olly (http://www.ollydbg.de/) and XVI32 (http://www.chmaas.handshake.de/delphi/f ... m#download). I'm going to assume people are familiar with using Olly so won't be covering things like saving, hex vs decimal etc, there are other tutorials available for that.

JohnLocke's instructions from his post are pretty clear: we NOP the lines above and beneath the address where your desired competition's 9CF*** value is referenced, and then change the EDI to that competition's ID number. To help, I'll include the part of the exe that references all the 9CF*** values of competitions, the competition ID numbers (and their hex values), plus all the 9CF*** values for competitions (which will be useful later on).

You can find The 9CF*** values and The competition ID numbers here : [DOCUMENTATION] The [9CF***] Thread >>> viewtopic.php?f=35&t=2801

*** Competition renaming

A couple of examples to illustrate the process:

The German First Division's original code:

Code: Select all

0060F007 JNE SHORT 0060F014
0060F00F JMP 0060FD31
Changes to:

Code: Select all

0060F007 NOP
0060F008 NOP
0060F009 MOV DWORD PTR DS:[9CF54C],10
0060F013 NOP
The English First Division's original code:

Code: Select all

0060F393 JNE SHORT 0060F3A0
0060F39B JMP 0060FD31
Changes to:

Code: Select all

0060F393 NOP
0060F394 NOP
0060F395 MOV DWORD PTR DS:[9CF5C0],8
0060F39F NOP
You will notice that some competitions in the exe excerpt above don't have the MOV DWORD PTR DS:[9CF***],EDI line. This occurs when there is more than one name available for a competition, usually used in a previous version of CM. For example we can see at 0060FF19 and below the two names used for the Italian Cup. These have to be edited slightly differently. Find the TEST EAX,EAX line and NOP the JE xxx line below it and everything else until the next competition's ASCII line. Then add the MOV DWORD PTR DS:[9CF***],xxx line after the TEST EAX,EAX line.

The Italian Cup's original code:

Code: Select all

0060FF19 PUSH 009DB468 ; ASCII "Italian Cup"
0060FF1F CALL 00951C50
0060FF24 ADD ESP,8
0060FF29 JE 00610D7A
0060FF2F PUSH 009DB454 ; ASCII "Italian T.I.M. Cup"
0060FF35 CALL 00951C50
0060FF3A ADD ESP,8
0060FF3F JE 00610D7A
0060FF45 PUSH 009DB440 ; ASCII "Italian Serie C Cup"
Changes to:

Code: Select all

0060FF19 PUSH 009DB468 ; ASCII "Italian Cup"
0060FF1F CALL 00951C50
0060FF24 ADD ESP,8
0060FF29 MOV DWORD PTR DS:[9CF71C],153
0060FF33 NOP
0060FF34 NOP
0060FF35 NOP
0060FF36 NOP
0060FF37 NOP
0060FF38 NOP
0060FF39 NOP
0060FF3A NOP
0060FF3B NOP
0060FF3C NOP
0060FF3D NOP
0060FF3E NOP
0060FF3F NOP
0060FF40 NOP
0060FF41 NOP
0060FF42 NOP
0060FF43 NOP
0060FF44 NOP
0060FF45 PUSH 009DB440 ; ASCII "Italian Serie C Cup"
Some competitions may have three or four alternate names, but the process is similar. NOP from the JE xxx line under the TEST EAX,EAX line to the next competition's ASCII line.

The Japanese Cup's original code:

Code: Select all

0060F8A0 PUSH 009DB98C ; ASCII "Japanese Yamazaki Nabisco Cup"
0060F8A6 CALL 00951C50
0060F8AB ADD ESP,8
0060F8B0 JE 0060FCD3
0060F8B6 PUSH 009DB97C ; ASCII "Japanese Cup"
0060F8BC CALL 00951C50
0060F8C1 ADD ESP,8
0060F8C6 JE 0060FCD3
0060F8CC PUSH 009DB96C ; ASCII "Japanese Cup"
0060F8D2 CALL 00951C50
0060F8D7 ADD ESP,8
0060F8DC JE 0060FCD3
0060F8E2 PUSH 009DB964 ; ASCII "J Cup"
0060F8E8 CALL 00951C50
0060F8ED ADD ESP,8
0060F8F2 JE 0060FCD3
0060F8F8 PUSH 009DB958 ; ASCII "Friendly"
Changes to:

Code: Select all

0060F8A0 PUSH 009DB98C ; ASCII "Japanese Yamazaki Nabisco Cup"
0060F8A6 CALL 00951C50
0060F8AB ADD ESP,8
0060F8B0 MOV DWORD PTR DS:[9CF664],47
0060F8BA NOP
0060F8BB NOP
0060F8BC NOP
0060F8BD NOP
0060F8BE NOP
0060F8BF NOP
0060F8C0 NOP
0060F8C1 NOP
0060F8C2 NOP
0060F8C3 NOP
0060F8C4 NOP
0060F8C5 NOP
0060F8C6 NOP
0060F8C7 NOP
0060F8C8 NOP
0060F8C9 NOP
0060F8CA NOP
0060F8CB NOP
0060F8CC NOP
0060F8CD NOP
0060F8CE NOP
0060F8CF NOP
0060F8D0 NOP
0060F8D1 NOP
0060F8D2 NOP
0060F8D3 NOP
0060F8D4 NOP
0060F8D5 NOP
0060F8D6 NOP
0060F8D7 NOP
0060F8D8 NOP
0060F8D9 NOP
0060F8DA NOP
0060F8DB NOP
0060F8DC NOP
0060F8DD NOP
0060F8DE NOP
0060F8DF NOP
0060F8E0 NOP
0060F8E1 NOP
0060F8E2 NOP
0060F8E3 NOP
0060F8E4 NOP
0060F8E5 NOP
0060F8E6 NOP
0060F8E7 NOP
0060F8E8 NOP
0060F8E9 NOP
0060F8EA NOP
0060F8EB NOP
0060F8EC NOP
0060F8ED NOP
0060F8EE NOP
0060F8EF NOP
0060F8F0 NOP
0060F8F1 NOP
0060F8F2 NOP
0060F8F3 NOP
0060F8F4 NOP
0060F8F5 NOP
0060F8F6 NOP
0060F8F7 NOP
0060F8F8 PUSH 009DB958 ; ASCII "Friendly"
So we've almost covered the exe part of renaming, just one last thing. From 00610DA0 and below you'll see that the competitions are stored slightly differently, the result being you won't have room to change the EDI line like we did before. Instead you'll have to swap the position of the competition in the exe with one where there is room. The only things you'll have to change are the ASCII line (PUSH xxx) and the 9CF*** part of the MOV DWORD PTR DS:[9CF***],EDI line. Then you can NOP the lines and change the EDI as normal.

So with the exe patched we can move onto editing the club_comp.dat file. Load up XVI32 and open the club_comp file. You'll see the Belgian First Division and other Belgian competition names stored in the right window, with their long, short and abbreviated names visible. Search for the competition name that you've edited in the exe by hitting CTRL+F and typing in the name in the Text String (change the direction to up or down if at first you can't locate it). You'll land on the first letter of the competition, but make sure you're on its long name as in some cases they're the same.

Whilst still on the first letter, go to Edit and select Overwrite string. Select the Text string and type in whatever new name you desire. Next hit Text -> Hex to automatically convert the characters into their hexademical equivalents (a very handy feature). Press OK and the new competition name will be visible in the window on the right. Do the same again to tidy up the short name and abbreviation. If the new short name or abbreviation has less characters than its original, you can overwrite any remaining characters by selecting the first one, clicking Edit, Overwrite string and entering 00 in the Hex string.

Alternatively you can just edit the long names in XVI32 and the short/abbreviation in the Names Editor. The Names Editor won't allow you to just rename the short/abbreviation alone, so you'll have to add an extra character onto the long name, edit the short/abbreviation and save, then go back and remove the extra character from the long name and save again.

Hopefully now everyone should be able to rename any competition to whatever they want.

*** Nation renaming

Renaming a country follows a similar process to that of renaming a league. Here we will rename Holland to Netherlands.

You can use same process for other renaming issues if you can not do it with Names Editor. Thanks to Saturn and John Locke.

1- First we have to locate Holland in the exe. It (and all the other countries) are located just above the competition names, with Holland itself at 0060E100.

Code: Select all

0060E100 |> 68 34159B00 PUSH cm0102.009B1534 ; ASCII "Holland"
0060E105 |. 56 PUSH ESI
0060E106 |. E8 453B3400 CALL cm0102.00951C50
0060E10B |. 83C4 08 ADD ESP,8
0060E10E |. 85C0 TEST EAX,EAX
0060E110 |. 75 0B JNE SHORT cm0102.0060E11D
0060E112 |. 893D 38F39C00 MOV DWORD PTR DS:[9CF338],EDI
0060E118 |. E9 2F050000 JMP cm0102.0060E64C
2- In Olly, we NOP the lines above and below the EDI line, and replace EDI with the country's ID# (54 for the Netherlands). So now the exe looks like:
(You can find related country 9CF and ID's here >>> [DOCUMENTATION] The [9CF***] Thread >>> viewtopic.php?f=35&t=2801)

Code: Select all

0060E100 |> 68 34159B00 PUSH cm0102.009B1534 ; ASCII "Holland"
0060E105 |. 56 PUSH ESI
0060E106 |. E8 453B3400 CALL cm0102.00951C50
0060E10B |. 83C4 08 ADD ESP,8
0060E10E |. 85C0 TEST EAX,EAX
0060E110 |. 90 NOP
0060E111 |. 90 NOP
0060E112 |. C705 38F39C00 54000000 MOV DWORD PTR DS:[9CF338],54
0060E11C |. 90 NOP
3- Next we have to rename Holland in three files. First, open nation.dat in XVI32, search for Holland (twice) and rename it to Netherlands. Next open up nat_club.dat and search for Holland (four times) and again rename it. Finally open up euro.cfg in Notepad (or any other text editor) and change *Holland to *Netherlands. Before editing the euro.cfg you might have to change it from being Read Only (Right click on euro.cfg -> Properties -> untick Read Only).

You can use same process for other renaming issues if you can not do it with Names Editor.

Thanks to JohnLocke and Dr. Conquest for doing pretty much the same thing in the 00/01 forum.

*** Awards renaming

Can player awards be renamed the same way? Yes, they can.

The only thing to note is that, given the large number of awards in the game (~530), an award's ID number might be different to that which is shown in the staff_comp.dat file. This is because the numbers loop around after every 256 awards. For example, if you search for the English Premier Division Player of the Month in the staff_comp.dat file, you'll see that its ID number is 0B (four bytes before (to the left of) the award's name). Similarly, if you search for the Irish Young Player Of the Year you'll see that its ID number is 0B too.

You can see given its position in the staff_comp.dat file that the Irish Young Player Of the Year is obviously not the 12th (0B) award in the file, so the numbers have looped around. The award's true ID number is (0B) + (256 in hexadecimal). 256 in hexadecimal is 100, so the Irish Young Player Of the Year's true ID number is 10B. Similarly, the Danish Second Division Young Player of Year and the Australian NSL Player of the Month awards both have ID numbers of 2C in the staff_comp.dat file. Again, we just add 256 in hexadecimal to get the Australian NSL Player of the Month's true ID number: 12C.

A few awards are stored after the numbers loop around a second time (those relating to some of the Brazilian state leagues and South Korea). Here we just add 512 in hexademical (200) to get the award's true ID number.

Edit: Actually you can just look at the byte after the award's ID number (so three bytes before (to the left of) the award's name). If it says 01 add 100 to the award's ID number, if it says 02 add 200 to it.

*** Club renaming

Open XVI32 and load up cm0102.exe.

Hit Ctrl+F in XVI32, enter Colorado in the Text String and hit OK. You will be brought to the address 5D177E. Press F3 (Find again down) to be brought to the next entry at 5E0CC9.

Here, you need to overwrite the names of the MLS clubs. In the top-left part of XVI32, click Edit and select "Overwrite string". Select "Text string" and copy and paste the following:

Chicago Fire____Colorado Rapids_Columbus Crew SC____D.C. United_FC Dallas___Los Angeles Galaxy__New England Revolution__New York Red Bulls__New York City FC____San Jose Earthquakes____Seattle Sounders FC_Sporting Kansas City____

Press the "Text -> Hex" button in XVI32 and select OK. If a warning pops up just click OK again (I couldn't replicate this warning but I think pressing OK should work).

The cursor in XVI32 should now be on the "i" from the original Washington DC name. Click on the already highlighted 69 in the left panel of XVI32 and press 00 numerous times until you have overwritten the "e" in "Chicago Fire" a couple of lines below. Now scroll back up to the other Chicago Fire (it should follow after Albacete Balompié B). Here, you will need to replace all the underscores (the character "_") with the value 00. Click on the underscore in the right column in XVI32, and then click on the left column. The value 5F should be selected. Press 00 to overwrite it, and do the same to any other 5F values that follow. Search for the next underscore and repeat the process until all the 5F values have been replaced by 00. In the top left corner of XVI32, hit File and then Save. Your cm0102.exe is now 50% patched.

Open up cm0102 in Olly. You're going to have to point the exe to the new locations of the MLS club names that you just edited in XVI32. The good thing about this is that you can straight away see whether you've done anything wrong via the ASCII: "Club name" line that appears in Olly after you've changed the address.

In Olly, hit CTRL+G and enter 0061612A. Now enter the following values at the defined addresses:

Code: Select all

0061612A PUSH 9E0CCC <new ASCII after patching> ASCII: "Chicago Fire"
00616147 PUSH 9E0D58 <new ASCII after patching> ASCII: "New York City FC"
00616164 PUSH 9E0D00 <new ASCII after patching> ASCII: "D.C. United"
00616181 PUSH 9E0D84 <new ASCII after patching> ASCII: "Seattle Sounders FC"
0061619E PUSH 9E0D6C <new ASCII after patching> ASCII: "San Jose Earthquakes"
006161CA PUSH 9E0D2C <new ASCII after patching> ASCII: "New England Revolution"
006161E7 PUSH 9E0D44 <new ASCII after patching> ASCII: "New York Red Bulls" (no need to edit)
00616229 PUSH 9E0D18 <new ASCII after patching> ASCII: "Los Angeles Galaxy"
00616246 PUSH 9E0D98 <new ASCII after patching> ASCII: "Sporting Kansas City"
00616263 PUSH 9E0D0C <new ASCII after patching> ASCII: "FC Dallas"
00616280 PUSH 9E0CEC <new ASCII after patching> ASCII: "Columbus Crew SC"
0061629D PUSH 9E0CDC <new ASCII after patching> ASCII: "Colorado Rapids"
Save the changes in Olly as normal. Your cm0102.exe file is now 100% patched.

Now we need to change the original club names in club.dat to match the changes we've made in the exe. Open XVI32 and load up the club.dat file. CTR+F the following names and overwrite both their long and short names.

Name .....New Long .....New Short
Chicago Fire .....- .....-
Colorado Rapids .....- .....-
Columbus Crew .....Columbus Crew SC .....-
Washington DC United .....D.C. United .....D.C. United >>> Overwrite the extra letters in the long name by entering 00s in the left panel of XVI32.
Dallas Burn .....FC Dallas .....- >>> Overwrite the extra letters in the long name.
Los Angeles Galaxy .....- .....LA Galaxy >>> Overwrite the extra letters in the short name.
New England Revolution .....- .....-
NY/NJ Metrostars .....New York Red Bulls .....-
Miami Fusion FC .....New York City FC .....-
San Jose Earthquakes .....- .....San Jose >>> Make sure you're not editing the B-team, overwrite extra letters in the short name.
Tampa Bay Mutiny .....Seattle Sounders FC .....- >>> Search Up when using CTRL+F
Kansas City Wizards .....Sporting Kansas City .....-

Lastly we need to edit player_setup.cfg to include the updated club names. Open player_setup.cfg with Notepad and hit CTRL+H. In the 'Find what' tab enter the old club's old long name, and in the 'Replace with' tab enter the club's new long name. Click Replace All and repeat for each club that has had their long name updated.
* [TUTORIAL] How to install and run the game CM0102?> viewtopic.php?f=85&t=3571
Please use search bar for solution before posting your issue