r/howdidtheycodeit • u/MuffinInACup • Nov 09 '23
Piracy detection that actually works
Hi, I am wondering how piracy detection is coded, specifically piracy detection that actually works - for example how talos principle locks you in the elevator, or serious sam 3 spawns an invulnerable scorpion and game dev tycoon makes pirates ruin your day.
Those detections seem to be working without internet and furthermore dont appear to have been bypassed (unless my searches fail me).
One idea is to check where the game is installed (as steam or other legit source would install in its own preferred locaiton, vs wherever the pirated version installs) but that means installing a pirated game into the correct directory is a straightforward bypass. I realise that ultimately any check can be bypassed with a proper memory tweak or injection, but finding the most robust solution would be interesting.
12
u/Stepepper Nov 09 '23
Pretty much everything that does not require a constant internet connection is crackable. All the games you mentioned have working pirated versions available.
For Game Dev Tycoon specifically they didn't have any DRM at all (besides steam_api.dll) but instead uploaded their own version that triggers the pirates event.
Croteam (Talos Principle, Serious Sam) used Valve's CEG (Custom Executable Generation) that generates a unique executable per install/user, I'm not exactly sure how it works and I think CEG does not exist anymore because it was not effective.
Alongside CEG they also created their own DRM that uses multiple tricks to check if the copy is legit. I have no idea what tricks they used but they could check if the checksum of the .exe is the same as the legit's copy's checksum, or they look at the file size and see if that's different, or check if the installed path contains "steamapps/common".
These are just a few tricks they can use to detect changes, which then triggers a flag somewhere in the game that spawns the invulnerable scorpion or locks you in the elevator.
You can't really stop piracy, the DRM measures are mainly meant to waste the time of crackers, as the first week of launch is the most important period for sales.
5
u/fablegrimoire Nov 09 '23
For our game The Symbiant I set up a relatively simple system where the first time a game is launched, it generate a 20-characters hash in the game's persistent data and sends a .json file to a remote server of mine that contains basic info like the fingerprint, the game's build version and the device's OS. The information was then stored in a mysql database.
I could then count the total number of different "fingerprints" that were generated and compare it with the number of Steam purchases/key activations.
If 10k devices exist but your game only sold 2k copies, you could roughly assume that 80% of copies were pirated. It isn't exact science but it gives you a rough number.
It didn't detect piracy by itself though, and it didn't hinder the game so pirates didn't bother removing the data gathering.
10
u/Familiar_Ad_8919 Nov 09 '23
it does not work. source: i have some 20 odd games pirated yet none detect a thing
one thing u could do is require constant internet connection and validate against a server, then again u needa handle duplicates and stuff
without external servers a good enough cracker will make ur game work without buying it
154
u/JonnyRocks Nov 09 '23
your examples arent using detection. gamedev tycoon made the "broken" version and flooded torrent sites with it. the dev is the one who put that pirated version up there.
67
u/Gorignak Nov 09 '23
Probably worth mentioning that Talos and Serious Sam are by the same people, so presumably use the same methods.
I think the way they usually do it is to create a version of the game with the piracy restrictions intact, and then seed the torrents themselves in the knowledge that it's going to get put up anyway.
Then people pick it up, and it perpetuates before people realise that it's not the "real" version of the game.
7
u/[deleted] Nov 09 '23
Batman: Arkham Asylum was another famous example. There was a jump that didn’t work in pirated copies.
4
u/lqstuart Nov 09 '23
The correct answer is here a few times--they don't code it, they seed torrents with broken versions of the game. Those are naturally the first torrents of it available, and become the biggest.
Meanwhile, here you yourself are thinking that they code it differently, and many others are talking about ways to check the executable and crack it. There's a pretty important lesson in there.
3
u/EnumeratedArray Nov 09 '23 edited Nov 09 '23
Back in the olden days, you might need a CD key to play a game. If the game detected an incorrect CD key, it wouldn't let you in or might let you in, but with a modified version of the game.
Nowadays, the same sort of technique is used, but checking the game is valid against an online server rather than a code that comes with the disc.
Some studios have been known to leak fake versions of their own game, with functionality to ruin the game like you've described. This is great because its rasy for studios to advertise this version of the game and make sure its the most pirated copy out there. At the very least, this slows down actual hackers until it is determined the fake leak was not legitimate. The above is what your examples did.
There's lot of options for games that are completely offline, such as scanning game files for any form of modification, checking other running processes, and so on.
However, for completely offline games, a good hacker will always be able to pirate them and avoid any adverse affects programmed into piracy detection. It can't be completely avoided which is why a lot of larger games that could be offline (such as Diablo 4) require an Internet connection to play.
2
u/nmodritrgsan Nov 09 '23
Was this removed in later copies, or not in earlier versions?
I played a pirated copy to the end and never saw this
1
u/Fat_bruh_Gat Nov 10 '23
The only things that can somewhat help are:
1
u/[deleted] Nov 10 '23 edited Nov 15 '23
[removed] — view removed comment
0
u/holounderblade Nov 09 '23
The funny thing is that what you're wanting doesn't exist
0
u/Osirus1156 Nov 09 '23
None of it really works in the long run to be honest. Most of the time companies are just trying to prevent games from being pirated in the first week or two. Eventually it will all be broken. Mostly it's a balance of trying to prevent cracking and not piss of your customer base with intrusive DRM.
That won't work because you can choose where games are installed in steam. I have games spread across three drives.
I think your best bet might be CD keys that steam deals with but they will be eventually cracked if someone cares enough.
0
u/fshpsmgc Nov 09 '23
There is a great video on Manhunt DRM, that goes in-depth on its piracy detection, how it works, why it failed, and why it is causing issues with the Steam version.
TL;DW — game checks if it’s a legitimate copy by checking a special cryptographic signature applied to each disk during manufacturing. In the gameplay code, there are checks on some gameplay mechanics that activate if it’s a pirated copy and subtly break the game making it unplayable. These checks are designed to be easily missable by hackers, so they would potentially waste a lot of their time and release a broken and incomplete crack.
However, Rockstar is apparently filled with lazy and incompetent engineers, so this DRM was completely removed even before European release of the game and all of those issues trigger only on a legitimate copy of the game bought on Steam, because Rockstar incorrectly applied a crack to their own game.
Basically, if you’re thinking of implementing these features — don’t.
42
u/[deleted] Nov 09 '23
[removed] — view removed comment