Hex Editing savegames

Chat about "The Legend of Skullkeep", the true sequel to the original Dungeon Master.
This forum may contain spoilers.
Forum rules
Please read the Forum rules and policies before posting.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Hex Editing savegames

Post by purple1 »

I downloaded a hex editor (HexEdit 1.7.4) for Mac OS 9. I have opened up a save file to edit. Can someone help me get started editing my save data?

Specifically, I'm looking for the locations of items in inventories. The Mac version may be different than the PC (I'm sure it is)
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

There is an breakdown of the DM listing available somewhere, but even then that's the dungeon, NOT the saved game - but will let you see the rough format it used to use - i think I recall it still uses a similar format

Can I suggest you save a game, pick up an object, save the game, then check out all the changes between the two.
Preferably do it right at the start, when there is less monsters around and events going on...this should give you much less changes to track down
I dont' know how much use it owuld be, but the hex guide i did had hex codes for items, etc (based on Dmute values). This might let you spot items better - for examle a potion or weapon - example, potions are usually an eight digit hex, in couplets, ID, 20 (potion), power, potion type (90 - 99 i think)

Sorry, that might get you started (on the wrong track?) until some real talent can come along : )

In DM, there was a four digit word for the checksum - any change you make in the dungeon had to then alter this checksum number
So for example if you altered a text by deducting 20 from somewhere, then you had to deduct 20 from this chcksum at the end.

Good luck!
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I was hoping someone had already figured out the numbers for items and stuff. But thank you! I hope I can find the checksum and deal with it!
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I started a fresh game and saved immediately. I took 1 step forward and saved again, and then compared the two side-by-side with HexEdit. I hit my first stumbling block: one small step causes large amounts of information in the save to become offset by 4 hex characters. Other large areas of data all drop by 1 digit for an unknown reason. Finding the exact area that tells x/y coordinates might take forever.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

As I said, the DM - DM2 numbers might not be so differnet, so if you check out my hex guide, then you can get object numbers. The encyclopaedia - it's in technical info, data format - has a very good break down, so might let you see the format for items lists at the start - it shouldnt' change too radically to start with

I guess the next step would be dropping a coin out of your inventory and checkign that instead

The huge changes could be counters, etc all starting up the second you move or start...

Oh well, good luck! In such small steps did things liek Dmute and therefore RTC come about!
User avatar
cowsmanaut
Moo Master
Posts: 4378
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

I found on the net one day a tool to edit DM2 save games. Characters only. all of their stats. Not sure where it is these days.. I think it was called DM2edit.exe.. (shrug)
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I'm currently exploring Pandora's Box (a hex editor) as an alternative. It hacks into memory while programs are running, and it is built for my operating system setup (Classic mode in OS X). I've found ALL the stat values for Torham and changed them, minus stamina.

MANA and HEALTH max at 999 displayable, I think. I doubt they actually go higher.
STR, DEX, VIT, WIS, ANTI-FIRE, ANTI-MAGIC max at 220 displayable. I don't think they can go higher, either.

I can't find stamina. Displayed stamina is not the same as actual stamina
All stats share the first 5 same memory address characters: 087C6---.
EE2 - current health
EE4 - max health
EE6 - ?
EE8 - ?
EEA - current mana
EEC - max mana

EF9 - current strength
EFA - max strength
EFB - current dexterity
EFC - max dexterity
EFD - current wisdom
EFE - max wisdom
EFF - current vitality
F01 - max vitality
F02 - current anti-magic
F03 - max anti-magic
F04 - current anti-fire
F05 - max anti-fire
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Stamina is 10(dec) x the value - it's like 100 = 10.0, etc
Nice work finding stuff! Keep it up : )
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I strongly reccomend modifying stats to their max only AFTER you are done leveling up. Otherwise, the stats become unidentifiable. Eg. 999->900, 220/220 -> 220/10, etc.

My program will not let me browse the memory addresses, so I have to search for numbers. I've found the first digit of the stamina, and each increment raises stamina by 26... I don't get it.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

lol, me either! somehthing's going on...at least you can increment it though!
hmm, 26 is 25.5 rounded up, which is could mean what you think is the first digit of stamina isn't...it's the second. So you are effectively going 10(hex), 20(hex) etc which would be 256(dec), 512(dec) etc which = 25.6 and 51.2 stamina respectively...does this correspond?
Just a thought...
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Hmm. EE6 is the first digit for the hex (it's 2 bytes long).
If EE6 raises it by 26,
Then what does EE7 do?
I need to find the values again, and I'll check your theory.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

The max for stamina must be 999. 999(dec) is 03DD(hex).
What must be happening is they record everything 1 digit over and throw in a decimal.
3DD0 = 999.0?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Oops, yeah, i meant 01 00 (hex)
The data file stats at http://dmweb.free.fr/FFDungeon.htm say it's big endian, does that have any baring?
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Torham starts at 77 Stamina, so it must round up from 76.8, using this model (even though I don't really know if I'm doing it right...).

76.8 is 3*25.6
What would this look like in hex as we are theorizing? In 4 digits, please!
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Aaack! After selecting 4 people, the memory addresses are different! Instead of 087C6, its 08790!
I've found all 4 characters' stat addresses and written them down. I do not believe they are affected by what character you are using. However, they may be affected by how many people are in your party.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Never mind, missed your post, and of course it doesn't have a bearing

Hmm, that's just weird then! So they are multiplying it by 16 after convertion? Very odd. As you say, maybe creating a decimal (lol, decimal points in a hex system...) so it should be read 3DD.0 = 999.0
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Whoops! 999=03E7! My bad!
So, if Stamina has a hidden decimal point in it, then, like you said, 999 would be 999.0.
In hex, there are no decimal points (duh) so they simulate one by multiplying by 16.
999->9990, 03E7->3E70.

I really don't remember the difference between big and little endian, but I think I'm understanding how this is working. I just need to find Torham's stamina stat again and see if we are right.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

Maybe memory addresses are likely to be never the same and they could save the values backwards(hex wise)
6f780000 would then be 0000786f! I donno... good luck.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Soryr, distracted so missing posts when I type replies

76.8 -> 04CD?
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Actually, I found a conversion calculator.
999 -> 03E7, so 999 is really 3E70
768 -> 0300, so 768 is really 3000
How do I divide by 10?
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Nevermind, I think you've got it. I'm just confused.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I converted that back.
The game shows 77. We think it is 76.8. We also think that the first 3 digits are the number, and the last is a decimal place. 76.8 would be 04C.D (the .D is the decimal, being 8.) and turned into a decimal number, we get 717. So my hex editor sees 717 when the game sees 76.8 and rounds up. This is what I think is going on.

Actually, I just looked and that's not true. it isn't 04CD. We think in decimal. The real number must be 0030? I'm checking that.
Last edited by purple1 on Tue Jul 20, 2004 7:17 pm, edited 2 times in total.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

lol, you don't easily, you need to divide by 16s : )

So are these figures tying up ok?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Ah, ok - then you are managing to break it! Nice one!
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

Okay, I lost myself again.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I'm getting all these numbers wrong. I think.
This may take awhile. I just switched computers. I need to start everything up again and rethink this.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

I guess the question is what hex values are you inputing to get values out?
Can you manage to make changes lower than steps of 26 yet? I'm sure that stamina values start out multiplied, so that it should be 76.8(d) -> 768 (d) -> 0300 (h), rather than 76.8 -> xx.x(h)
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

No, I can't. At one point, I had on my list of values, the location of one hex digit of the max stamina value. I couldn't search for the other one. My program does not allow free browsing, so I have to input the decimal number I'm looking for and then go down the list. I know where the values should be, but I am having trouble seeing what the decimal translation of the hex version of the actual stamina is.

I think that you are right, and Torham's starting stamina is recorded as 0300(h), which would be 768 decimal. Now I need to search for 768 and hope I find it as a match for his max stamina.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I just looked for 768, and I didn't get a match for 4 digit hex.
I could try 2 digits, and then I would need to find 03, which is 3 in decimal.
User avatar
purple1
Adept
Posts: 237
Joined: Wed Jul 14, 2004 5:04 pm
Location: California, USA

Post by purple1 »

I got a hit! Woohoo! Torham's first digits are 03! Now I need to find the second ones, and this mystery will be solved.
Post Reply

Return to “Dungeon Master II: The Legend of Skullkeep (DM2)”