Forum Mod Bakery Docs

Is it legal to easily edit a PC Game .exe file? If so, how?

Please login to contribute to the conversation.
I've tried programs like PE Explorer and Resource Tuner, but they only show the .exe file in Hex Views and other non-understandable text.

For example, in the Hit and Run folder, the following things are not compiled in the "Simpsons.exe" file, and are thus very easy to edit as they are not in Hex View form. (Not that I'm going to, as I know they should only be done through copies for the custom mods on Lucas' Hit & Run Mod Launcher):

* Art Folder
* Movies Folder
* Scripts Folder
* Sound Folder
* Save Game File
* The Simpsons Hit & Run Icon

But a lot other things *are* compiled inside the "Simpsons.exe" file. The only thing I know of is the Cheats. I see that one of the mods in Lucas' Hit & Run Mod Launcher is the "No Cheats", so I'm assuming you guys decompiled that file from the "Simpsons.exe" file.

Obviously I respect it if it's classified, but it never hurts to ask.
So to answer your first question "Is it legal":
Redistributing an executable is not legal. However the way we accomplish our mods is legal, by dynamically editing the game's memory. This means that the game is launched normally and has OUR code injected into it. This allows us to modify it dynamically using a combination of C++ and Assembly.
There's also laws that help people looking to hack/mod games for the purpose of preserving them within modern technology, but they're too complicated to explain in a forum post. Modding a game is a complicated thing both to achieve and to do legally. More information for that can be found at www.copyright.gov/title17/92chap12.html

You said "so I'm assuming you guys decompiled that file from the "Simpsons.exe" file"
The support for cheats or literally anything else in the game such as walking around and vehicle physics is not something we can "extract" or "decompile". We can use tools that are able to look at a game's memory (such as Cheat Engine) and it's "Machine Code" and Assembly.

Here's one of the tools Lucas looks at when making his hacks, in this case Cheat Engine:

This screenshot of Cheat Engine shows The Simpsons: Hit & Run's entry point, which is essentially the starting point of where the game executes.

To continue on with your question, Lucas made his own "No Cheats" hack, this does not use any of the original game's code or assets. It is injected using the mod launcher.

In fact this is a screenshot of his original code to accomplish the "No Cheats" hack:

The code on line 29 prevents a cheat from being enabled by making it so they won't process input when a user tries to input a cheat. In this case, Lucas used a "return" instruction to tell the game to exit out of it's function when processing a cheat.
The code on line 30 makes it so once the game goes to check if a cheat is enabled, it always returns false. This is because Lucas is replacing it with his own function. You can see his own function, which is raw assembly on line 12.

Most hacks are far more complicated, in fact the No Cheats hack is one of the least complicated hacks in the Mod Launcher.

Hope this clears things up,
Jake
Ah thanks, I see you have to know a lot of C++ to make those kind of edits