Remarks when inserting Protection Macros

<< Click to Display Table of Contents >>

Navigation:  Code Virtualizer > Inserting Protection Macros >

Remarks when inserting Protection Macros

Any x86 code (32-bit and 64-bit) can be converted into specific virtual opcodes by Code Virtualizer. You have to keep in mind a few remarks to make sure that your virtualized code will be executed as the original one:

 

To avoid a decrease in your application performance, you should avoid protecting iteration clauses (FOR, WHILE, DO...) that repeat many times  

 

Switch/Case statements inside a protected, sensitive area might not work properly due to compiler optimizations that use data tables to jump directly into the code. Notice that you can include areas of block to protect inside each different Case to execute by the Switch/Case statements.

 

Exception handling inside a protected sensitive area might not work properly. You should avoid protecting sensitive areas around try-except clauses (or On Error Goto statements in Visual Basic)  

 

 

Testing your protected application

 

When you protect your sensitive code areas with Code Virtualizer, your application should run as the original one, but if you have not followed any of the above remarks, your application might crash in the problematic sensitive block. You can determine which sensitive block is the problematic one by selecting/unselecting blocks to protect from the Code Virtualization panel and re-protecting your application again.

 

 

Note for Device Drivers developers

 

If you do not follow the above remarks in some of your sensitive areas to protect, your driver will make exceptions and generate a possible protection fault in the system. To avoid data corruption in your system, you should always test your device drivers under a virtual machine like VMWare, VirtualPC or any other PC emulators.