Hex for Dummies

Moderator: Altimit01

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Hex for Dummies

Post by sword » Tue Jul 11, 2006 3:20 pm

Ok, ok, I'll make this one as simple as I damn well can. It'll just consist of definitions of terms basicly.

Hex: A number system with 16 characters which are 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Thats all you need to know about it for modding.

Meta: The definition of an object. Its what you edit in HMT and any modding tools. Each object has a meta which defines what it can do and how it acts.

ID/Identity: Like the meta's ID card so to speak. Its what HHT edits for effects and that kind of stuff. Within a meta there will be ID's listed. When you see an ID listed in a meta, it means that another meta is being called into use. Ex. A vehi meta controls a vehicle and calls the collision model, visual model, animatino trigger, lights, and everything else to use within the vehi meta for any of the vehicles.

Offset/Address: The location of a specific byte in the file. Ex. 0x157 is the 157th byte in the file.

Longword: Most people call it a long for short. Anyway, its just 4 consecutive bytes. EX. 2A3B4C5D is one long.

Magic: The number that you subtract from any reflexive in the map to find where the reflexive is pointing to. Tools will generate the magic for you, but this is the equation to find it: magic = IndexMagic - ( header.OffsetToIndex + 40 )

Reflexive: 4 bytes that are in reversed order (Read them from right to left.) which, when the magic is subtracted from them, point to a specific place within the map file.

Little Endian: Basicly reversed order. Ex. Little endian swaps the order of things, so say DEEF was the little endian way of writing FEED. DE EF is the little endian version, FE ED is the way you reverse it so you can subtract the magic from it.

Reading XML files:

In the xml files it'll say this at first,

Code: Select all

<plugin>
<tag>weap</tag>
<struct>
<plugin> means its a plugin, <tag>weap<tag> says what tag the plugin is used for and <struct> I don't know. You don't need to know it though.

Ok, so, when in an xml file it says <offset> then the file is specifying where to find something within the meta. In other words when it says <offset>0x34</offset> its saying that its at the 34th byte in the file. Simple enough, isnt it?

Then, when it goes <type>, it will then specify how to represent something in the file. When it says <type>float</type> then it tells the tool to represent the long at the specific offset stated in that section of the xml file.

So, together it looks like this:

Code: Select all

<value>
<type>float</type>
<offset>0x3E0</offset>
<name>Magnification Range - To</name>
</value>
So, the <value> </value> represents the end of the thing you and the tool needs to read. the <type>float</type> tells the tools/you that you should represent the 4 byte value as a float, and the <offset>0x3E0</offset> tells you/the tool that its byte number 3E0 in the meta.

Now, you may see something that looks like this:

Code: Select all

<value>
<type>short</type>
<offset>0x22</offset>
<name>Rounds Per Shot</name>
</value>
So, its the same as the last one, but with one change. The value parts tell where to begin and end reading this part, the offset tells you what part its at, and the name says what it does. But, the difference is that it says <type>short<type> instead of float. Well, all that means is that you can edit it as a normal number, it doesnt have to be converted to a float. So, normally you would see at this offset, 01 00 00 00 which means one round is shot per shot. Well, to edit that, you just make the value whatever you want, making it 00 00 00 00 will make it shoot nothing, 05 00 00 00 will make it shoot 5 rounds, and so on. Its that simple.

Ok, there is another thing you should know. You'll see this too:

Code: Select all

<value>
<type>reflexive</type>
<offset>0x4FC</offset>
<name>Triggers</name>
</value>
So, what does that mean? You'll see that I defined how you use reflexives in hex modding. Well, all this does is tells you where the reflexive within the meta is. In this case, the reflexive is located at byte 4FC and it leads to the section which controls triggers. Now, when you look in the file there will be a preceding section that (usually) looks like 01 00 00 00. You don't really need to know what that means for this, just follow the reflexive right after that long, and you'll find the section your looking for.

Now, to convert hex to floating point intergers, which are known as floats, you'll need to use a float converter. Hell, I still don't know how to do it without a float converter, and I don't know where one for windows would be.

So, I hope this gives you a better idea about how to edit things in hex. If not, your a sillykins.

-sword
The sword.

Image

>Shadow<
Halo Moderator
Halo Moderator
Posts: 2734
Joined: Sun Apr 02, 2006 9:15 pm

Post by >Shadow< » Tue Jul 11, 2006 11:24 pm

Nice! Thanks sword!
Image

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Post by sword » Wed Jul 12, 2006 5:42 am

Shall I post it in the regular section?
The sword.

Image

?Demon?
SEAL
Posts: 649
Joined: Sun May 21, 2006 2:10 pm
Location: ur moms house lololoollloolol

Post by ?Demon? » Wed Jul 12, 2006 7:21 am

Excellent post. However there are still two things that I cannot understand.

1. In the weap.xml file of HMT Plugins, the fourth piece of information is:

Code: Select all

<value>
   <type>reflexive</type>
   <offset>0x4FC</offset>
   <name>Projectile</name>
</value>
So, I take the meta of a weapon, and add 4FC to it. I get a result, and I go to that location if the map file. I encounter two problems. The first of which is that in all of the weapons that I have tested so far the four bytes there are 01 00 00 00. The second problem is that I cannot subtract the Magic from that because the Magic is bigger than 01 00 00 00, and there cannot be a negative location.

2. What is a 'reference'? Judging by its name if refers to some othere part of the map file, which I am guessing to be a meta. The last entry in weap.xml of HMT Plugins is:

Code: Select all

<type>reference</type>
   <offset>0x94</offset>
   <name>Projectile</name>
<info>Projectile fired by this weapon</info>
There is also one more thing that I must ask. Why are there two entries in HMT Plugins about the projectile fired by a weapon?
Karahna wrote:I have a small penis. :(
PWNAGED! DON'T ASK ME MOD QUESTIONS OR I WILL JUST MAKE FUN OF YOU AND CALL YOU MEAN NAMES.

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Post by sword » Wed Jul 12, 2006 2:03 pm

sword wrote:Now, when you look in the file there will be a preceding section that (usually) looks like 01 00 00 00. You don't really need to know what that means for this, just follow the reflexive right after that long, and you'll find the section your looking for.
mmhmm. The reflexive is after the 01 00 00 00.

And I'm not sure about the two entries about the projectile.
The sword.

Image

?Demon?
SEAL
Posts: 649
Joined: Sun May 21, 2006 2:10 pm
Location: ur moms house lololoollloolol

Post by ?Demon? » Wed Jul 12, 2006 6:13 pm

I missed that somehow...... I encountered something which I find interesting. I used the pistol and rocket projectiles for this. When you take the 16 bytes that the reflexives are pointing to, and you replace the one of the pistol with that of the rocket, the pistol will become like the rocket launcher. (This is after making the pistol fire rockets by replacing the 16 bytes jorp code.) The screen will shake after firing, and the pistol will have to wait between firing shots, at the rate of the rocket launcher. None of this is CSS, but I still find it interesting.
Karahna wrote:I have a small penis. :(
PWNAGED! DON'T ASK ME MOD QUESTIONS OR I WILL JUST MAKE FUN OF YOU AND CALL YOU MEAN NAMES.

A Bunny
Operative
Posts: 186
Joined: Mon Feb 27, 2006 1:44 pm

Post by A Bunny » Fri Jul 14, 2006 8:15 am

Demon wrote: There is also one more thing that I must ask. Why are there two entries in HMT Plugins about the projectile fired by a weapon?
One is the reflexive that gets you to where the projectile structure(s) are set up, the other is the reference to which projectile that weapon is using contained within the projectile structure. Keep in mind that there can be more than one projectile structure in a weapon meta so the reflexive points to them both and the reference tells what's happening.

Hope that made sense.

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Post by sword » Fri Jul 14, 2006 2:12 pm

A Bunny wrote:
Demon wrote: There is also one more thing that I must ask. Why are there two entries in HMT Plugins about the projectile fired by a weapon?
One is the reflexive that gets you to where the projectile structure(s) are set up, the other is the reference to which projectile that weapon is using contained within the projectile structure. Keep in mind that there can be more than one projectile structure in a weapon meta so the reflexive points to them both and the reference tells what's happening.

Hope that made sense.
Hmm, I'm not exactly sure what you mean about "projectile structure" because that would more be the projectile meta, and within weapon metas, there is no exact refrence to a projectile meta, instead an ID is used which the game then links to the index, and then finds the meta. That eliminates the problems with reflexive - magic = offset within a meta if data is added before that specific meta.

And Demon, I see why I couldnt find what you were talking about before, I am using the PC plugins which are more detailed than the Mac versions. In the PC versions, some of the, what should I call them, names I guess, are different. IE there is only one reference to a projectile in the HMT PC plugins, and thats the projectile ID. What I believe your looking at for the reflexive there is more for projectile firing rate, spread, amount shot, etc.
The sword.

Image

A Bunny
Operative
Posts: 186
Joined: Mon Feb 27, 2006 1:44 pm

Post by A Bunny » Fri Jul 14, 2006 2:53 pm

sword wrote: Hmm, I'm not exactly sure what you mean about "projectile structure"
I use structure in the same way that the hmt plugins use it , a (not always) repeated data type of a fixed length that is referenced to by a reflexive (not quite sure if that's the textbook definition). In this case the "projectile structure" contains the rate of fire, accuracy, the ID of the projectile to be spawned, etc.

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Post by sword » Sat Jul 15, 2006 7:36 am

A Bunny wrote:
sword wrote: Hmm, I'm not exactly sure what you mean about "projectile structure"
I use structure in the same way that the hmt plugins use it , a (not always) repeated data type of a fixed length that is referenced to by a reflexive (not quite sure if that's the textbook definition). In this case the "projectile structure" contains the rate of fire, accuracy, the ID of the projectile to be spawned, etc.
Hmmm, really, in the weapon meta, that section about rate of fire and various definitions, I feel isnt as much of a projectile structure within the meta, but more of a weapon-projectile interaction structure which is within every meta. To me, projectile structure, sounds more like the actual projectile binary metadata within the mapfile. But, I'm not a programmer.

Oh, and your description of that section is right on, you've been doing a lot of work :) Finally, someone who knows more than how to edit a few simple things in hex, someone who understand somewhat of how the mapfile is structured and works. wooh.
The sword.

Image

A Bunny
Operative
Posts: 186
Joined: Mon Feb 27, 2006 1:44 pm

Post by A Bunny » Sat Jul 15, 2006 8:36 am

sword wrote:I feel isnt as much of a projectile structure within the meta, but more of a weapon-projectile interaction structure which is within every meta. To me, projectile structure, sounds more like the actual projectile binary metadata within the mapfile. But, I'm not a programmer.
Meh, potato potato... man, that expression doesn't work well online. :)

sword
Ranger
Posts: 1077
Joined: Tue Feb 07, 2006 6:53 pm

Post by sword » Sat Jul 15, 2006 11:59 am

Buddy Jesus, help us all!

Image

Wooh! Our sins are gone, and with a group hug!
The sword.

Image

?Demon?
SEAL
Posts: 649
Joined: Sun May 21, 2006 2:10 pm
Location: ur moms house lololoollloolol

Post by ?Demon? » Sat Jul 15, 2006 12:32 pm

:O
If we are going to be posting random pictures......
Image
Karahna wrote:I have a small penis. :(
PWNAGED! DON'T ASK ME MOD QUESTIONS OR I WILL JUST MAKE FUN OF YOU AND CALL YOU MEAN NAMES.

?mike?
Ranger
Posts: 768
Joined: Sat Apr 22, 2006 4:41 am
Contact:

Post by ?mike? » Sun Jul 16, 2006 4:11 pm

how dome i cant get this to work with game globals (matg)?

?Demon?
SEAL
Posts: 649
Joined: Sun May 21, 2006 2:10 pm
Location: ur moms house lololoollloolol

Post by ?Demon? » Sun Jul 16, 2006 8:04 pm

Are you trying tp change Master Chief's walking speed and such?
Karahna wrote:I have a small penis. :(
PWNAGED! DON'T ASK ME MOD QUESTIONS OR I WILL JUST MAKE FUN OF YOU AND CALL YOU MEAN NAMES.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests