Results 1 to 9 of 9

Thread: Tutorial: Competition renaming

  1. #1
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100

    Tutorial: Competition renaming

    Here is how you can fully rename any competition in the game. The method was first discovered by JohnLocke here 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 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 and XVI32. 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).

    The exe excerpt:
    Spoiler!

  2. The Following 2 Users Say Thank You to saturn For This Useful Post:


  3. #2
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100
    Continued:

    The competition ID numbers:
    Spoiler!


    The 9CF*** values:
    Spoiler!


    A couple of examples to illustrate the process:

    The German First Division's original code:
    Code:
    0060F007 JNE SHORT 0060F014
    0060F009 MOV DWORD PTR DS:[9CF54C],EDI- GERMAN_FIRST_DIVISION
    0060F00F JMP 0060FD31
    Changes to:
    Code:
    0060F007 NOP
    0060F008 NOP
    0060F009 MOV DWORD PTR DS:[9CF54C],10
    0060F013 NOP
    The English First Division's original code:
    Code:
    0060F393 JNE SHORT 0060F3A0
    0060F395 MOV DWORD PTR DS:[9CF5C0],EDI- ENGLISH_FIRST_DIVISION
    0060F39B JMP 0060FD31
    Changes to:
    Code:
    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:
    0060FF19 PUSH 009DB468                           ;  ASCII "Italian Cup"
    0060FF1E PUSH ESI
    0060FF1F CALL 00951C50
    0060FF24 ADD ESP,8
    0060FF27 TEST EAX,EAX
    0060FF29 JE 00610D7A
    0060FF2F PUSH 009DB454                           ;  ASCII "Italian T.I.M. Cup"
    0060FF34 PUSH ESI
    0060FF35 CALL 00951C50
    0060FF3A ADD ESP,8
    0060FF3D TEST EAX,EAX
    0060FF3F JE 00610D7A
    0060FF45 PUSH 009DB440                           ;  ASCII "Italian Serie C Cup"
    Changes to:
    Code:
    0060FF19 PUSH 009DB468                               ;  ASCII "Italian Cup"
    0060FF1E PUSH ESI
    0060FF1F CALL 00951C50
    0060FF24 ADD ESP,8
    0060FF27 TEST EAX,EAX
    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:
    Spoiler!

    Changes to:
    Spoiler!


    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.

  4. The Following 6 Users Say Thank You to saturn For This Useful Post:


  5. #3
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100

    Renaming countries

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

    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:
    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
    As before, 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:
    Code:
    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
    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).

    Doing all of this should result in:
    Spoiler!


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

  6. The Following 2 Users Say Thank You to saturn For This Useful Post:


  7. #4
    Join Date
    15-12-11
    Location
    Your Mother
    Posts
    25,883
    vCash
    4300000
    Will move any queries after awhile but if Yugoslavia was renamed Serbia, would that be held in nation.dat or within the exe?

  8. #5
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100
    What program would you rename it with? I'd imagine it would be held/changed in both.

  9. #6
    Join Date
    02-03-12
    Location
    Maltby, Rotherham, UK
    Posts
    3,372
    vCash
    1907
    Can player awards be renamed the same way

  10. #7
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100
    I'm hopeful they can be, but haven't tested any yet.

  11. #8
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100
    Quote Originally Posted by topaztiger1983 View Post
    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.
    Last edited by saturn; 08-09-16 at 10:35 PM.

  12. #9
    Join Date
    18-03-14
    Posts
    703
    vCash
    5100

    MLS Clubs

    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:
    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.
    Code:
    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.
    Last edited by saturn; 21-09-16 at 08:38 AM. Reason: Just a general update

  13. The Following User Says Thank You to saturn For This Useful Post:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •