Skip to content
Store Dev
Cập nhật lần cuối

Integrating Stove Signature Verifier

This is a guide to enhance the security of games that directly integrate the Stove PC SDK.
Stove Signature Verifier is a library designed to defend against tampering attacks on PC SDK DLLs and must be applied.

Overview

  • This document explains and guides the application of StoveSignatureVerifier.lib for strengthening the security of the STOVE PC SDK.

Do not use it during development builds.
It should only be applied to distributed versions.

The distribution package includes libraries for both the MT (static CRT) and MD (dynamic CRT) runtimes.
Check your game project’s Configuration Properties > C/C++ > Code Generation > Runtime Library setting and select the matching library.
Mismatched settings cause an LNK2038 error at link time.

Feature Introduction

1. Why should you call StartStoveVerify?

You must call the StartStoveVerify function before integrating with PCSDK3 (or PCSDK2).
This function checks whether the DLL files used by PCSDK2/3 are properly code-signed (digitally signed).
If any DLL is found without a valid code signature, the game will immediately shut down for security reasons.\

2. What is code signing?

Code signing is a digital signature that proves a DLL file was distributed by a trusted creator and has not been tampered with.
DLLs without a valid code signature may be at risk of malware or unauthorized modification, so verification is essential.\

3. How do you use it?

When running the game, call the StartStoveVerify function before using any PCSDK3-related features.
If the function detects any DLLs without a valid code signature, the game will automatically close.
If all DLLs are properly signed, you can freely use other PCSDK3 features.\

4. What does it verify?

Verification is limited to the PC SDK DLLs distributed by STOVE. The folder containing the game executable and its subfolders are scanned to locate the PC SDK DLLs shipped with your game.

  • Your game executable, DLLs built by your team, and engine or framework runtime DLLs are not verified. You therefore do not need to code-sign your own binaries in order to apply this library.
  • Verification repeats periodically while the game is running, so replacing a DLL at runtime is also detected.

If the PC SDK DLLs cannot be found, it is treated the same as tampering and the game exits.
Make sure the PC SDK DLLs exist as real files in the executable folder or one of its subfolders in your packaged build.

It should only be applied to officially distributed builds.

Prerequisites

Download the latest StoveSignatureVerifier package from the download link. (Latest version: StoveSignatureVerifier_v1.0.5_x86_x64.zip)

A single package contains both the 32-bit (Win32) and 64-bit (x64) libraries.

Distribution Package Structure

  • After downloading and extracting the Stove Signature Verifier distribution package, you will see the following file structure:
text
Deploy
├ Include
│ └ StoveSignatureVerifier.h
└ Lib
  ├ Win32
  │ └ Release
  │   ├ MD
  │   │ ├ StoveSignatureVerifier_vs2015.lib
  │   │ ├ StoveSignatureVerifier_vs2017.lib
  │   │ ├ StoveSignatureVerifier_vs2019.lib
  │   │ ├ StoveSignatureVerifier_vs2022.lib
  │   │ └ StoveSignatureVerifier_vs2026.lib
  │   └ MT
  │     └ (same file layout as MD)
  └ x64
    └ Release
      ├ MD
      │ └ (same file layout as Win32)
      └ MT
        └ (same file layout as Win32)

Descriptions for each file:

  • Deploy/Include/StoveSignatureVerifier.h :
    • Header file to be included in your source code to enhance the security of Stove PCSDK.
  • Lib/{architecture}/Release/{runtime}/StoveSignatureVerifier_.lib :
    • Static library file for Stove Signature Verifier.

Select the library by these three criteria:

CriterionValuesHow to choose
ArchitectureWin32, x64Match your game’s target architecture
RuntimeMD, MTMatch your game’s Runtime Library setting
Toolsetvs2015(v140), vs2017(v141), vs2019(v142), vs2022(v143), vs2026(v145)Match your game project’s Platform Toolset

Note

You can use the features of Stove Signature Verifier in your project source code by declaring #include StoveSignatureVerifier.h.

Caution

If no library matches your toolset exactly, select one built with a lower toolset version than your game project.
A linker can only consume libraries built with the same or an older toolset. Choosing a higher version may cause link errors (LNK2019, LNK1120).

Project Setup


Native C++


This section explains how to integrate the PC SDK into a native C++ project.

The following example is based on Visual Studio 2019.

Step 1


  • Create a StoveSignatureVerifier directory in your solution directory.
  • Download and extract the required module distribution package.
  • As shown above, check the files included in the Include and Lib directories under the Deploy folder of the StoveSignatureVerifier module.
  • Copy these module directories into the StoveSignatureVerifier directory you created.

Step 2


  • StoveSignatureVerifier/Deploy/Include contains the header file (.h) required to use the SDK module.
  • Specify the path to the Include directory in Project Properties > C/C++ > General > Additional Include Directories as follows:
text
$(SolutionDir)StoveSignatureVerifier\Deploy\Include
  • StoveSignatureVerifier/Deploy/Lib/{architecture}/Release/{runtime} contains the lib file (.lib) related to the SDK module.
  • Specify the path to the Lib directory in Project Properties > Linker > General > Additional Library Directories as follows:
  • The example below assumes a project whose Runtime Library is set to MD. If your project uses MT, change the trailing folder to MT.
text
$(SolutionDir)StoveSignatureVerifier\Deploy\Lib\$(Platform)\Release\MD
  • Additionally, add the lib file matching your Platform Toolset to Project Properties > Linker > Input > Additional Dependencies. The example below assumes Visual Studio 2022 (v143).
text
StoveSignatureVerifier_vs2022.lib

Step 3


Finally, write and run a simple code as follows:

cpp
// 1. Include the required header file to use StoveSignatureVerifier.
#include "StoveSignatureVerifier.h"

int main()
{
#if defined(NDEBUG) || defined(_NDEBUG)
    // 2. At the start of the program, call the function to check if the StovePCSDK DLLs have not been tampered with.
    StartStoveVerify();
#endif

    return 0;
}

Unity Engine


This section explains how to integrate the PC SDK into a Unity project.

It is recommended to refer to the Unity documentation along with the example below.

Unity Docs, Creating Visual Studio Projects for Windows
https://docs.unity3d.com/kr/2022.3/Manual/VisualStudioprojectgenerationWindows.html

Step 1


  • In the Build Settings tab, check the Create Visual Studio Solution option and select Clean build... when building the project.
  • Download and extract the required module distribution package.
  • As shown above, check the files included in the Include and Lib directories under the Deploy folder of the StoveSignatureVerifier module.
  • Create a StoveSignatureVerifier folder in the Unity build output folder and copy the Deploy folder into it.

Step 2


  • /Deploy/Include contains the header file (.h) required to use the module.
  • Specify the path to the Include directory in Project Properties > C/C++ > General > Additional Include Directories as follows:\
text
$(SolutionDir)StoveSignatureVerifier\Deploy\Include
  • /Deploy/Lib/{architecture}/Release/{runtime} contains the lib file (.lib) related to the module.
  • Specify the path to the Lib directory in Project Properties > Linker > General > Additional Library Directories as follows:
  • The example below assumes a project whose Runtime Library is set to MD. If your project uses MT, change the trailing folder to MT.
text
$(SolutionDir)StoveSignatureVerifier\Deploy\Lib\$(Platform)\Release\MD
  • Additionally, add the lib file matching your Platform Toolset to Project Properties > Linker > Input > Additional Dependencies.
text
StoveSignatureVerifier_vs2022.lib

Step 3


Open the solution generated by Create Visual Studio Solution in Visual Studio.
Open the Main.cpp file of the project named {Unity Project Name}.
Finally, write the following simple code, build under the Master x64 configuration, and run it.

Even when Development Build is unchecked in Unity’s Build Settings, building under Release x64 in Visual Studio may cause the game to be recognized as a Development Build at runtime, which can prevent Stove Signature Verifier from working correctly.
In this case, building under the Master x64 configuration resolves the issue.

How to switch to the Master x64 configuration
  1. Click the Solution Configurations dropdown in the Visual Studio top toolbar (default: Debug or Release).
  2. Select Master from the dropdown list.
  3. Verify that the adjacent Solution Platforms dropdown is set to x64.
  4. If Master does not appear in the dropdown, open Configuration Manager from the dropdown.
    • Set Active solution configuration to Master.
    • Set Active solution platform to x64.
  5. From the menu, run Build > Build Solution (F7).
cpp
#include "PrecompiledHeader.h"
#include "..\UnityPlayerStub\Exports.h"

// 1. Include the required header file to use StoveSignatureVerifier.
#include "StoveSignatureVerifier.h"

// Hint that the discrete gpu should be enabled on optimus/enduro systems
// NVIDIA docs: http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
// AMD forum post: http://devgurus.amd.com/thread/169965
extern "C"
{
    __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
    __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
{

#if defined(NDEBUG) || defined(_NDEBUG)
    // 2. At the start of the program, call the function to check if the StovePCSDK DLLs have not been tampered with.
    StartStoveVerify();
#endif

    return UnityMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd);
}

Unreal Engine


This section explains how to integrate the PCSDK SignatureVerifier lib into an Unreal project.

The guide assumes that a project named UETest2 already exists, but you can also apply it to a newly created project.

In this guide, we add a UGameInstanceSubsystem and override its Initialize method. If your project directly inherits from UGameInstance, you can apply the code to the Init method of your inherited UGameInstance class without using UGameInstanceSubsystem.

Do not call StartStoveVerify() from a constructor.
In Unreal, a constructor runs at least twice — once for the CDO (Class Default Object) and once for the actual instance — so calling StartStoveVerify() there runs it multiple times.
Since v1.0.5 the library ignores repeated calls instead of creating another verification thread, but earlier versions may crash.
Always override the Initialize method and call it once from there.

Verification does not run in the editor (PIE); it runs only in a packaged exe. (The example code below also uses a preprocessor directive to skip the call in the editor.)
Verification looks for PC SDK DLLs in the folder containing the executable of the running process and its subfolders. When you run from the editor, that folder is the engine folder containing UnrealEditor.exe rather than your game folder, so the PC SDK DLLs shipped with your game are not found and verification fails.

Step 1


Find and modify the *.build.cs file in the {ProjectFolder}/Source/{ProjectName} folder of your new or existing Unreal project. Also, copy the StoveSignatureVerifier.h and lib files to the same location as the *.build.cs file.

To link the provided StoveSignatureVerifier module, add the following to the lib link section. Then, build as an exe in Visual Studio and check if it builds successfully.

Unreal Engine uses the MD runtime, so copy the file from the Lib/x64/Release/MD directory. Choose the file matching the Platform Toolset your project uses. (For example, UE5 uses Visual Studio 2022 (v143), so use StoveSignatureVerifier_vs2022.lib.)

text
PublicAdditionalLibraries.Add(ModuleDirectory + "/StoveSignatureVerifier_vs2022.lib");

Step 2


Open the Unreal project with the uproject file in Unreal Editor.

When the Add C++ Class dialog appears, select All Classes and search for GameInstanceSubsystem.

Here, we will create a class named UDRMGameInstanceSubsystem. Enter DRMGameInstanceSubsystem as the class name and click the Create button.

Close Unreal Editor and open the project in Visual Studio.

First, declare the Initialize method override in the header file (DRMGameInstanceSubsystem.h).

c++
#pragma once

#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "DRMGameInstanceSubsystem.generated.h"

UCLASS()
class HELLOSTOVE_API UDRMGameInstanceSubsystem : public UGameInstanceSubsystem
{
    GENERATED_BODY()

public:
    virtual void Initialize(FSubsystemCollectionBase& Collection) override;
};

Then, in the source file (DRMGameInstanceSubsystem.cpp), include StoveSignatureVerifier.h and call StartStoveVerify() inside the overridden Initialize method.

Call StartStoveVerify() from the Initialize method, not from the constructor. A constructor runs multiple times for the CDO and the instance, so calling it there may create duplicate verification threads and crash on versions earlier than v1.0.5.

c++
#include "DRMGameInstanceSubsystem.h"
#include "StoveSignatureVerifier.h"

void UDRMGameInstanceSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
    Super::Initialize(Collection);

#if !UE_EDITOR
    StartStoveVerify();
#endif
}

Restart Unreal Editor and test running the exe. Open the project launcher dialog and click the rightmost run button to check if it runs normally.


Frequently Asked Questions


Do my game executable and my own DLLs need to be code-signed?

No. Verification covers only the PC SDK DLLs distributed by STOVE. Your game executable, DLLs built by your team, and engine or framework runtime DLLs are not verified. See Feature Introduction > What does it verify? above for the full list.

Can I call StartStoveVerify() from a DLL instead of the game executable?

Yes. The scan is based on the folder containing the executable of the running process, not on the location of the calling module, so the same files are verified regardless of where the DLL that links this library resides.

Please observe the following two points:

  • Do not call it from DllMain. StartStoveVerify() creates a verification thread and scans the file system internally. DllMain runs while the loader lock is held, so calling it there can deadlock. Call it from an initialization function that runs after the DLL has been loaded.
  • Call it from the game executable’s entry point when possible. If the verification call lives in a separate module, that module can be skipped to bypass the check. When you control the executable, calling it from the entry point is the safer choice.

How do I apply this when I cannot build the main executable myself, such as with Electron?

For structures that use a prebuilt executable, such as Electron, link the library into the native addon (.node) that calls the PC SDK and call the function from the addon’s initialization function. The addon registration function runs outside the loader lock, so it is safe.

cpp
#include <napi.h>

// 1. Include the required header file to use StoveSignatureVerifier.
#include "StoveSignatureVerifier.h"

Napi::Object Init(Napi::Env env, Napi::Object exports)
{
#if defined(NDEBUG) || defined(_NDEBUG)
    // 2. At addon initialization, call the function to check if the StovePCSDK DLLs have not been tampered with.
    StartStoveVerify();
#endif

    // Register the addon's functions on exports below.
    return exports;
}

NODE_API_MODULE(stove_auth, Init)

Load the addon as early as possible in your game’s startup. Loading it only when the PC SDK is first used delays the start of verification by the same amount.

Pay attention to how you package your build.
Files bundled into app.asar in Electron do not exist as real files. If the PC SDK DLLs end up inside the asar archive, verification cannot find them and the game exits.
Use a setting such as asarUnpack to place the PC SDK DLLs as real files, then confirm they are present in the packaged output.

Should I use MT or MD?

Match your game project’s Configuration Properties > C/C++ > Code Generation > Runtime Library setting. A mismatch causes an LNK2038 error at link time. Unreal Engine and Electron native addons both use MD.

Contact Us


If you have any questions, please contact us on Discord or by email at store.support@smilegate.com.