PDA

View Full Version : Hex Editing?


GrimTerror
12-28-2005, 12:49 PM
Ok, i keep hearing about it and have no clue what you're talking about.

From what i can gather, you use Hex Editing to alter things that are "Hardcoded." Hardcoded things seem to be things that are generally inaccessable to normal modders, things that we are not supposed to tinker with (The Forbidden Arts) that are essential to the game, and in editing them you would make major changes to the game (major as in REALLY major, not small thing like editing the iScript.)

So what is this Hex Editing then? It kinda reminds me of a smart Blonde:D You hear about it but you never see it (apologies to all blondes out there.)

loads_of_fun
12-28-2005, 1:39 PM
Ok, i keep hearing about it and have no clue what you're talking about.

From what i can gather, you use Hex Editing to alter things that are "Hardcoded." Hardcoded things seem to be things that are generally inaccessable to normal modders, things that we are not supposed to tinker with (The Forbidden Arts) that are essential to the game, and in editing them you would make major changes to the game (major as in REALLY major, not small thing like editing the iScript.)

So what is this Hex Editing then? It kinda reminds me of a smart Blonde:D You hear about it but you never see it (apologies to all blondes out there.)hex editing is going into the SC.exe w/
a hex editor and makeing changes like
the supply limit, how many inercepters/
scrabbes a carrier/reaver can have tops,
how long it takes the toss plasma shild
to "re-charge", how fast zerg unit heal,
ect

any how DoA if the best at that stuff, if
you wanna learn that stuff (as do i), then
i would ask DoA but, i've been looking for
some tuts but to no avail

btw: i like your new avvy

U-238
12-28-2005, 5:23 PM
But where could you get a "Hex Editor"

Frums-smurF
12-28-2005, 6:18 PM
Google maybe?

Holocaust
12-28-2005, 7:38 PM
But where could you get a "Hex Editor"
There's a Hex button in ICE,
I also believe DoA is currently working on a new Editor that deals with hardcoded things

loads_of_fun
12-28-2005, 8:02 PM
yea, he isPROJECT - SC FireGraft(renamed) - v0.4.0.1
This SC mem patcher will edit everything Memgraft did, plus many other items. Those include:
Cycle CASM
Modify Sp Mines, Scarab, Int. counts
Upgrades Modify/Custom(Tentative)
Enable cloak, Archon Merge/Dark Archon meld for all units
Remove Infestation, Repair restrictions
Modify Shield regen, HP regen, and Red-Zone burn time

Post or PM me with other things you might want. Note, I've made a cheap workaround for extra MPQ's.

BSTRhino
12-28-2005, 9:26 PM
The way I like to explain hex editing is... everything in computing is binary, and so can be represented as a whole lot of '1's and '0's, you know that right? So what you are reading right now is really just a whole lot of binary in the computer's memory. In computing, sometimes people end up working with binary, and what they've found is it's really long. I mean, each character I'm writing here is represented as eight bits, or eight '1's and '0's. For example, the letter A is stored as 1000001 in the computer's memory, B is 1000010, and every other letter has its own eight-bit combination. So you can just imagine, if you were to look at this entire paragraph's binary code all written out, it would very long, eight times longer than what you see here.

So, one thing computer scientists do is instead of looking at everything in binary, they look at them in hexadecimal, which makes things a lot shorter. So for example, the eight-bit binary string of 01001111 would be reduced to 4F in hexadecimal. 10000001 (that's the letter A) could be seen as 81 in hexadecimal, and 10000010 is 82 in hexadecimal. It's just another way of looking at binary, with each digit representing one of sixteen combinations (that's where the hexa comes from) in hexadecimal instead of 2 combinations like in binary (that's where the bi comes from).

So if you wanted to, you could look at anything that the computer stores in hexadecimal, because everything in computing is stored in as just '0's and '1's which can be displayed in hexadecimal. You could look at this message in hexadecimal, you could look at pictures of AJ in hexadecimal, you could even look at StarCraft's EXE code in hexadecimal. And from there, if you wanted to, you could start changing the hexadecimal digits. If you were looking at this message in hexadecimal, you could look for the parts of the hexadecimal code that go "81" and change them to "82" and that would replace the letter "A" with the letter "B" throughout this message. So, instead of seeing the name AJ, you would see the name BJ after this hex edit. The same principle applies to StarCraft, except StarCraft is many times more complicated.

So for example, you know the supply limit in StarCraft is 200, right? 200 is hexadecimal is C8 (I'm not going to explain how I got that here). So if you looked through all the hex (I'm going to drop of the -adecimal part now) of StarCraft you could search around and look for all the occurences of C8. The chances are, there will be many, the number 200 could surely mean many things besides the supply limit. But if you knew which C8 actually stored the supply limit, you could change it, and you'd end up with a different supply limit. Even more amazing is, you could change anything, because everything in a computer is binary code, and so there is the possibility to add new spells to the game, add extra features or even create hacks that reveal the entire map during multiplayer games. Everything in a computer is binary code, and all of that can be changed using a hex editor.

The real trick to hex editing is, how can you know which hex value actually stores what you what you want? StarCraft 1.13's binary code is a hex string that is 2,187,264 digits long. It's virtually impossible for you to find out which hex digits control what you want unless you know what you're doing. How do people ever find anything useful in there? Well, computer programs are man-made systems and so it's 2,187,264 digits of chaos, each hex digit is telling the computer something, and with enough skill and time, it is possible to work out what each hex digit is telling the computer, and isolate the parts that are useful.

However, as you have found out I'm sure, with hex editing comes the ability to edit EXE code and create all kinds of cheating programs and circumvent all kinds of copy protection systems and so on. So, generally we might make references to hex editing and tell you what is possible with it, but teaching you to reverse-engineer StarCraft is not something we do on these forums because there are people out there who would just love to create their own map hack and they far overwhelm the numbers of people who would use hex editing to mod StarCraft. So, if we did allow you guys to teach and discuss how exactly to reverse-engineer StarCraft, these forums would instantly attract StarCraft hackers, and that's not something we want here. There are some other forums that do allow that, and they are ridden with hackers as you can imagine, so these forums don't go down that path.

But I should say, I greatly support what DiscipleOfAdun does in case you're wondering, that's different from teaching you how to hex edit, which he's refused to do on these forums because he's smart and knows where the lines are usually drawn on most forums.

Ok, i keep hearing about it and have no clue what you're talking about.

From what i can gather, you use Hex Editing to alter things that are "Hardcoded." Hardcoded things seem to be things that are generally inaccessable to normal modders, things that we are not supposed to tinker with (The Forbidden Arts) that are essential to the game, and in editing them you would make major changes to the game (major as in REALLY major, not small thing like editing the iScript.)

So what is this Hex Editing then? It kinda reminds me of a smart Blonde:D You hear about it but you never see it (apologies to all blondes out there.)

lol, I responded to everything except the questions you asked. Okay, I explained what hex editing is above and what you can do with it. The word "hardcoded" has many meanings depending on the context, but for modding I would say it means that some particular functionality was implemented by Blizzard by coding it directly into StarCraft. Any computer program is divided into two parts - data and code. Data is things like arr\units.dat, any of the GRP files or anything in the MPQ. The code in general is the EXE part, although some of the EXE is actually data, like for example, in the EXE you'll find StarCraft's icon, which is obviously not code. There is also other data in the EXE too, like the buttons and techtrees which aren't code either.

Generally the way to tell whether something is hardcoded is to think, if Blizzard themselves wanted to change something, would they do it by changing the data or the code to StarCraft? If it's hardcoded they would have to go with the code. Like for example, if Blizzard wanted to increase the number of interceptors each Carrier has, it would have to change the code.

The difference between a modder and a hacker is, modders change the data while hackers change the code. That's why we don't talk about hex editing here, because generally it means changing the code. However, you can change data using hex editing, and that's not hacking. The first modders ever used to do just that, but now we have programs like Arsenal III that edit the files for us so we don't need to get out our hex editors.

One last thing, about your comment "major as in REALLY major, not small thing like editing the iScript". I don't know if that's necessarily true. I think what you can do with hex-editing compared to modding is just different, you can do big things with both.

GrimTerror
12-28-2005, 10:17 PM
Wow, talk about an I.T. lesson:)

But that was very informative and helpful Rhino...Thanks! It reminds me of something, but i don't exactly know what. Something that can be used for a good and honest purposes (editing reavers Scarab capacity) or evil and wrong purposes (Hacks and cheats.) Now that i think about it though, wouldn't it be alright to join one of the Hackers Hex-editing groups, but instead of using the knowledge to hack, use it to modify the data that is stored as code instead of data. That way we could take modding to a whole new level, like creating our own cheats (as blizzard have done, like Operation cwal as opposed to hacks.) That said, it cold be a bit dangerous to go too far with it and end up editing something we shouldn't and get into trouble...

Hasn't Blizzard made a statement about the limits of modding? Surely they know modders exist so it would seem logical for them to set down some limits for us. Not that i've seen anything in the way of content about modding from Blizzard though.

Edit: Nice Avy Rhino, i love to see them change with the times:)

SuiCidAl-KiSmEt
12-28-2005, 10:42 PM
you could look at pictures of AJ in hexadecimalSo you can look at pictures in hexadecimal? So If I open notepad and type in a bunch of 1s and 0s, it could turn out to be a picture?

Dusty
12-29-2005, 12:27 AM
if you had a translator program you cuold but no you'd get a head ache looking at the 1's a 0's so i think not. Anyway i guess i'll have to learn this eventually since i want to go into game and software programing anf thanks Grim i was about to post the same Q you saved me some trouble

Aqo
12-29-2005, 1:29 AM
So If I open notepad and type in a bunch of 1s and 0s, it could turn out to be a picture?
It's not as easy as it sounds, take a look at what a picture's code looks like without decompiling it (like you said, in notepad; it's attached).
Feel free to change *.txt into *.png and see what happens.

If you'll start changing random ASCII in there, you'd get a bugged file; As BST said, you can't Hex edit if you don't know what you're doing.

By the way, nice post, BST.

DiscipleOfAdun
12-29-2005, 10:37 AM
However, as you have found out I'm sure, with hex editing comes the ability to edit EXE code and create all kinds of cheating programs and circumvent all kinds of copy protection systems and so on. So, generally we might make references to hex editing and tell you what is possible with it, but teaching you to reverse-engineer StarCraft is not something we do on these forums because there are people out there who would just love to create their own map hack and they far overwhelm the numbers of people who would use hex editing to mod StarCraft. So, if we did allow you guys to teach and discuss how exactly to reverse-engineer StarCraft, these forums would instantly attract StarCraft hackers, and that's not something we want here. There are some other forums that do allow that, and they are ridden with hackers as you can imagine, so these forums don't go down that path.

But I should say, I greatly support what DiscipleOfAdun does in case you're wondering, that's different from teaching you how to hex edit, which he's refused to do on these forums because he's smart and knows where the lines are usually drawn on most forums.


Thank you, BST. :D

He's right, I won't explain exactly how to do this. All I'll say is that know assembly makes it a lot faster. Also, almost everything I've ever done is not what you'd call 'client side'. Most non-clientside changes cause crashes and desyncs, so that's why I crash/desync my games a lot(and Grim thought I was a bad modder...). As BST already knows, I have no intent of making cheats or hacks.

However, there is a problem which I need answered(and I bet BST can answer it). It deals with FireGraft. I'm planning on there being an external data file that contains all the data, including places to overwrite data(and sometimes code) in the exe. However, I'm afraid that some hackers might find it useful this way, writing their own data files. How would I make it so that only my data file(s) are read, and not hex edited ones?

GrimTerror
12-29-2005, 7:41 PM
DoA you need to clear out your PMs! I tried to send one but it said you couldn't take anymore! ><

DiscipleOfAdun
12-29-2005, 8:34 PM
Done. Srry about that. I knew it was close to full, didn't realize it was completely full.

DoctorZettabyte
02-07-2007, 6:56 PM
Unrelated here, but the first ever user-created DOOM map was written in hex. 2 rooms, 1 imp, a shotgun guy and an exit button. Not very fun, but pretty much the granddaddy of modding\mapping.

TheNomad
02-07-2007, 8:24 PM
However, there is a problem which I need answered(and I bet BST can answer it). It deals with FireGraft. I'm planning on there being an external data file that contains all the data, including places to overwrite data(and sometimes code) in the exe. However, I'm afraid that some hackers might find it useful this way, writing their own data files. How would I make it so that only my data file(s) are read, and not hex edited ones?

Checksums / Crypto / digi signatures ? (translated as extra work)
Not that I'm an expert in anything related to encryption, but who knows what good ideas my stupid ideas could give you :)

U-238
02-07-2007, 9:38 PM
zomgwtfbbq! 1 y/o thread!

Ktan
02-08-2007, 4:22 AM
Shoot the Necro, shoot shoot the necro...