Jump to content

Me and my friend are having a discussion about video game scripts, People claim that certain behaviors "Are in the game code" but how do these people know without being a developer or getting the info from a developer?

So my question is can you open a game like Overwatch or PubG's scripts from the downloaded version off steam or blizzard launcher ect?

Link to comment
https://linustechtips.com/topic/921415-can-you-view-a-games-scripts/
Share on other sites

Link to post
Share on other sites

Strictly speaking, *anything* that happens within a game without outside intervention is "in the game code". Can you be more specific?

 

Some games have their scripts as plain text files, occasionally packed in various archive formats (games like the stalker series for example use this heavily). In those cases, a simple text editor is all you need.

Link to post
Share on other sites

The code is (usually) compiled or obfuscated (or both) such that people cannot steal it. Being in the game code just means it's programmed to do X after Y. You don't need to know the code to find these things out, it can be discovered that if you do A, B happens, for example. If it can be recreated consistently it's an intended effect/behaviour and hence "in the code".

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to post
Share on other sites

One popular method is scanning the program's memory space, which is what CheatEngine does. For example, take a Dark Souls game:

  • Scan the entire memory space and remember what it looked like. You can do something like a value lookup for your souls, IE assuming you have 1000 souls, you scan for the number 1000.
  • Do something to change a specific the value you previously scanned. In the example previously, you could use an item to increase your souls from 1000 to 1500, and then scan for the number 1500.
  • You now know that the memory location of the number of souls you have is stored in a very specific part of the program's memory. It's quite rare for games to change the location of these things within their own memory spaces, and even if they do, you can repeat the two previous steps to find the "new" memory location.

After going through all of this, you can get a rough idea of what is located where.

As for specific scripts and code that is run (rather than memory objects that are stored), it's a bit trickier. You can try decompiling the execuatble or the game's archives and finding the related scripts and working off of that, but that's sill extremely difficult. AFAIK, Unreal Engine games have the easiest decompiling method, and even then you aren't able to easily get the original source code back.

Link to post
Share on other sites

For Unity there are tools out there that will allow you to decompile a game back into a Unity project. The code will be in an optimized form but I think variable names will be unchanged. Never used it though. For other games I'd expect you would be able to see the code in assembly format. 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×