Get Demo
  • Windows
  • MacOS
  • Linux

SDK functions

SDK functions can be integrated into the source code of the protected application to define the boundaries of protected areas, as well as to detect debuggers or virtualization tools.

Code markers

Service functions

Licensing functions

Activation functions

!Important

After protection is applied, the application no longer requires the SDK library.

VMProtectBegin

void VMProtectBegin(const char *MarkerName);

The marker that identifies the beginning of a protected code block. A call to VMProtectBegin must be placed before the first instruction (or procedure/function call) of the protected code block. MarkerName defines the marker name that appears in VMProtect as “VMProtectMarker” + MarkerName. For example, the marker VMProtectBegin("CheckRegistration") will appear as VMProtectMarker “CheckRegistration”. If the marker name is not specified, a unique name in the form “VMProtectMarker” + marker_serial_number is generated automatically. You can assign a compilation type to the protected block within VMProtect.

VMProtectBeginVirtualization

void VMProtectBeginVirtualization(const char *MarkerName);

The marker that identifies the beginning of a protected code block with the predefined “virtualization” compilation type. MarkerName defines the marker name. The compilation type of this marker cannot be changed later in VMProtect.

VMProtectBeginMutation

void VMProtectBeginMutation(const char *MarkerName);

The marker that identifies the beginning of a protected code block with the predefined “mutation” compilation type. MarkerName defines the marker name. The compilation type of this marker cannot be changed later in VMProtect.

VMProtectBeginUltra

void VMProtectBeginUltra(const char *MarkerName);

The marker that identifies the beginning of a protected code block with the predefined “ultra (virtualization + mutation)” compilation type. MarkerName defines the marker name. The compilation type of this marker cannot be changed later in VMProtect.

VMProtectBeginVirtualizationByKey

void VMProtectBeginVirtualizationLockByKey(const char *MarkerName);

The marker that identifies the beginning of a protected code block with the predefined “virtualization” compilation type and the enabled “Lock to Serial Number” option. MarkerName defines the marker name. The compilation type of this marker cannot be changed later in VMProtect.

VMProtectBeginUltraLockByKey

void VMProtectBeginUltraLockByKey(const char *MarkerName);

The marker that identifies the beginning of a protected code block with the predefined “ultra (virtualization + mutation)” compilation type and the enabled “Lock to Serial Number” option. MarkerName defines the marker name. The compilation type of this marker cannot be changed later in VMProtect.

VMProtectEnd

void VMProtectEnd(void);

The marker that identifies the end of a protected code block. The call to VMProtectEnd must be placed after the last instruction (procedure or function call) of the protected block.

VMProtectIsProtected

bool VMProtectIsProtected(void);

The VMProtectIsProtected function returns True if the file has been processed by VMProtect.

VMProtectIsDebuggerPresent

bool VMProtectIsDebuggerPresent(bool CheckKernelMode);

The VMProtectIsDebuggerPresent function detects whether the application is running under a debugger. The result (True/False) can be processed by the application's internal protection mechanisms. If CheckKernelMode=False, the function checks only for user-mode debuggers (OllyDBG, WinDBG, etc.). If CheckKernelMode=True, both user-mode and kernel-mode debuggers (SoftICE, Syser, etc.) are checked. When protecting drivers, the value of CheckKernelMode is irrelevant because drivers always operate in kernel mode, so the presence of a kernel-mode debugger is always checked.

VMProtectIsVirtualMachinePresent

bool VMProtectIsVirtualMachinePresent(void);

The VMProtectIsVirtualMachinePresent function detects whether the application is running inside a virtualization environment such as VMware, Virtual PC, VirtualBox, or Sandboxie. The result (True/False) can be processed by the application's internal protection mechanisms.

VMProtectIsValidImageCRC

bool VMProtectIsValidImageCRC(void);

The VMProtectIsValidImageCRC function detects whether the executable module has been modified in process memory (only non-modifiable code and data segments are checked). The result (True/False) can be processed by the application's internal protection mechanisms.

VMProtectDecryptStringA

const char * VMProtectDecryptStringA(const char *Value);

The VMProtectDecryptStringA function decrypts an ANSI string constant — Value. To decrypt the constant, it must first be added to the list of protected objects.

VMProtectDecryptStringW

const wchar_t * VMProtectDecryptStringW(const wchar_t *Value);

The VMProtectDecryptStringW function decrypts a Unicode string constant — Value. To decrypt the constant, it must first be added to the list of protected objects.

VMProtectFreeString

bool VMProtectFreeString(const void *Value);

The VMProtectFreeString function frees the dynamically allocated memory used for a decrypted string. Releasing the memory is optional, but if you choose to do so, this function must be used. If VMProtectDecryptStringA or VMProtectDecryptStringW are called again with the same parameters before the previously decrypted string is destroyed, no additional memory is allocated.

Last updated 11 days ago