TUTORIAL "HEXING 101" PART 3 On to PCTools! Part of PCT has a menu that allows you to select a file, then HEX EDIT the file. Actually, I also use the hex edit option to "look" inside of files, then I exit without any changes. This is very powerful - it allows you to "debug" a file without much tedious typing - a mouse performs most of the work. You can also freely jump back and forth, and correct any typos ON THE SPOT. This makes it 1k better than debug. Let's look at the P51D.SPC file using PCT -here's what you'll see on the first line (except this isn't wide enough, so I'll only do most of it): 0000 (0000) 50 2D 35 31 44 00 00 00 00 00 00 00 0B 00 06 2C Notice that the PCTools display has 3 sections, on the left are the addresses, in the middle are the first 16 byte values and the far right section (not shown above) has the ASCII equivalents of the 16 bytes. Notice also that the address code that translates best into debug is the one in the (), ie (0000). This first line runs from the beginning of the file (byte 0000, equal to debug 100) to the 16th byte 000F. Remember the first byte is zero, so the 16th is a "F" The addresses for each byte in the first row are: 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 000A, 000B, 000C, 000D, 000E, 000F. This equals to the addresses (in debug) of 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 10A, 10B, 10C, 10D, 10E, 10F. What this means is that every single pair of numbers, ie each byte value, has it's own address. When we discover what a certain byte does, we can tell each other by referring to it's specific address. For example, in the first line, the address (000C) or (debug 10C) has a value of 0B. This value, 0B, is the code for the P51D on the menu listing planes shot down at the end of a mission. A value of 0A here tells the computer that the plane shot down was a P51B. A value of 01, BTW, is for a Bf109G6. Notice also that the first 5 bytes look like this: 50 2D 35 31 44. These are the ASCII equivalent bytes for P (dash) 5 1 D. In fact, the first 11 bytes can be used to spell any name you'd like on the weapons selection menu. Now, switch your view down to address (00E8). (this is halfway across the 00E0 line). You will see the byte values 01 06 02 00 90 01 8B 08. This is actually the first half of the "weapons string" which is 16 bytes long. It continues on line (00F0) with 06 00 01 00 00 00 C8 00. Therefore the entire string goes like this: 01 06 02 00 90 01 8B 08 06 00 01 00 00 00 C8 00 half on one line, half on the other. All standard weapons in the game start at an xxx8 position, ie halfway across, in the areas from (00E8) to about (01A7). Let's examine this weapons string in depth. The first byte of each weapon string determines the type of weapon 01 here means mg/cannon. 02=bomb 03=rocket 04=drop tank 05=jagdfaust. The next byte, for us 06, accesses the 6th weapon listing in the BAMERSTR.PAC file, which means the weapons menu will read "6 x .50 cal" and "400 rounds" ammo. What if we were to change this 06 value to a 01? The weapons menu would now read 8 x .50 cal mg, but NOTHING else would change. You would still have all the characteristics of 4 x .50 cal. The point is, you can customize weapons. The third byte controls the tracer. 00=single 01=dual narrow 02=dual wide. The fifth and sixth bytes control ammo amounts. 90 01 = 400 rounds. (9x16s, plus 1x256) CONTINUED NEXT LESSON