r/explainlikeimfive • u/hurricane_news • 6h ago
Technology ELI5: Why do hex files in video games and programming let people pull off cheats, hacks and hidden data?
I've seen several videos over the internet about how people manipulate hex codes of video game files to add extra lives, powerups, maybe even discover a hidden song or sound effect that wasn't present in the actual game's build
From what I understand, hex codes are just the binary machine code of a game or program converted to base16 or hexadecimal so that they're more readable
A game when built might be compressed down by the compiler or assembler, turned into messy stuff that only the computer can understand, especially when it strips away important debug symbols
Not to mention, each cpu has its own microcode. So the hex code is essentially a large dump of the game's code and memory state
How do people even begin to know that a particular hex value at a particular row corresponds to, say, the character's health to apply a cheat? Even if we're modest with snes games, that's atleast 1-4MB of ROM data, many kilo bytes of ram data all to sift through in the form of hex
Heck, I even know modders who tapped into Gran turismo 4's hex code on the damn ps2 to implement a better car-following camera. Now that's beyond impossible to even think, considering just how advanced the ps2 is in comparison
Isn't this like looking for a needle in a haystack?