Inserting Protection Macros in Visual Basic Native

<< Click to Display Table of Contents >>

Navigation:  Code Virtualizer > Inserting Protection Macros >

Inserting Protection Macros in Visual Basic Native

If you want to protect sensible code areas in your Visual Basic applications using Code Virtualizer, you have to compile your applications in native mode. When the application is compiled in native mode, Visual Basic will generate x86 code that can be manipulated by Code Virtualizer.

 

Due to the nature of Visual Basic, we cannot insert inline assembly or directly call functions from an external library; we have to provide a different way to insert sensitive code areas in Visual Basic applications. The way to insert areas of code to protect is by inserting a special Visual Basic instruction that will be detected by Code Virtualizer during the protection phase.

 

The following code snippet will insert an area to protect by Code Virtualizer:

Click to expand/collapseShow Visual Basic Example

 

Note that the name of the macro must go in uppercase in order to be recognized by Code Virtualizer.

 

 

Example of real code in a Visual Basic application

 

In the following, we present a real example of how to use Code Virtualizer in your Visual Basic application.

Click to expand/collapseShow Visual Basic Example