Staredit Network

Staredit Network -> UMS Assistance -> Hex Editing - Section Lengths
Report, edit, etc...Posted by Tarh on 2004-11-21 at 20:50:27
I'm new to hex editing scenario.chk data files, but not to map making. I decided to learn for a small project of mine and I'm following the file specs from campaign creations.

In the definitions of the terminology, it defines type Long for point of reference. It states that at the end of the 4-char section header, there are 4 bytes reserved to the long value stating the length of the section.

In a basic melee map I am looking at, there is the section for the validation code as is defined in the file specs. The length of the section is defined as 10 04 00 00. I'm probably sounding very n00bish asking this but, how is this interpreted? Does this mean that the length of the section is 1004 characters, or 4001 characters, or is it the numerical values of the bytes' hex values added or what?

I'm so confused pinch.gif
Report, edit, etc...Posted by TheLostTemplar on 2004-11-21 at 23:19:59
If you wanna know anything about hexing, Message heimdal on aim.
Report, edit, etc...Posted by SA_Max71 on 2004-11-22 at 00:11:26
QUOTE(TheLostTemplar @ Nov 21 2004, 08:19 PM)
If you wanna know anything about hexing, Message heimdal on aim.
[right][snapback]102031[/snapback][/right]

THis is assuming Heim knowns anything about hex. I would answer your question, but with so many kinds of hex langues out there...

ADDITISION: I don't know much about hex. Please don't say I know a lot of stuff about hex editing.
Report, edit, etc...Posted by TheLostTemplar on 2004-11-22 at 10:13:50
Well of course heim knows about hexing....Personally i know very little about hexing but i could try to help.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-22 at 11:52:07
One byte is 8 binary bits in hex it is transfered to 2 didgets

So the example you gave us is 4 bytes.

I think so anyways i don't hex edit things, but i know hexadecimal
Report, edit, etc...Posted by .Coko[CK] on 2004-11-22 at 14:33:24
http://www.microcontroller.com/Embedded.asp?did=92

Try that. Convert the terms.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-22 at 14:43:25
Microsoft's Calculator can convert between those too. but i don't think he is trying to simply convert numbers to decimal.

The one he shows is 16 4 0 0 (if your counting them as seperate numbers i guess lol)
Report, edit, etc...Posted by Lisk on 2004-11-22 at 15:38:13
numerical values of the bytes' hex values added

i think that is
Report, edit, etc...Posted by Tarh on 2004-11-22 at 15:55:32
Through reverse math (subtracting the hex offset of the last digit of the number from hex offset of the last character of the section), I managed to find that the section with the hex codes 10 04 00 00 for the section length is actually 1040 characters long (that is in regular integers) . . . ? confused.gif

It seems that the second hex value, namely 04, has been reversed through string operations to 40. Then, the numbers seem to be added together as a string and converted to the integer form 1040.

On a hunch, I tried using this technique with other sections in vein. It seems that the other sections have section lengths with other strange patterns. blink.gif

The file specs I am reading say something like "a long is 4 bytes together with their hex codes organized from lowest to greatest". Um . . . ?

Now I'm even more confused pinch.gif
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-22 at 17:25:23
Oh i get it, not really. . . but now at least i understand your question.

I would of guessed you would arive at 4100
Report, edit, etc...Posted by Tarh on 2004-11-22 at 17:32:24
biggrin.gif Yay! I finally figured it out after trying a lot of different possibilities.

The answer? I know you are dying for it . . . tongue.gif

Using the example I posted, the verification code section (VCOD), the 4 bytes that declare the section length are 10 04 00 00. This is ordered in lowest to highest from the right to the left, so read from right to left using bytes as the whole, we get 00 00 04 10. Combining these as one long string gets 00000410, and converting it to a integer gets 410. Initially, I thought that this meant nothing. But this "integer" is actually another interpreted as another hex number ohmy.gif. Therefore, converting hex &H00000410 to an integer gets 1040 - the answer that the reverse math discovered. It is simply by coincedence that this section I chose for an example had all 4 numbers within it - and that is why I was so confused.

happy.gif
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-22 at 17:34:15
Oh i get it you got to reverse the direction the digets appear in. Thats weird.

Glad to have helped smile.gif [/sarcasim]
Report, edit, etc...Posted by BeeR_KeG on 2004-11-22 at 17:45:12
I know that a byte is 8 bits which are a simple 1 or 0.

So you telling me that through hex editing you are changing bytes which means that you are editing the smallest possible programable thing?
Damn hexediting must be very hard knowing which byte to change and stuff if what I said is true.
Report, edit, etc...Posted by Tarh on 2004-11-22 at 17:52:09
QUOTE
So you telling me that through hex editing you are changing bytes which means that you are editing the smallest possible programable thing?


Yes.

The file specifications I posted act as a guide to all of this. However, I need to know how to change the section length declaration (as defined in the specs) to be able to add any extra information.

It is not very difficult if you have the guide.

QUOTE
Damn hexediting must be very hard knowing which byte to change and stuff if what I said is true.


For a human with a guide, somewhat. For a human without a guide, impossible. For an application programmed by a human with a guide, simple as Pi (which, coincidentally, isn't so easy after all -- I just like using Idioms smile.gif ).

QUOTE
I know that a byte is 8 bits which are a simple 1 or 0.


Hex editing does not actually involve changing each individual bit alone, it simply involves changing the character code (0-255 converted to a 2-digit hex number) to represent something different.

Therefore, when you are changing color of player one to color #160 in a map (found in a section), you are changing a individual byte from the charcode 0 to the charcode 160 (A0).
Report, edit, etc...Posted by BeeR_KeG on 2004-11-22 at 18:01:33
So it's not so hard after all. You just need to know which specific byte to change and thats it.
Oh wait there are over 30k bytes in one map. Good Luck!
Report, edit, etc...Posted by Tarh on 2004-11-22 at 18:08:58
QUOTE
You just need to know which specific byte to change and thats it.
Oh wait there are over 30k bytes in one map. Good Luck!


If I know which specific byte I need to change, I know its section. Therefore, a simple search command will find the start of the section, and sorting through it based on the guide (usually takes 1 minute for the longest sections), you will find the byte you need and be able to change it. All of this can be done using Starforge but Starforge cannot help me with what I am attempting.
Report, edit, etc...Posted by notnuclearrabbit on 2004-11-23 at 23:00:32
I've been hexing my maps for a while now, but there's still 1 thing tripping me up; the sprite/unit properties bits. Can anyone help?
Report, edit, etc...Posted by Tarh on 2004-11-24 at 07:29:16
Using the file specs I posted in the first post, you can find everything about unit properties in the "UNIT" section.

I think I might have found where the sprite section is. Check out the "THG2" section, it appears to have a byte setting of 08 which allows the unit to become a single frame. Perhaps this is how starforge does it? There are other interesting things in here that I have not seen in starforge. According to this, could it be possible that a unit can have a "disabled" property?! blink.gif

EDIT: Added information about sprite section
Report, edit, etc...Posted by .Coko[CK] on 2004-11-24 at 16:22:19
Go to http://www.campagincreations.org and look at the StarDraft Tutorials, has huge amounts of information on all areas of Starcraft.
Report, edit, etc...Posted by notnuclearrabbit on 2004-11-26 at 02:39:38
Is there a complete bit list anywhere?
Report, edit, etc...Posted by .Coko[CK] on 2004-11-26 at 18:03:20
Should be in the StarDraft Tutorials, explore!
Report, edit, etc...Posted by Deathknight on 2004-11-26 at 19:42:59
30k bytes isn't much, I've been hexing Staredit.exe. wink.gif
Report, edit, etc...Posted by SA_Max71 on 2004-11-26 at 19:44:30
QUOTE(Ðeathknight @ Nov 26 2004, 04:42 PM)
30k bytes isn't much, I've been hexing Staredit.exe. wink.gif
[right][snapback]103759[/snapback][/right]

wouldn't blizzard have some sort of lock that would prevent that?
Report, edit, etc...Posted by notnuclearrabbit on 2004-11-26 at 22:02:50
I need a complete list... the one at CC doesn't list the 'Draw as sprite' bit...
Also, I too have hexed Staredit, but I probably wasn't doing anything near what you are.. All I did was change the patch it reads...
Report, edit, etc...Posted by Deathknight on 2004-11-26 at 23:42:53
QUOTE
wouldn't blizzard have some sort of lock that would prevent that?


That's like saying "Wouldn't Blizzard have some sort of lock that would prevent hexing of maps themselves?"

No, anything can be hexed.
Next Page (1)