r/AskProgramming • u/ZyzzTeleportationL9 • Mar 12 '24
Other What makes leaked game source code so valuable?
People are willing to pay big money for these source codes, why? what can they do with them?
20
Mar 12 '24
Cheats, yeah, but also some harmless mods, a good example is GSC's x ray engine (though the engine's code wasn't actually leaked, the devs published it themselves ), some guys took the code and made their own version of it called monolith, they used their monolith engine to run a modded version of a stalker game.
6
11
u/KingofGamesYami Mar 12 '24
Develop cheats. Paid game cheats is a rapidly growing industry with several multi-million dollar companies already.
6
u/EnD3r8_ Mar 12 '24
Didn't know that! Could you name me some companies that do that?
7
u/KingofGamesYami Mar 12 '24
Mad Catz Interactive, Inc. (developers of the Game Shark)
The Codemasters Software Company Limited (developers of the Game Genie)
Datel Electronics (developers of Action Replay)
Phoenix Digital Group (aka AimJunkies, develops cheats primarily for FPS games)
Elite Boss Tech, Inc (developed cheats for Destiny 2 before getting lawyered into the ground)
Micro-Star International Co., Ltd. (The 321URX).
1
4
u/The_Zealot_Almighty Mar 12 '24
Something I haven't seen anyone mention yet is speedrunning glitches. If you have the source code you can look through it to see what kind of bugs you might be able to run into. While this isn't an easy task, looking through the code could point you to an exploit no one had discovered before, leading to a new speedrun tactic and completely changing the speedrun of the game. Or learning the code that caused an already known glitch can make it easier to hunt for other places the code might be used that could change how the speedrun works.
1
u/stormblooper Mar 14 '24
Do you know of any examples where this has happened?
1
u/The_Zealot_Almighty Mar 14 '24
Not sure of any specific examples, since I don't know much about speedrunning, but I do know that the original Pokemon games had a few speedrunning exploits that make a lot of sense when you understand the code. Underflow glitch to get a Pokemon to level 100 in Viridian Forest before the first gym, for example. But I don't know for sure if that glitch was discovered from reading source code or from messing around in the game and somehow stumbling onto it.
9
u/SkelaKingHD Mar 12 '24
The nefarious folk will use it to make cheats and steal game code for their own use.
The curious ones just like computer science and want to see how things are programmed.
But mostly cheats. If you know how something works, you can easily figure out how to exploit it. Just like how if I knew what the key to your house looked like, I could easily make my own and break in
-9
u/xmpcxmassacre Mar 12 '24 edited Mar 12 '24
Yeah anyone decent at code can reverse engineer a game anyway.
Edit: since I have to clarify, I don't mean they will reverse engineer it to the exact source code. Jesus Christ I forget how literal engineers are. If we want to see HOW something works, we can reverse engineer it. Ethics aside.
8
u/SkelaKingHD Mar 12 '24
Easier said than done. Decompilers usually give you an unreadable result. As with reverse engineering anything, you can get close, but it’ll never be exact
-5
u/xmpcxmassacre Mar 12 '24
What's your point? You don't need the exact code. I have reverse engineered legacy code quite a bit for a previous job.
I was simply replying to the post that was talking about the curiosity of software engineers. If we want to know how something works, we will find out.
0
Mar 12 '24
[deleted]
1
u/xmpcxmassacre Mar 12 '24
Lmao 31 with nearly 10 years in the industry. Maybe you aren't as good as you think you are
3
1
u/_Jack_Of_All_Spades Mar 12 '24
Where do you get these source codes?? I want!!
0
u/Ok-Bit8368 Mar 12 '24
GitHub. Fucking smelly nerds.
4
Mar 12 '24
Doesn't have a .exe not going back there again
2
1
u/Zeitgeistdeep Mar 12 '24
Chats, to know how the game works better so they can creat new moded versions, to understand how some rendering/movement functions work with the game engine, which classes and packages are used so they could improve their own idie games or some rivaling company can improve their game that uses similar movement/graphic packages and functions.. take that like cars / engines industry, if you already have all the details and calculations + the metal elements that are used to build that rivaling company engine/car.. you can build the same or better with less market price to pass your competitors, imagine that like a Fifa VS PES differences, in every ear (before PES becomes eFoorball) every one of them drops a new game .. some years Fifa was better and other times PES shines better in terms of graphics handling, players maneuvering, less glitches, better performance in low-end devices..etc..
1
u/stars9r9in9the9past Mar 12 '24
My question is more related to how programs appear to the user, but if a game is stored on a local harddrive how come we can’t just see or analyze the binary code and work up to the different languages/code used across all the game files?
3
u/Ryuu-Tenno Mar 13 '24
Compression mostly. The language you write the game in is for your convenience, the system itself doesn’t care cause it’s running off of binary.
You can write a program and give it all the code you want but in the end to help save space it compresses it all down, eliminating code (the binary itself in this case) it doesn’t need. There’s often a bunch of white space and other things going on that it uses to track where stuff is, so we can follow along with what we told it to do. But it brings things down to binary (or even hex), reducing the excess space that’s used up so it can run the instructions quickly.
I doubt it’s the only thing but that’s typically the biggest reason for it.
The rest is translating the 8x 0s and 1s, or the pairs of hexadecimal to readable info. You’d have to run through and match up each piece to get the proper letter or symbol, but then god still have to translate it to its originally programmed language. But then you’d have to know how that language works properly to be able to program in it, then you can begin to reverse engineer the game effectively.
2
u/stars9r9in9the9past Mar 13 '24
Appreciate the answer! I assume there is always more at play but this was a nice explanation for the non-dev layperson
1
u/cheffromspace Mar 15 '24
It's not compression, it's compilation. The code is written in a syntax the compiler understands, and the compiler converts the human readable code into machine code.
3
Mar 13 '24
We can. Decompilers exist. But why go through that trouble when we have access to the source code? Like u/Ryuu-Tenno said: the binary and machine code is not meant for us to read. It can be done, but it's meant to be executed by the computer.
Some programs don't get compiled ahead of time. They get distributed as source code and compiled or interpreted just in time, at the moment it is needed. Those programs have their source code legible for anyone to read. There's nothing stopping you from reading it and learning from it.
1
u/stars9r9in9the9past Mar 13 '24
I suppose for your question here...
But why go through that trouble when we have access to the source code?
...I meant why not do this for every proprietary program, game, OS, etc. Since the post was asking about why leaked code is so valuable, I guess I was wondering why we can't just take anything out there and, perhaps slowly, figure out the code. As someone who doesn't know the technicalities involved, I guess I'm just curious why if it's all right there inside my disc/drive, why can't it just be analyzed in someway to map out the source code.
Also, my definition of source code can be wrong. I assume it's all right there as source code on my machine. Perhaps it is actually jumbled some way on my end, vs at the source/uploader/seller/owner?
1
u/Careful-Sun-2606 Mar 16 '24
Yes. Code is written for computers, but humans have to be able to understand it. When the code is compiled, it loses a lot of readability - sometimes all of it.
It's a lot like looking at dish and trying to figure out how it was cooked. Even though you have the dish in front of you, it's still hard to figure out how it was made or even what exact ingredients were used.
The code on your computer is almost always the compiled version, so it's not easy to analyze at all. There is a loss of information when the code is compiled.
-2
u/xmpcxmassacre Mar 12 '24
I don't think it's actually that valuable. But as the company making the game, i'm sure it's disheartening. It essentially ruins any announcements you have planned as everyone will know everything about the game anyway.
I mean I'm sure there's some Chinese company that will steal the code and try to make a knockoff game.
2
u/dmills_00 Mar 12 '24
Agreed, what would be a far bigger thing would be theft of the assets, storyboard, graphics, models, skins, textures, sounds, all that stuff is the real secret sauce, most game studio code is horrid and there is a reason engines are bought in.
70
u/tired_hillbilly Mar 12 '24
For a lot of old games, they've been abandoned by their original developers, but a niche community still wants to play them, and many have ideas of how they could be better. Maybe they want to fix old bugs the original devs never got around to. Maybe they want to fix new bugs that happen when you try to play a 15 year-old game on modern PC's. Maybe they want to run their own multiplayer servers so people can play online again without the original ones that shut-down years ago. Maybe they want to make mods for a game without any official mod support.
All of these things are much easier if you have access to the original code, rather than whatever facsimile you manage to decompile or reverse engineer.