A player just reported that it's easy to play the full version of my (fully offline) Unity game for free by just:

  1. Buy the full game.
  2. Back up the data files.
  3. Refund the full game.
  4. Get the demo version.
  5. Replace the demo's data files with the full version's data files.

I know that Steam disables refunding after a soft limit, so you can't just do this for every game...

But even so how could I defend against this? There must be easy solution for this, right?

Thanks in advance!


There are two approaches to fix this issue:

  • Make your own .exe so Steam can differentiate the Demo and the Full version. (See the answer of Anomalous Underdog below for details)

  • Check with Steam API if the user owns the game at startup and quit if something is not right.

"In your base game, you could periodically call BIsSubscribedApp( 1346210 ) to determine whether or not the user owns a license to the base game." - Steam

  • \$\begingroup\$ Could you make the demo version in such a way that it's completely incompatible with the full version? As in the binary itself does not recognize features outside the demo, that way even if the data files are there, the binary itself cannot display them. \$\endgroup\$ Commented Aug 26, 2022 at 14:05
  • \$\begingroup\$ Well, that's what I'm trying to find out here. If there is such solution, it would be great. I've just replaced even the executable file, Steam doesn't even detected that change. Thus even if I physically remove the full version's extra levels, Steam won't remove the extraous files. (btw currently it's flag based lock) Up until now I thought that Steam does file checking, etc and if there is a change, it reverts them. \$\endgroup\$
    – Tudvari
    Commented Aug 26, 2022 at 14:39
  • \$\begingroup\$ @Tudvari Have you contacted Valve to inquire about whether this is a known issue and if there are any workarounds? They have a vested interest in preventing this type of theft. \$\endgroup\$
    – Kevin
    Commented Aug 26, 2022 at 17:47
  • 1
    \$\begingroup\$ @kevin They wrote: You can use Steam DRM, but this is only meant to prevent casual piracy. It's a simple client-side check that ensures the appID is launched by Steam and that the current account owns the game. You're also welcome to buy or use more restrictive DRM. Just make sure the DRM's existence is clearly communicated to your customers. Beware, this might have negative impact on your genuine customers, and may or may not have a serious impact on piracy -- virtually all DRM can be cracked with enough effort. \$\endgroup\$
    – Tudvari
    Commented Aug 28, 2022 at 14:40
  • 2
    \$\begingroup\$ @Kevin But this is not even casual piracy... I have two accounts on the machine, one with Full version, one with Demo. I can't run Demo with the Full version account, and vica-versa. But if I just copy paste the Full version's files (not even just the data files) into the Demo folder... it just runs. I don't get it. I thought the AppID is in the game files, and Steam realises that it's not just a demo version... \$\endgroup\$
    – Tudvari
    Commented Aug 28, 2022 at 14:42

1 Answer 1


Create your own .exe file for launching the game. You will have to be knowledgeable in C/C++ and the Windows API (if you are building for Windows). See instructions in the manual (check each page in that section).

By creating your own code for the .exe file, you could potentially do anything conceivable in C/C++, like performing offline checks, making sure the files present are really only the demo files, obfuscating/encrypting your data, etc.

Your game can still be cracked in the usual ways that any C/C++ application could be cracked (and if you go deep into this it will be a game of cat-and-mouse between you and the pirates, even the stuff I mentioned are easily beaten by any competent cracker), but it should be easy to prevent that simple method you've explained.

Note: The reason why Steam doesn't detect a change when you replace the executable is because the .exe file of any Windows Standalone build is all the same (if they are from the same Unity version at least), doesn't matter what project it was built from (you can verify this by doing md5/sha checksum of the .exe file of any Unity Windows standalone build).

In this way, as far as Steam is concerned, the .exe file of a demo version looks the same as the .exe file of the full version, because the binary data inside them is the same.

When you build a Unity project, this .exe file is just copied over and renamed to whatever you specified. The job of this .exe file is to simply launch the Unity engine.

The WinMain function of that .exe file is extremely simple, it just calls a function called UnityMain. UnityMain is within the UnityPlayer.dll file (you can find that dll in the same folder that the .exe file is in). That's the Unity engine (Windows version) C/C++ source code compiled as a dll (and it's closed source). It's the starting point of the Unity engine in Windows (the other Unity dll files you can find in the build are C# stuff).

Explaining all that is pretty off-topic but my point is that the .exe file does nothing more than launch Unity. It doesn't care what game data is given to it.

Unity provides you the source code and Visual Studio solution of the .exe file in:

wherever you installed Unity/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/Source/WindowsPlayer

You could use that Visual Studio solution as a starting point when making your own .exe file.

  • \$\begingroup\$ Woah, you've just blown my mind, all the details you shared are really helpful! \$\endgroup\$
    – Tudvari
    Commented Sep 5, 2022 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .