CodeMoving is a protection technique of CodeMeter Protection Suite. In this process, code that requires protection, usually in the form of separate functions, can not only be encrypted, but its execution can additionally be moved to a secured environment. Currently, the CmContainer types CmDongle and CmCloudContainer provide this secured environment.
Each CodeMoving function is marked with a unique functionId. This Id is later used in the encryption definition (*.wbc file) to link to the actual CodeMoving function. Furthermore, a stateId is passed for each call.
To provide that data can be exchanged between the program component and the function executed in the CmDongle or in CodeMeter Cloud, the two parameters input and output are available.
According to the CodeMoving function description, the pointers must point to memory areas that provide space for the struct input and struct output structures. The input contents are finally filled beforehand by the program component, whereas the contents of the memory referenced by output are only filled after the WupiExecuteMovedCodeId call if output data is desired.
Below are selected error codes that may occur when executing a CodeMoving function.
System error
-17 ErrorNoBlurryBoxHandleAvailable |
There are no more free state handles available. |
0x70000000 |
Internal error that occurred from the command call. |
0x70000003 |
The received data is too small. |
0x70000004 |
The received payload data is invalid. |
0x70000005 |
The received payload data does not have the expected length. |
CmDongle error
0x8000XXXX |
An error occurred in the trusted anchor during execution |
|
1702 ERR_CPU_BAD_RAM_ACCESS |
An invalid memory access was detected. |
|
1703 ERR_CPU_NULL_ACCESS |
Memory address zero was accessed. |
|
1704 ERR_CPU_BAD_STACK_ACCESS |
The stack is overflowed. |
|
1705 ERR_CPU_DIVIDE_BY_ZERO |
A division by zero was performed. |
|
1707 ERR_CPU_INSTRUCTION_LIMIT_REACHED |
The limit of the maximum executable instructions was reached. |
|
1751 ERR_CPU_LIBRARY_FUNCTION_ERROR |
A CodeMoving API function threw an error. |
|
1752 ERR_CPU_LIBRARY_INVALID_PARAMETER |
An invalid parameter was passed to a CodeMoving API function. |
|
Not yet implemented in C#.