The Steam DRM wrapper is an important part of Steam platform because it verifies game ownership and ensures that Steamworks features work properly by launching Steam before launching the game.
The Steam DRM wrapper by itself is not an anti-piracy solution. The Steam DRM wrapper protects against extremely casual piracy (i.e. copying all game files to another computer) and has some obfuscation, but it is easily removed by a motivated attacker.
We suggest enhancing the value of legitimate copies of your game by using Steamworks features which won't work on non-legitimate copies (e.g. online multiplayer, achievements, leaderboards, trading cards, etc.).
See Using the Steam Wrapper with Other DRM
for more information on combining the Steam DRM wrapper with other DRM or anti-tampering solutions.
Automated Steam DRM Wrapper
The Steam wrapper can be applied from within your SteamPipe upload script. This performs an initialization request to the Steam servers via the logged in client, then posts your plaintext executable to the Steam back end via HTTP. The wrap is performed server side, and then steamcmd downloads the wrapped executable.
To perform a DRM wrap with SteamPipe, have your script login and then run the drm_wrap Steam command:
drm_wrap [appid] [input filename] [output filename] [toolname] [flags] [<destination>]
- appid - Your numeric application ID
- input filename - Relative or absolute path to input plaintext executable. Remember to quote paths that may contain spaces!
- output filename - Relative or absolute path where the tool will write the output wrapped executable.
- toolname - "drmtoolp" is currently the only supported toolname parameter.
- flags - Bitmask of the following numeric flags specifying tool behavior.
- 0 - Normal wrap (most protection)
- 6 - Compatibility mode (disables obfuscation)
- 32 - Skip debugger check
- 38 - compatibility mode and also skip debugger check (least protection)
- destination, optional parameter - "cloud" or "local". The current default is "local". We will be migrating this command to use cloud storage by default in the future.
Example run_build.bat script to login, apply DRM, build and upload the build to Steam (where App ID is 480):
builder\steamcmd.exe +login mysteamaccount +drm_wrap 480 "D:\src\steamworkssdk\steamworksexample\release\steamworksexample.exe" "D:\src\steamworkssdk\tools\ContentBuilder\content\windows_content\SteamworksExample.exe" drmtoolp 0 +run_app_build ..\scripts\app_build_480.vdf +quit
Manual Steam DRM Wrapper
To quickly wrap an exe with the Steam wrapper use the Steamworks App Data Admin page to wrap the primary game exe.
- Select the game you want to add DRM to on your App Admin page
- Select Edit Steamworks Settings in the Technical Tools Section of the App Admin page
- From the Security Tab, select DRM.
- Upload the primary game exe - See the automated wrapper section above for more information on the tool execution options.
- Download the exe back to your local machine
- Rename the exe back to the original name
- Copy it to the source location for your Content Tool depots
- Build a new version of your depot
- Test that depot on your local content server
Using the Steam Wrapper with Other DRM
The Steam wrapper can and should be used in combination with other DRM solutions. To do so, apply the Steam wrapper in compatibility mode first before applying any other DRM. Apply it first so that it does not interfere with the DRM solution. Compatibility mode will disable DRM capabilities of the wrapper.
Submit the exe in compatibility mode by either selecting it in the drop down on the Steamworks page or using the appropriate flags in the automated drmtool.
Frequently Asked QuestionsQ. My C# / .Net game doesn't run after applying the Steam wrapperA.
The Steam wrapper doesn't support .Net applications. Instead of using the DRM wrapper, use SteamAPI_RestartAppIfNecessary
.Q. My game doesn't run after applying the Steam DRM wrapperA.
The Steam wrapper can break other DRM tools. See Using the Steam Wrapper with Other DRM
, as there may be a conflict.Q. Do I need to apply DRM to my exe every time I make a new build?A.
Yes, each build you intend to publish needs to be wrapped with the Steam wrapper. Try automating it using the Automated Steam Wrapper process documented above.Q. An Anti-virus vendor has detected my binary as having a virus after applying the Steam DRM wrapper. What can I do?A.
False positives like this can happen, as the DRM injection process is modifying your binary in the same way a virus might do. Feel free to contact the vendor, or use the API instead of the Steam DRM wrapper.