Set the label to protect the specified Functions/code

Using the SDK label to mark the critical functions in project coding process

Virbox Protector provides a series SDK label to help developer to mark to those critical functions or code which need to be encrypted in the project coding process. these SDK label will help developer to find and locate these functions easily when developer use the Virbox Protector to encrypt and protect these functions later.

SDK Label , includes head file, static libs and dynamic libs, Developer may load the these SDK label statically into the functions which need to be protected. Then the Virbox Protector can recognize & locate the critical code/functions and protect those functions which use SDK labeled.

Using SDK Label to Protect your functions

Following SDK label support to be used and added in project coding process.

*VBProtectBegin*: Normal & conventional protection

*VBVirtualizeBegin*: Virtualization protection

*VBMutateBegin*: Obfuscation protection

*VBSnippetBegin*: Code snippet protection (Code fragmentation)

*VBProtectDecrypt*: License encryption and decryption

Note:

The SDK label can only be loaded statically and not supported to be loaded with dynamic link lib (i.e. LoadLibrary);

The String parameter imported by VBProtectBegin, VBVirtualizeBegin, VBSnippetBegin, VBMutateBegin can't be shared with other functions.

Make sure the imported parameter to be ASCII code, then the right function's name will be shown, otherwise it will show messy code and unreadable.

Every begin will follow and match with end, use the **“begin”**and "end" in pair, and only one pair is allowed to mark for one function.

If the protection mode marked in the label inconsistent with the protection mode saved in the project file, the system will use the protection mode saved in your project file.

The code in between the "Begin" and "End" is better to more than 3 lines. which to make sure the protected code will be shown in the GUI of Virbox Protector. (it will not be shown in the GUI of Virbox Protector for the instruction less 15 bytes)

SDK provides 32bit and 64bit dll, you do need to use these libs accordingly.

SDK Label doesn't support in Java, Unity3D.

Begin/end do not support nesting use.

VBProtectDecrypt, the length of the encrypted string or buffer should be multi times of 16,

char g_test_string[16] = {"test_decrypt"};

VBProtectDecrypt, the import buffer and export buffer can’t be the same buffer.

VBProtectDecrypt, the buffer import need to be put outside of the function, which means is a global variable. For detail how to use, please refer demo.

.Net program, does not supported by VBProtectDecrypt currently.

Encryption of String: How to encrypt and decrypt the Critical strings

Virbox Protector support to encrypt the specified String which developer would like to hide the strings.

The encrypted string must be a constant value.

VBDecryptData can be used to encrypt and decrypt the data also, The length and the data should be constant value.

The following type of string Decryption supported:

  • String Decryption:

VBDecryptStringA("test_string");

  • Local static variable:

static const char g_string[] = "test_string";

Global variable:

char g_test_string[] = "test_string";

const char g_test_string[] = "test_string";

static const char g_test_string[] = "test_string";

If the program to be encrypted is too complicated and the data to be encrypted can’t be parsed, it will report error when you use Virbox Protector to protect the software, we recommend you make the program less complicate. Usually it mostly happened to the Linux program which compiled with –fpic or –fpie with O2.

The compiler may merge the same constant string to be one string, if only one of these string is encrypted, an error would be reported:

For example:

const char* a = "test_string"; const char* b = VBDecryptStringA("test_string"); printf("a = %s, b = %s\n", a, b);

For this sample case, messy code would be shown when you print string “a”.

Last updated