Tutorials for hexediting EHM

Discuss all aspects of editing the data and databases in EHM here. Have a question about the EHM Editor, EHM Assistant, editing the .cfg files, hex editing the .dat or .db files? Want to tweak the EHM exe file to change league rules/structure, start date etc? This is the place!
Forum rules
This is the forum to discuss all aspects of editing the EHM data and tweaking the game.

Have a bug or feature request for the EHM Editor? Post them in the EHM Editor thread. Please start a new thread or post in another thread if you have a question about how to use the EHM Editor.

Given the large number of questions on similar topics, we ask that you start a new thread for a new question unless you can locate a similar question in an existing thread. This will hopefully ensure that similar questions do not get buried in large threads.

Useful links: EHM 1 Assistant (Download) | EHM 1 Editor (Download) | EHM 1 Editor Tutorials | Editing Rules & Structures Guide | Converting EHM 2004 / 2005 DBs to EHM 1 | Converting an EHM 2007 DB to EHM 1 | Extra_config.cfg | Import_config.cfg | Player Roles
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Tutorials for hexediting EHM

Post by Hobbit13 »

In this thread I will be posting tutorials on how to edit certain things which I have found through hexediting EHM's files. To make these alterations, you will need a hex editor. I have been using HxD but any hexeditor will do just fine.

For my first tutorial, I will show you how to edit retired numbers. Sadly the ability to edit retired numbers was not included by mne2 in his pre-game editor, so we have to do this manually with a hexeditor.


First off, open up the retired_numbers.dat file in your database using the hex editor and here's an explanation of what means what:

Image

To put in the correct retired number, you can't type in the number that you actually retired but rather the number in hexadecimal. To do that, you can for example use this converter. So to find what Lemieux's 66 is in hexadecimal, you type 66 into the decimal box and convert it. The hexadecimal is 42.

To find the team ID, it is easiest if a number is already retired for that team. You look for the player and you find the team ID. However if this is not case, open club.dat using your hex editor. Check the explanation below:

Image

The team ID is only one or two hex values.


The easiest way to add retired numbers is by overwriting ones that are set for defunct teams. They are Willie O'Ree, Martin St. Amour and B.J. MacPherson (San Diego Gulls) and Nick Vitucci (Greenville Grrrowl).

To actually add more retired numbers to the file, you will have to copy the whole command for a retired number so from the number of succession to the retired number and add it to the end of the file. The hexeditor will most likely ask you if you want to increase the data file size, click yes. You will however have to edit the number of succession now and increase it by 1 each time you add a retired number.


Finally for EHM to load the larger file size, you have to open index.dat and search for retired_numbers.dat Highlighted below is the number that you have to edit:
Image

That is the last number of succession you will find in retired_numbers.dat + 1. So if you have added 5 retired numbers to retired_numbers.dat, then you have to increase this number by 5, so from 43 01 to 48 01.


That's it. Coming up next is a tutorial on how to edit league histories.
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Tutorials for hexediting EHM

Post by Hobbit13 »

To edit League history, which also then changes the successes in the team history, you have to load club_comp_history.dat using a hexeditor.

In the picture below, the various functions are highlighted:

Image

The first underlined part (red) is the number of succession that increases by 1 for each command.
Blue: league ID. I'll explain how to find it later in this post.
Green: Winner of league
Pink: Runner up
Aqua: Third place
Brown: Host (used for example in Memorial Cup)
Yellow: Regular season winner (President's Trophy in NHL)
Black: Year

For the year, you have to again convert the year into hexadecimal (check previous post to see how). So for example 2006 is 7D6 in hexadecimal. However for the game to understand it correctly, the values have to be switched. So instead of typing in 07 D6 you have to type in D6 07. Or in the example pictured above to find out which year it is, you begin with 7E 07, switch the values to 7E7, convert to decimal numbers and you get 1918.
The year that you put in, is the year the season ended. So if you want to add a history for the 05/06 season, then the year you put in is 2006.

To find the ID of clubs, check the previous post as well.

Now to find the league ID, load club_comp.dat into your hexeditor. First find the league that you want to edit the history for by using search. Then click on the first letter of that leagues full name and using your cursors, move 2 spaces up and 4 to your left. This is shown for the NHL in the picture below:

Image

The league ID for the NHL is underlined in blue and in this case, it's simply 00 00 00 00.


To find a specific history for a specific league in a specific year, it is best from my experience to search for the ID of the club that you know has been put in in a specific year. Then you can work from there, as all the histories for each seperate league are grouped together and they are listed chronologically.


Now you can either add league history by overwriting histories of nonplayable leagues (since they don't show up in any way in the game) or add new histories at the end of the file. If you do add histories instead of overwriting other ones, then don't forget to increase the number of succession by 1 from the previous.

Furthermore, you will now have to open up index.dat as well so that EHM recognises the new histories that you have added. Do a search for club_comp_history.dat Two or three rows below, you will find last number of succession + 1. In the original, unedited file it is BF 07 00 00. You have to increase this by the number of histories that you have added. So if you have added 5 histories, then the new number is C4 07 00 00.


Best of luck editing! Next up are gameplay modifications, so codes determining import restrictions and league structure.
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

Re: Tutorials for hexediting EHM

Post by nino33 »

Thanks s much for figuring this out, and posting a tutorial!
Hobbit13 wrote:For my first tutorial, I will show you how to edit retired numbers
What if I don't want to "add" retired numbers, but rather "remove" retired numbers - for the 1974 db I'd like (eventually) to edit things so the retired numbers match-up to what they were back in 1974 if possible, so I'll need to "unretire" numbers...

Thanks Much
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Tutorials for hexediting EHM

Post by Hobbit13 »

nino33 wrote:Thanks s much for figuring this out, and posting a tutorial!

What if I don't want to "add" retired numbers, but rather "remove" retired numbers - for the 1974 db I'd like (eventually) to edit things so the retired numbers match-up to what they were back in 1974 if possible, so I'll need to "unretire" numbers...

Thanks Much
I would recommend setting the team ID to FF FF FF FF. I'm haven't tested so I can't be 100% sure but it should work.

EDIT: And for you to remove league history, I would recommend replacing the league ID and possibly the team IDs with FF FF FF FF as well. For you specifically, when you open up club_comp_history.dat, do a search for B6 07 (which is the year 1974), and "delete" the histories after that until you the year 2006 (D6 07 in the file).
Hobbit13
Junior League
Posts: 37
Joined: Fri Jul 13, 2007 12:05 pm
Custom Rank: UUDB & Hex Man!

Re: Tutorials for hexediting EHM

Post by Hobbit13 »

Hi, I'm in quite a rush since I'm leaving in a few hours to Peru (which sadly means I won't be able to edit EHM for the next few weeks). So here I'll just quickly show you where I found the edits for leagues:

Firstly, lineup rules:
The rules are saved in places that are called: ..._rules.cpp (e.g. ...czech_rules.cpp)
Here is a picture highlighted with the part that changes lineup rules:
Image

You can try comparing it to other leagues, it is always in the same location for each league. You may find repeating parts for the same nation, such as the Czech Republic having 3 repeating blocks (each of them starts with 3R 3R 3R), well the last one always edits the highest tier league. Alessandro will upload the word document with all the lineup rules for all the different leagues. That way you can compare if you found the correct part or not.
Changing this value has an immediate effect on your game, even on a save game that you're in the middle of.


To change the league structure, you have to scroll further down in the exe or rather search for e.g. slk_elite.cpp. In the picture below, I've underlined the parts to edit:

Image

The first underlined part is required if you change league structure (I don't know it's exact function but simply without it, the playoffs never start). The second changes the schedule as well as the way the playoff structure. The third one changes the number of teams in the league and the last one the league structure (so how many teams qualify for the playoffs, then also what type of overtime is played and maybe even more).

Changing these values only has an effect when the game updates its data. So when you start a new game or on the 28/29th June each season.


So to find out about the specific parts of these rules (such as the lineup rules), you have to use Olly and then the function "Follow DWORD in Disassembler" as I've shown in the other thread.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: Tutorials for hexediting EHM

Post by archibalduk »

That's a really helpful guide. Thank you and enjoy Peru. :)
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Tutorials for hexediting EHM

Post by Alessandro »

From Marek:

Hex values for lineup rules

Austrian no restrictions:
F0 20 8F

Austrian 6 foreigners:
C0 FF 8E

Czech 3 foreigners:
30 24 8F

Danish no restrictions:
C0 28 8F

Finnish 4 foreigners:
E0 2B 8F

French no restrictions:
D0 1D 8F

German 11 foreigners + 5 min 25 yr-olds:
E0 1C 8F

Italy no restrictions: (when tested, it resulted in max 3 non-EUs)
10 0F 8F

Norwegian 9 foreigners: (when tested, it resulted in max 89 foreigners)
60 0B 8F

Russia 3 foreigners + 2 min 20 yr-olds:
10 05 8F

Russia 3 foreigners + 2 min 22 yr-olds:
20 04 8F

Slovakia 4 foreigners + 1 min 20 yr-olds:
B0 00 8F

Slovenian 6 foreigners:
C0 FF 8E

Sweden 2 non-EUs:
70 FA 8E

Switzerland no restrictions:
30 E4 8E

UK 11 foreigners:
20 12 8F

UK EIHL 10 foreigners:
30 19 8F

UK EPIHL 4 foreigners + 0 non-EUs:
70 14 8F

OHL max 3 overagers:
B0 44 8F

QMJHL max 3 overagers:
30 3D 8F

WHL max 3 overagers + max 3 players younger than 16:
F0 40 8F

Other Canadian junior leagues: max 6 overagers + min 4 rookies with less than 30 junior games
A0 36 8F

LNAH no restrictions:
30 E4 8E

UHL: min 3 rookies with less than 40 pro games + max 7 veterans with over 300 pro games
00 48 8F

Central Hockey League: min 5 developmental players with less than 128 pro games + max 4
veterans with over 280
90 4D 8F

ECHL max 4 veterans with over 260 pro games:
60 54 8F

AHL max 5 veterans with over 260 pro games:
40 5C 8F

NHL no player restrictions:
90 5F 8F

Further codes:
11 foreigners:
20 1A 8F

No player restrictions:
F0 20 8F

Like RSL (3 foreigners + 2 min 20 yr-olds):
20 04 8F

89 foreigners:
D0 FC 8E

Order of leagues:
Begins after austria_awards.cpp with Swiss rules, which seem to be impossible to change

After switzerland.cpp, two unknowns

After Sweden:
Controls all Swedish leagues

Slovenia:
No effect (most likely other Slovenian leagues)
International Ice Hockey League
Slovenian Elite League

Slovakia:
Other Slovakian
Slovenska T-Com Extraliga

Russia:
Other Russian
Russian Superleague

Norway:
Other Norwegian
Norwegian UPC-Ligaen

Italy:
No effect
No effect

UK:
Other UK

UK EPIHL:
English Premier Ice Hockey League (including English Premier League Cup)
Elite Ice Hockey League (including British Challenge Cup)

Germany:
Other German
DEL

France:
No effect
No effect

Austria:
Other Austrian
Austrian Erste Bank Eishockey Liga

Czech Republic:
Other Czech
Czech First Division
Czech Elite League

Denmark:
Other Danish (including Danish Cup)
Danish Oddset Ligaen

Finland:
Other Finnish
Finnish Suomi Division
Finnish Mestis
Finnish SM-League
Last is British Columbia Hockey League

Alberta Junior Hockey League
Saskatchewan Junior Hockey League
...

New letters:
Ť - 89
ť - 9D
User avatar
YZG
Second Line
Posts: 682
Joined: Mon Aug 16, 2010 11:17 pm
Custom Rank: DHM Head Researcher
Location: Canada

Re: Tutorials for hexediting EHM

Post by YZG »

Alessandro wrote: New letters:
Ť - 89
ť - 9D
I find this part intriguing. Does that mean that the game actually has what it takes to recognize some letters with diacritics but somehow doesn't (can't remember if those two particular letters actually correctly display or not in the game)? I've always thought it was deeply absurd to be able to use, for instance, the letter "č" but not the letter "ć". At first I thought they only included letters from languages of playable leagues, but you do get both of these in Slovenian, while several Czech and Slovak names often did not properly show up because one unrecognized letter (ř, notably) was replaced by a square.

- YZG
User avatar
Lazion
Second Line
Posts: 661
Joined: Tue Oct 23, 2007 5:34 pm
Favourite Team: Flyers

Re: Tutorials for hexediting EHM

Post by Lazion »

Some useful values for league structure in team/division number section here:
No olly used so there might be more

30 - 90 09 8F
27 - D0 ED 88
25 - 90 66 88
22 - 30 4E 90
21 - A0 B9 88
20 - C0 E3 8E
19 - 60 53 94
18 - 20 F2 93
17 - 10 09 88
16 - 70 C1 94
14 - B0 66 92
13 - 60 DD 90
12 - 30 39 92
12 - 80 A6 92
12 - 70 DD 90
10 - 20 5E 8F
10 - DO DF 92
9 - E0 03 92
8 - 10 38 93
5 - 50 22 93
4 - 80 F3 91
4 - 70 F3 91
3 - 00 2D 8F
1 - D0 6B 8F
0 - D0 5A 8F
______________
1 - D0 98 94
1 - A0 5B 92
1 - 90 3A 92
1 - D0 E5 93
sylph
Junior League
Posts: 5
Joined: Sun Oct 16, 2011 10:05 am
Custom Rank: Permanently banned.
Location: Latvia

Re: Tutorials for hexediting EHM

Post by sylph »

Can't seem to change anything for khl (russia_rules.cpp). Works on nhl, though. What could be the problem? :-(
Nevermind. :-) :-) :-) :-) :-) :-) :notworthy:
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Tutorials for hexediting EHM

Post by Alessandro »

sylph wrote:Can't seem to change anything for khl (russia_rules.cpp). Works on nhl, though. What could be the problem? :-(
Nevermind. :-) :-) :-) :-) :-) :-) :notworthy:
Care to share what you achieved?
sylph
Junior League
Posts: 5
Joined: Sun Oct 16, 2011 10:05 am
Custom Rank: Permanently banned.
Location: Latvia

Re: Tutorials for hexediting EHM

Post by sylph »

Since I played only with the KHL, I edited the KHL with pre-game editor and moved it to a country of my own choice which had the particular league rules, et cetera, checked in that country, which had the rules I wanted, when starting a new game, checked in "Russia".. and, voila.
Had to do a bit of research before it hit me that the .exe doesn't contain the rules for a particular league, more like the leagues in the country itself (except for nhl). :-)
User avatar
BladeRunner
Junior League
Posts: 21
Joined: Sat Oct 23, 2010 4:29 pm
Location: Slovenia

Re: Tutorials for hexediting EHM

Post by BladeRunner »

Hey...

I am amusing myself with HxD and i've mastered the lineup rules... But i am stuck with roster rules - can anyone give me a hint pls?
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Tutorials for hexediting EHM

Post by Alessandro »

BladeRunner wrote:Hey...

I am amusing myself with HxD and i've mastered the lineup rules... But i am stuck with roster rules - can anyone give me a hint pls?
What are you exactly trying to do and with what results? If you have any IM (gtalk, icq, etc) we can talk
User avatar
BladeRunner
Junior League
Posts: 21
Joined: Sat Oct 23, 2010 4:29 pm
Location: Slovenia

Re: Tutorials for hexediting EHM

Post by BladeRunner »

I am actually not doing some big patches, but i am playing with HxD, cus i wanted to do so for a long time and EHM is a great chance of doing so...

I have only one goal: to remodify Austrian Erste Bank Eishockey League to have new rules - roster and lineups. Secondly what am i trying to do is to change league structure to 11 teams and 44 regular games. But the second thing its just a thing and there is a chance that cus of my job i wont manage to get trought it.

I am working in HxD by night in my nightshif during work ;) in which time zone are u?

edit: i am trying to remove the number of maximum players on roster (25) and to remove maximum number of foreign players on roster (6). Lineup rules i changed: max 11 foreing players allowed.
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Tutorials for hexediting EHM

Post by Alessandro »

We are hardly working in having an Austrian league with 12 teams. We managed to do it, even if it's not perfect.
I am in the same time zone as Slovenia.
User avatar
BladeRunner
Junior League
Posts: 21
Joined: Sat Oct 23, 2010 4:29 pm
Location: Slovenia

Re: Tutorials for hexediting EHM

Post by BladeRunner »

Congrats!!!! The 12th team will be?

Innsbruck?

edit: So, can anyone point me in direction towards roster rules?
User avatar
Alessandro
Olympic Gold
Posts: 2865
Joined: Sat Aug 27, 2005 1:54 pm
Custom Rank: TBL Rosters Man
Favourite Team: Team Russia
WHL Team: Calgary Flames

Re: Tutorials for hexediting EHM

Post by Alessandro »

We simply added Alba Volan, Zagreb, Olimpija and Znojmo. So, do you have icq or smth like that? Talking live would be easier
User avatar
BladeRunner
Junior League
Posts: 21
Joined: Sat Oct 23, 2010 4:29 pm
Location: Slovenia

Re: Tutorials for hexediting EHM

Post by BladeRunner »

Ofc. In real world Innsbruck went to play in National liga (second league) cus of financial problems. Nevertheless it will be fun to play with them again :)

btw: i have gtalk and skype ;) but i wont have time, cus i am working over weekend, got some contract work in Ljubljana. I am patient ;)
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

Re: Tutorials for hexediting EHM

Post by nino33 »

RE 1974 db

Woo Hoo! I've managed to remove 1975-2006 history! Thanks much Marek for your excellent tutorial! And in particular your specific help for me.....Very cool!

:joy:

EDIT
And now I've been successful editing ("deleting") retired numbers! Again, thanks so much for the tutorials!
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

Re: Tutorials for hexediting EHM

Post by nino33 »

Is there a known way of editing the team records?
Records like most team points in a season, or most shutouts in a season by a goaltender for a given team...

Using the above tutorials I've been able to correct team history in terms of cups won, and I've removed retired numbers (i.e. Bernie Parent and Bobby Orr can actually wear #1 and #4).....but I noticed individual team records seem untouched (for example, the NY Rangers still show 112 PTS 1993-94 for "Most Points" and 42 Mike Richter 1993-94 for "Most Wins" by a goaltender).

I am aware of the record_config file that I can edit for NHL (league wide) Records and intend on editing it..... within the record_config file it says"Club Records are now stored in the database, they can still be added to this file by the user where records do not exist" - can I edit the club records stored in the database?

Regards
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: Tutorials for hexediting EHM

Post by archibalduk »

Yes it should be possible (haven't tried it myself though). Club_records.dat is the one you'll need to look at. The structure is as follows:

Code: Select all

struct DB_CLUB_RECORDS
{
LONG	 ClubRecordsID;
CLUBS_PTR	 ClubRecordsClub;
SHORT	 ClubRecordsMostTeamPoints;
SHORT	 ClubRecordsMostTeamPointsYear;
CHAR	 ClubRecordsMostTeamWins;
SHORT	 ClubRecordsMostTeamWinsYear;
CHAR	 ClubRecordsMostTeamLosses;
SHORT	 ClubRecordsMostTeamLossesYear;
SHORT	 ClubRecordsMostTeamGoals;
SHORT	 ClubRecordsMostTeamGoalsYear;
SHORT	 ClubRecordsMostTeamGoalsAgainst;
SHORT	 ClubRecordsMostTeamGoalsAgainstYear;
SHORT	 ClubRecordsLeastTeamPoints;
SHORT	 ClubRecordsLeastTeamPointsYear;
CHAR	 ClubRecordsMostTeamTies;
SHORT	 ClubRecordsMostTeamTiesYear;
SHORT	 ClubRecordsMostPlayerGoalsSeason;
SHORT	 ClubRecordsMostPlayerGoalsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerGoalsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerGoalsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerGoalsSeasonStaffSecondName;
SHORT	 ClubRecordsMostPlayerAssistsSeason;
SHORT	 ClubRecordsMostPlayerAssistsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerAssistsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerAssistsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerAssistsSeasonStaffSecondName;
SHORT	 ClubRecordsMostPlayerPointsSeason;
SHORT	 ClubRecordsMostPlayerPointsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerPointsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerPointsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerPointsSeasonStaffSecondName;
SHORT	 ClubRecordsMostPlayerPenaltyMinutesSeason;
SHORT	 ClubRecordsMostPlayerPenaltyMinutesSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerPenaltyMinutesSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerPenaltyMinutesSeasonStaffFirs tName;
CHAR_PTR	 ClubRecordsMostPlayerPenaltyMinutesSeasonStaffSeco ndName;
UCHAR	 ClubRecordsMostPlayerWinsSeason;
SHORT	 ClubRecordsMostPlayerWinsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerWinsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerWinsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerWinsSeasonStaffSecondName;
UCHAR	 ClubRecordsMostPlayerShutoutsSeason;
SHORT	 ClubRecordsMostPlayerShutoutsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerShutoutsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerShutoutsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerShutoutsSeasonStaffSecondName ;
SHORT	 ClubRecordsMostPlayerRookiePointsSeason;
SHORT	 ClubRecordsMostPlayerRookiePointsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerRookiePointsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerRookiePointsSeasonStaffFirstN ame;
CHAR_PTR	 ClubRecordsMostPlayerRookiePointsSeasonStaffSecond Name;
SHORT	 ClubRecordsMostPlayerGamesCareer;
STAFF_PTR	 ClubRecordsMostPlayerGamesCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerGamesCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerGamesCareerStaffSecondName;
SHORT	 ClubRecordsMostPlayerGoalsCareer;
STAFF_PTR	 ClubRecordsMostPlayerGoalsCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerGoalsCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerGoalsCareerStaffSecondName;
SHORT	 ClubRecordsMostPlayerAssistsCareer;
STAFF_PTR	 ClubRecordsMostPlayerAssistsCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerAssistsCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerAssistsCareerStaffSecondName;
SHORT	 ClubRecordsMostPlayerPointsCareer;
STAFF_PTR	 ClubRecordsMostPlayerPointsCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerPointsCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerPointsCareerStaffSecondName;
SHORT	 ClubRecordsMostPlayerPenaltyMinutesCareer;
STAFF_PTR	 ClubRecordsMostPlayerPenaltyMinutesCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerPenaltyMinutesCareerStaffFirs tName;
CHAR_PTR	 ClubRecordsMostPlayerPenaltyMinutesCareerStaffSeco ndName;
SHORT	 ClubRecordsMostPlayerWinsCareer;
STAFF_PTR	 ClubRecordsMostPlayerWinsCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerWinsCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerWinsCareerStaffSecondName;
SHORT	 ClubRecordsMostPlayerShutoutsCareer;
STAFF_PTR	 ClubRecordsMostPlayerShutoutsCareerStaff;
CHAR_PTR	 ClubRecordsMostPlayerShutoutsCareerStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerShutoutsCareerStaffSecondName ;
SHORT	 ClubRecordsMostPlayerRookieGoalsSeason;
SHORT	 ClubRecordsMostPlayerRookieGoalsSeasonYear;
STAFF_PTR	 ClubRecordsMostPlayerRookieGoalsSeasonStaff;
CHAR_PTR	 ClubRecordsMostPlayerRookieGoalsSeasonStaffFirstName;
CHAR_PTR	 ClubRecordsMostPlayerRookieGoalsSeasonStaffSecondName;
};
It looks complicated, but if you ignore the SHORT/CHAR_PTR/etc and concentrate on the actual field names then you'll see how the each record within the dat file is structured.

I had a quick look in HxD and can see that each record is 257 bytes long. If you look at the top of the HxD window there are three drop down boxes / text boxes. If you enter 257 into the first one then you'll be able to see one record per row.
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

Re: Tutorials for hexediting EHM

Post by nino33 »

Thanks Much! :thup:

I was able to open the file and then get it set up as you suggested - now I'd need to spend the time figuring out what everything means! I now know some Team IDs (from dealing with retired numbers) but that's it!
I think the amount of time and effort I'd have to put in is to much right now, given the amount of "general editing" I still have in front of me, so I don't see this occuring anytime soon...

AND I'm not sure exactly what to do.....I suspect that some of the letters/numbers are Team IDs, some are Player IDs, and some are the numbers (i.e.goals scored, or year the record occured).....

:-)
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: Tutorials for hexediting EHM

Post by archibalduk »

Yeah it would be a big task to edit. To be honest, the best way to edit it would be to first export the staff, names and team .dat files so that you can figure out what ID each player/team has (this is something I'm interested in doing once I have time).

You're exactly right that some of those fields are text, others are numbers and others are ID numbers relating to other data (e.g. Player IDs). The CHAR/SHORT/LONG/etc to the left of each record name indicates what type of data is stored in each. Before I explain roughly what some of them are (I'm still a relative novice at this), you need to understand what hexadecimal is:

All data in computers is stored as binary (i.e. strings of 0s and 1s). Hexadecimal is a way of representing binary in a more understandable format. One hexadecimal character is a way of representing 16 bits:

[table][tr][th][/th][th]1[/th][th]2[/th][th]3[/th][th]4[/th][th]5[/th][th]6[/th][th]7[/th][th]8[/th][th]9[/th][th]10[/th][th]11[/th][th]12[/th][th]13[/th][th]14[/th][th]15[/th][th]16[/th][/tr]
[tr][td]Hexadecimal[/td][td]0[/td][td]1[/td][td]2[/td][td]3[/td][td]4[/td][td]5[/td][td]6[/td][td]7[/td][td]8[/td][td]9[/td][td]A[/td][td]B[/td][td]C[/td][td]D[/td][td]E[/td][td]F[/td][/tr][/table]

In a 32 bit piece of software (such as EHM 2007) there are 32 bits in a byte. As one hexadecimal character represents 16 bits, a pair of hexadecimal characters represent 1 byte (in other words, 32 bits). This is why when you look in a hex editor the data is presented as pairs of hexadecimal characters.

The CHAR/SHORT/LONG/etc indicate the type of data stored and the number of bytes. For example, the ClubRecordsID field is a LONG field. A LONG field is 4 bytes long (i.e. four pairs of hex). Some of the other fields in that .dat file are SHORT (=2 bytes / two pairs of hex) and others are CHAR (=1 byte / one pair of hex). CHAR, SHORT and LONG are all fields that store numbers rather than text (IIRC).

Some of the field types have _PTR at the end. I'm fairly certain this means that the field is a pointer to another .dat file. For example, STAFF_PTR ClubRecordsMostPlayerWinsCareerStaff means that this field refers to a Staff ID from the staff.dat file. According to the database format provided by SI all _PTR fields are LONG (i.e. 4 bytes long).

Something to note is that all .dat files store the bytes in reverse order. For example, SHORT ClubRecordsMostPlayerRookieGoalsSeasonYear stores the year as two bytes (as I mentioned, SHORT = 2 bytes). 2011 in hex is 07 DB. When entering this into the .dat file you would have to reverse the pairs of hex - i.e. you would enter it as DB 07.

As the IDs already in the .dat files are already reversed, you don't need to reverse them again when entering them into the club_records.dat file. For example, if you had a player with ID# 01 DA 06 00 you would enter this in the ClubRecordsMostPlayerWinsCareerStaff (or what ever field you were looking at) as 01 DA 06 00 (i.e. you wouldn't reverse it to 00 06 DA 01 because it is already reversed).

Am I still making sense?! :mambo: :-D
User avatar
nino33
Mr. Goalie
Posts: 6088
Joined: Sat Aug 07, 2010 3:37 am
Custom Rank: Retro Rosters Specialist
Favourite Team: 1970s hockey

Re: Tutorials for hexediting EHM

Post by nino33 »

archibalduk wrote:Am I still making sense?!
Yes you are! I will want to tackle this at some point, so I appreciate any insight...
Post Reply