📜 ⬆️ ⬇️

Steam CEG from Valve and what it eats. Introduction

image

Few definitions

CEG ( Custom Executable Generation , rus. Generation of a Unique Executable File ) is a means of protection against piracy (as paradoxical as it may sound), developed by the great and terrible company Valve in 2009. It was originally planned that the new remedy will be used on almost every game released on Steam . However, after reviewing their priorities, Valve realized that if a potential developer wanted to use such 'happiness' in a new game, then it would be advisable to pay and not a cheap price. Therefore, historically, CEG is used only by large companies that can afford it.
The very essence of this protection is as follows: as soon as the download of the game from the Steam digital distribution service comes to an end, a bare, not yet signed executable file is downloaded to the client’s personal computer. Then, a digital certificate is uploaded to the same client computer using the special SteamServices.dll library (which, by the way, is loaded into TEMP) and a special key with AES encryption (this key with the cegpublickey identifier is unique on the Valve server side, created when the game is published in the service itself using the Steam CEG SDK , access to which, by the way, has a limited number of persons), the above-mentioned executable file is signed.

Actually, a quick review of protection

“And what then is the practical value of such 'protection', if it only does that simply signs the executable file?” - you ask. And then I will answer - not everything is as simple as it seems at first glance. The fact is that when a digital signature is applied to a file, information is collected about the folders and files that are present on the client system, as well as some hardware. Later, the collected information also finds its place in the executable file. And this information will be truly unique, as the following components are taken into account: time stamp of files and folders in the unix style (date of creation, date of last change), unique registry keys (as well as checking whether the Steam client is installed on a PC using the same Orthodox registry), the number of files in a given directory, processor ID, serial number of the hard disk. It should be noted that the last two are used only in the newest versions of CEG (for example, such games as: XCOM: Enemy Within , Grid Autosport , DiRT Rally ).
')
Underwater rocks

So, what we have is such a binding of the 'unique' executable file to the hardware and files of the client PC. Is it good or bad? In general, a good idea and implementation. A minus in all of this, if, let's say, you went to your friends' country house and took with you a full backup of your favorite game with this very CEG , dropping it onto a portable media and hoping that you can safely play. But then the unexpected happened - the friend does not work the Internet! But on the laptop is installed Steam. It does not matter, you are restoring the backup of your game in offline Steam mode, press the "Play" button, but nothing happens! And all because the iron and other components, which were written above, do not coincide with the iron of your friend. And without access to the global network, you simply can’t start the game, because, for obvious reasons, it is impossible to generate a new executable file. Or is it still possible to run the executable file?
In the next part of the article we will talk about whether it is possible to completely wean the executable file from CEG , having a debugger on hand.

Source: https://habr.com/ru/post/274741/


All Articles