Binary Manipulation in Eye of the Beholder II The Legend of Darkmoon by the Silver Rainmaker (mloux@rm42.ucc.uconn.edu) This information contained below will tell you how you can modify your characters through the use of binary manipulation. It will NOT tell you how to win the game, nor is it a hint file. If hints are desired, email me at mloux@rm42.ucc.uconn.edu or buy the hint book. Also, take note: The details within this document have been tested and found valid on IBM/MS-DOS compatible machines ONLY! I cannot vouch for the validity of these notes on any other type of machine. Those of you with other machines (Amiga, Mac, etc.) are welcome to try it, but don't come crying to me if it doesn't work. Now, in Eye of the Beholder I, there was one save file and one only. Now I am pretty sure the info contained herein WILL work on Eye of the Beholder I save files, in fact it was another cheat file like this one that made me try it on Eye II, but I say again, no promises. At any rate, in Eye of the Beholder II, there are several slots in which you can save your game, each with so many characters in which you can give it an individual name. At any rate, where in Eye I there was one save file, named EOBDATA.SAV, there are several in Eye II, one for each save slot, to be exact. These files have the names EOBDATAx.SAV, where x is a number 0 through 6, I believe. At any rate, the number on the end corresponds to the distance from the top slot in the game. Therefore the highest up will be EOBDATA0.SAV, the next one EOBDATA1.SAV, and so on, until the last one. Therefore, you must figure out which file contains the data you want to alter, and then make a backup copy of it. You don't have to, but if you mess up, and there is no data to restore, then you're stuck with it. I thought I would warn you in advance, so you don't do anything stupid. Now, you can either edit the backup file or the save file, it doesn't really matter. I edit my save file directly, namely because it saves time. If you edit the backup file, then you have to rename the original save file to a backup, then copy the backup file to the save file original name (Eye II WON'T know to look for BOB.SAV), then run Eye II. It's easier to just edit the save file directly, copying from the backup file in case you screw up. You might want to make several backup files, at different stages of the editing spree, in case you only want to back up one small step, rather than start over again. But you should be able to figure out this stuff from common sense, so I will get to the point. Now, you will need a hex editor of some kind. I use Diskedit myself, because it's nice and easy to use, and it supports a mouse. Oh yes, DISKEDIT is a part of Norton Utilities, and the version I use is 6.01. Very nice, but I am sure PC tools has something as well, and there are probably half a million editors out there in shareware land or by less known companies. Any recommendations should be sent to mloux@rm42.ucc.uconn.edu for newer versions of this text file. OK, let's start fiddling. Execute your editor and open the file in question. With most hex editors, there will be a series of two-digit hex codes to the left, and the ASCII equivalent to the right. It should look vaguely like the following: 3D 3D 3E 45 61 74 20 6D - 65 3C 3D 3D 00 00 00 00 ==}Eat me{==.... 00 00 00 00 00 01 49 72 - 6F 6E 41 73 73 00 00 00 ......IronAss... 00 13 13 64 64 12 12 12 - 12 11 11 13 13 10 10 7F ...dd.......... 00 7F 00 FF 00 06 00 02 - 19 35 09 00 00 C4 EF 03 ........5...... 00 88 0D 01 00 88 0D 01 - 00 64 1E 87 79 00 00 00 .........d..y... 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ Now, notice that most of the characters that are represented by hex numbers other than 00 do not show up. No need to really worry about that. As long as they are there on the hex side, you're ok. First of all, notice the first line. This represents roughly the title that appears in the save slot. This will most likely be in all capitals (I have already done some editing with this file, as you will see). Eye II automatically throws everything in caps, so the only way to get them otherwise is to do it yourself here. I will stress now that you want to do most of your editing on the hex side. Hopefully your editor allows you to edit in either hex or decimal areas. For names and such you can edit on the text side, but for the most part you want to play with the hex numbers. After the name, on the second line you will see the name of your first character (that is, the character in the upper left hand corner of your six. The next character would be in the upper right hand corner, then the center ones, left to right, and finally the bottom ones, left to right). This always starts with the hex character 01, so leave the character to the left of the name alone. Now, the name can take up 11 spaces, although I have never tested that. It might be wise to leave a byte free between the name and the abilities, which come next. You can type in the name any way you want, but make sure the characters not taken up by the name are left as 00. Next come the abilities of your character, in the order Strength, Percentage, Intelligence, Wisdom, Dexterity, Constitution, and Charisma. These all take up two bytes apiece, and I assume the first byte is current score, and the second byte is maximum score. Whatever the case, make sure they are the same. The numbers are in hex, so an 18 would be represented by 12, 19 by 13, and so on. Don't edit in the text side here, because you are dealing with byte values, not actual numbers. You won't see an 18 in the text, just the character with the value 18d or 12h (a control character in ASCII. 19d, or 13h, is the Carriage Return). Oh, by the way, the percentage is also in hex, but since 2 hex digits will give you a number as large as 255, you can represent anything from 1 to 100. So, 64h is the equivalent of 100d. Might as well jack them all of the way up if you're going to cheat. Now, this only works for fighters. If you do this to a mage, the game will ignore it. The abilities all take up 14 bytes right after the name. Next is the hit point value, also in hex, a null byte (00), and then the hit point value again, followed by another null byte (00). Once again, I'm guessing, but I think you have current hit points followed by maximum hit points (for injuries and such). Note the null byte following each. I assume so this is in case you reach a hit point total of 256 or higher, which could be feasible in Eye of the Beholder III. What will happen is the second byte, now null, will be used as the higher byte, much the way you add a 1 to the left end of a number, like when 99 goes to 100. More on this later, when we deal with the experience. Next, there are two bytes, one that might be high up, like FC or so, followed by one that should be null (00). I don't know what function these perform, but they seem to be way up there for NPCs and low for your generated characters. Next is a series of four bytes that are useful only if you really want to completely change your character: The first byte is the Race and Sex, with even numbers being male, and odd being female. Thus, 00 and 01 are human male and human female, respectively. Likewise, the elves take up 02 and 03, the half-elves have 04 and 05, the dwarves 06 and 07, the gnomes 08 and 09, and the halflings finish it off with 0A and 0B. The next byte following that is pretty important. It states the class of your character. I don't know all of them, but I have deduced that 00 is fighter, 01 ranger, 02 paladin, 03 mage, 04 cleric, and 05 is thief. The multi-classed also have a single digit, with 06 going to fighter/cleric, 07 fighter/thief, and so on. I don't know all of them, but Amber, the mage/thief on the priest level, is 0A. So you should be able to deduce the rest through experimenting, and I will most likely have more complete results in the next version of this file. The next byte is the alignment of the character, with 00 as lawful good, 01 neutral good, 02 chaotic good, and so on, ending up with 08 as chaotic evil. The next byte you really shouldn't tangle with unless you want to change the character's appearance. This byte selects the portrait used on the screen. I don't know which is which, but each portrait probably has its own two-digit hex code. Try different numbers and see what you come up with (hell, you might come up with the head of a monster!). I do know that the NPCs all have portrait numbers high up, around FE and FF or so. Most likely the character portraits are all down in the 00 to 30 range. The byte after that doesn't seem to do much, at least not that I can figure out, so I leave it alone. The next three bytes detail the character's level. You probably don't want to toy with these, as they will only be temporary (once the experience points reach the turning point of a certain level, they will put the character in that level, even if the level byte says he's three levels higher). Each byte represents the level in hex. Most characters will only have one of the three bytes used, unless they are multi-classed (yeah, one for each class, as three classes is the max you can have). Then after those three bytes is the experience for each class, which takes up four bytes apiece. Now, this is where it gets really tricky. The best way to compute these guys is to have a really good knowledge of hex, or to use a calculator that can readily convert between hex and decimal. I use an HP 28S myself. Now, this is tough. Take the four bytes, let's use an example from one of my files. Calandra (not shown above in the sample text) has an experience value here of C4 1E 05 00. Now, the right most byte is the highest byte. To figure out the decimal value, feed in the hex value byte by byte, starting with the right. So, you would punch 00 05 1E C4 into your hex calculator (in hex mode, silly) and convert to decimal. This will result in Calandra having an experience point value of 335,556 experience points, putting her at level 9. Now, if you want to have Calandra go up a level, the best thing to do is not to give her enough points to make her level 10. Rather, you want to put her at just ONE point below the next level, that way when she kills a monster next (or anyone in the party does), she will gain enough to go up automatically. That way her hit points are updated, as well as the levels, in the save file. Otherwise, you will confuse the program, and while you may have enough experience, you will probably not get a level increase, because the actual point boundary was never CROSSED, but avoided entirely. I really hope I am making sense. Now, to make Calandra 10th level, let's bump her up to one point below 10th level boundaries, which are 500,000 for a fighter. So, punch in 499,999 in decimal to your calculator, and convert to hex, which should give you the value of 00 07 A1 1F. You would then go to the hex codes (on the left side, of course) and punch them in backwards: 1F A1 07 00. Note that you are not punching in the ENTIRE number in reverse, just the bytes. So if you punched in F1 1A 70 00, you would completly screw your character up. In fact, you might find the experience point value drastically different than what you intended. Just thought you should know. That is what makes it so tricky. Note that the fourth digit will probably be unused, unless you have a very high experience level. This will most likely be used in Eye of the Beholder III, when you will probably be level 15 or higher. Or, because the numbers are exponential, you might not see it until Eye IV or so (assuming they make an Eye III and IV. They BETTER). For those of you who do not have hex calculators, there is a way to figure out what you want, but it's pretty tricky. Each hex digit in a number, like a decimal number, is nothing more than a digit from 0 to 10 (including A through F in hex) multiplied by a power. For example, using decimal, 1 is actually 1 times 10 to the power of 0 (which is 1). 10 is actually 1 times 10 to the power of 1 (10) added to 0 times 10 to the power of 0 (1), resulting in 10. Therefore, 15 would be 1 times 10 to the power of 1, plus 5 times 10 to the power of 0, resulting in 10 + 5, or 15. Simple, right? One hopes so (not only will I tell you how to cheat at your game, I will have given an introductory course in hex math. Wild). Now the principle is the same with hex, only you use sixteen as the base, rather than 10. So, 01 is 1 times sixteen (or 10 in hex) to the power of 0 (still 1), 10 is 1 times sixteen to the power of 1 (sixteen) plus 0 times sixteen to the power of 0, resulting in sixteen (which is hex 10). Likewise, 01 00 is two- hundred fifty-six, 10 00 is four thousand, ninety-six, 01 00 00 is sixty-five thousand, five hundred thirty-six (I am spelling them out so you won't get the humber systems confused), and so on. You will notice that these numbers tend to resemble computer values in disk or memory size. That should make sense. At any rate, to figure out the value of Calandra's experience, we would take the number shown in the file, C4 1E 05 00, write it backwards (sort of), 00 05 1E C4, and then convert it. 00 can be discarded, as can the first 0 in the next byte. That leaves us with 5 times 16 to the power of 4 (65536d), plus 1 times 16 to the power of 3 (4096d), plus E (14d) times 16 to the power of 2 (256d), plus C (12d) times 16 to the power of 1 (16d), plus 4, which should result in what we had up above, 335,556. It is a hell of a lot more tedious, and converting back is an even bigger pain, but if ya have to.... That covers the experience part. The rest is shaky, but I do know that there is a great deal of space between the abilities, and the physical possessions on a character. I can only assume that each item has it's own two-digit hex code, and the location in the file pertains to the location on the character's person. Now obviously there are some places that will not accept certain items (putting boots on as armor, and the like), so if you mess with those, you could cause certain items to disappear. At any rate, I plan to experiment with that next, and see what happens. What I will need to do is compile a list of items and their respective hex codes, and then list the places in order on the file. Most likely they progress logically in the file, much the same as the characters do. It's easier on the programmers to promote order, especially when it comes to debugging. And finally, there must be a location section, that states where the characters are in the dungeon, what level, what square, what doors are open, what monsters have been killed, do they have the mark of darkmoon, do they have the pieces of talon, have they trapped the medusas, what doors are open, etc etc etc. Because this stuff is all incomplete, I plan to do more research at a later date. For now, I will be content with what I have here, and hopefully you all will too. Any questions, comments, money (just kidding), can be sent to mloux@rm42.ucc.uconn.edu or INFOSY11@UCONNVM (bitnet). Or you can write me at: Michael J. Loux, Jr. 46 Tracy Rd. Canterbury, CT, 06331 phone number (203)-546-6395. Work phone (203)-486-1406. You'll probably get voice mail. That's it! I hope this helps you all out! I enjoyed delving into the guts of this game, and will probably do so for other games in the future, now that I know how... -Mike P.S. I always enjoy feedback, so email me, even if you didn't find this useful! I'm always fond of correspondence or conversation, or just plain hint-swapping. Like I said before, I DO have a ton of hints, and am considering writing a hint file for EOB II. If I get enough requests for it, I will most likely do so. Take care, and stay cool. - o -