You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A .NET library for removing Steam DRM stub protection from executables. Supports multiple generations of Steam DRM for both 32-bit and 64-bit executables.
Supported DRM Generations
Generation
Architecture
Description
Gen1
x86
Legacy protection with basic XOR encryption
Gen2
x86
XorStub with XOR-encoded code sections
Gen2Aes
x86
AesStub with AES encryption and XTEA DRM DLL
Gen3
x86, x64
Modern protection with TLS callback support
Gen3Plus
x86, x64
Latest variant, most common in modern games
Installation
NuGet Package
dotnet add package SteamStubRemover
Direct DLL Reference
Add a reference to SteamStubRemover.dll in your project:
usingSteamStubRemover;varoptions=newRemovalOptions{// Keep the .bind section in the output file (default: true)// Note: Some games require .bind section for IAT referencesKeepBindSection=false,// Recalculate PE checksum after removal (default: false)RecalculateChecksum=true,// Save decrypted payload data to disk (default: false)DumpPayloadToDisk=false,// Save extracted DRM DLL to disk (default: false)DumpDrmDllToDisk=false,// Zero out the DOS stub data (default: true)ZeroDosStubData=true,// Skip PE section realignment (default: true)SkipSectionRealignment=true,// Enable experimental features (default: false)UseExperimentalFeatures=false,// Enable verbose logging output (default: false)VerboseOutput=false,// Remove certificate table / Security Directory (default: true)// Fixes signtool error 0x800700C1 when re-signing cleaned filesRemoveCertificateTable=true};varresult=StubRemover.RemoveStub(@"C:\Games\SomeGame\game.exe",options);
Simplified Options
usingSteamStubRemover;// Remove stub with specific options using the simplified overloadboolsuccess=StubRemover.RemoveStub(filePath:@"C:\Games\SomeGame\game.exe",keepBindSection:false,recalculateChecksum:true);
Logging
Capture Log Messages
usingSteamStubRemover;usingSteamStubRemover.Logging;varresult=StubRemover.RemoveStub(@"C:\Games\SomeGame\game.exe",options:null,logHandler: e =>{stringprefix=e.MessageTypeswitch{LogMessageType.Error=>"[ERROR]",LogMessageType.Success=>"[OK]",LogMessageType.Warning=>"[WARN]",LogMessageType.Debug=>"[DEBUG]",
_ =>"[INFO]"};Console.WriteLine($"{prefix}{e.Message}");});
Log Message Types
Type
Description
Information
General progress information
Success
Operation completed successfully
Warning
Non-fatal issues encountered
Error
Fatal errors that stop processing
Debug
Detailed diagnostic information
Output Files
After successful stub removal:
File
Description
game.exe
The cleaned executable
game.exe.original
Backup of the original protected file
game.exe.payload
Decrypted payload (if DumpPayloadToDisk is enabled)
SteamDRMP.dll
Extracted DRM module (if DumpDrmDllToDisk is enabled)
Complete Example
usingSteamStubRemover;usingSteamStubRemover.Logging;publicclassProgram{publicstaticintMain(string[]args){if(args.Length==0){Console.WriteLine("Usage: StubRemoverTool <file.exe>");return1;}stringfilePath=args[0];if(!File.Exists(filePath)){Console.WriteLine($"File not found: {filePath}");return1;}Console.WriteLine($"Processing: {filePath}");Console.WriteLine();varoptions=newRemovalOptions{KeepBindSection=false,RecalculateChecksum=true};varresult=StubRemover.RemoveStub(filePath,options,LogMessage);Console.WriteLine();if(result.Success){Console.WriteLine($"Successfully removed {result.Generation} DRM with: {result.PluginName}");Console.WriteLine($"Original backed up as: {filePath}.original");return0;}Console.WriteLine($"Failed to remove stub: {result.ErrorMessage}");return1;}privatestaticvoidLogMessage(LogMessageEventArgse){ConsoleColorcolor=e.MessageTypeswitch{LogMessageType.Error=>ConsoleColor.Red,LogMessageType.Success=>ConsoleColor.Green,LogMessageType.Warning=>ConsoleColor.Yellow,LogMessageType.Debug=>ConsoleColor.Gray,
_ =>ConsoleColor.White};Console.ForegroundColor=color;Console.WriteLine(e.Message);Console.ResetColor();}}
Error Handling
usingSteamStubRemover;try{varresult=StubRemover.RemoveStub(filePath);if(!result.Success){// Check the error message for detailsConsole.WriteLine($"Removal failed: {result.ErrorMessage}");// Common failure reasons:// - "No compatible remover found for this file."// The file is not Steam DRM protected or uses an unsupported variant}}catch(ArgumentExceptionex){// Invalid file path providedConsole.WriteLine($"Invalid argument: {ex.Message}");}catch(Exceptionex){// Unexpected error during processingConsole.WriteLine($"Unexpected error: {ex.Message}");}
Building from Source
Prerequisites
.NET 10 SDK or later
PowerShell 7.0 or later (for build script)
Build Commands
# Build NuGet package and DLL
.\build-release.ps1# Build with CLI tool
.\build-release.ps1-BuildCli
# Build for specific runtime
.\build-release.ps1-BuildCli -Runtime win-arm64