This efficient solution is designed to obfuscate (transform) the source code of C/C++programs (supports standards C++98, C++03, C++11, C++14, C++17) to protect them against reverse engineering. After obfuscation the code is reliably protected against analysis that can be performed by a man or machine.
StarForce C++ Obfuscator is recommended for the cases when software protection against reverse engineering is crucial. For example, it is vital for software that contains DRM keys or other sensitive data that can’t be lost or modified. If it happens it causes financial and reputation losses.
There are two approaches to code obfuscation
Source code obfuscation
Code obfuscation with the program logic changing
The program removes comments, spaces, joining all lines, replaces symbols, numeric constants and characters in strings with something more difficult for understanding but it doesn’t change the logic of obfuscated program. It means that binary codes for both a not obfuscated text and an obfuscated text will look the same. Developers may use this type of obfuscation when they have to supply the source code according to the license agreement.
In this case, extra branching, loops, function calls, etc. are added. Binary codes for a not obfuscated text and an obfuscated text will be very different. Each obfuscation gives a new version of the binary file. For example, in order to stop working existing cheats and bots in the game, it's enough to re-obfuscate the source code without changing anything inside. This option provides the highest level of protection from analysis and modification.
StarForce C++ Obfuscator belongs to the second type. It involves different algorithms to change logic of the programm. At the moment it is one of the best products to protect С and C++ source code against cracking thanks to an optimal selection of protection methods and many years of work without compromising.
One of the StarForce C++ Obfuscator’s benefits is its versatility as it can be applied to protect programs designed for any operating systems and any processors, including protection of firmware.
Sample of obfuscation
Source code before obfuscation
Source code after obfuscation
#include <stdio.h>// Euclidian algorithm for calculating greatest common divisor (before obfuscation)int gcd(int n, int m ){if( n <1|| m <1)return-1;while( n != m ){if( n > m ) n -= m;else m -= n;}return n;}// Tests in triplets { n, m, expected_gcd( n, m ) }int tests[][3]={{1, 2, 1},
{3, 3, 3},
{42, 56, 14},
{249084, 261183, 111},
};// Perform testsint main(int, char*[]){printf("Performing tests of gcd function:\n");bool passed =true;for(int i =0; i <sizeof( tests )/sizeof( tests[0]); i++){int n = tests[ i ][0];int m = tests[ i ][1];int expected_gcd = tests[ i ][2];int calculated_gcd = gcd( n, m );printf(" %d. gcd( %d, %d ) = %d, ", i +1, n, m, calculated_gcd );if( calculated_gcd == expected_gcd ){printf("OK.\n");}else{printf("error.\n");
passed =false;}}printf("Tests %s.\n", passed ?"passed":"failed");return passed ?0:1;}
The future of obfuscation prepares negative perspective for hackers. From practical point it means that it makes no sense to work with standard analytical methods. In theory it is possible to remove trash and superfluity that were added by an obfuscator but in practice it’s very difficult. And it is almost impossible to unravel code of a Petri net because it is a one-way process and nobody is able to reverse it.
Chris Kaspersky
The high level of protection is provided by obfuscation both the source code and the binary code.
The obfuscator supports more than 30 obfuscation methods. Most all of the methods can be enabled, disabled and adjusted independently, with the help of the configuration file. The most effective are:
conversion of C++ code into virtual machine code;
encryption of strings and arrays;
code conversion into a state machine;
insertion of dummy links;
code section merging.
The support of all popular operation systems: Windows, macOS, Linux, iOS, Android.
StarForce C++ Obfuscator is a stand-alone application that is installed at the customer’s site.
Flexible licensing policy (with or without time limitation).
An option to set different obfuscation rules for different parts of code.
Run from the command line.
Game protection from tampering and malicious reverse engineering
Situation
Free-to-play games monetization is based on content/resources/artifacts selling. Gamers can use different fraudulent tools (cheats, bots) to get what they want for free. To create a cheat it is necessary to analyze the game code and how it works. The more cheats are in use the less revenue the game publisher has. It even can cause the closing of the project.
Solution
StarForce C++ Obfuscator prevents from security attacks such as tampering and malicious reverse engineering. The developer himself determines the level of protection for different parts of the code, not to reduce the performance of the game. As a result of obfuscation, each time a new version of the binary code is obtained, which makes it impossible to use the old cheats.
Source code protection when it is delivered to the third party
Situation
There are many reasons to protect source code: unique algorithms, piracy threat, a part of the code hiding, etc. In case of failure it causes financial and reputational losses.
Solution
StarForce C++ Obfuscator allows to hide the logic of your software operation. All your secrets will be securely saved.
Protection from the loss of standard DRM keys
Situation
Standard DRM systems such as AACS and HDCP are used all over the world to control access to audio and video streams. They provide private keys for each model of the user devices (TV sets, players, consoles, set top boxes). A device key leak leads to pirate content distribution and as a result the discredited key is revoked by the DRM. After that the device stops working and a producer needs to get a new key and pays a lot of money for it. Sometimes, a producer may have a penalty for a device key leak, or its license may be suspended.
Solution
StarForce C++ Obfuscator provides protection for the software that is responsible for video/audio streams delivery and use. After obfuscation the code that is working with DRM keys is reliably protected against analysis and reverse engineering.
Protection of a standard DRM client side
Situation
The front end of any DRM system, for example OMA DRM, is vulnerable to the attacks that include reverse engineering, modification and protection disabling. Depending on the DRM, an attack can result in compromising either a certain protected object or all of the protected objects of the user, or all of the protected objects in the system.
Solution
StarForce C++ Obfuscator allows reducing the risk of DRM cracking due to significant increase of the reverse engineering complexity. How the obfuscator should be used (i.e. what should be obfuscated and how) depends on the system’s parameters. To get the optimal solution, please, consult StarForce technical team.
Securing the implementation of custom DRM from reverse engineering
Situation
The development of custom DRM is a costly task. If the developer decides to do it, he should in any case solve the problem of securing the DRM code that works on the end user side, from reverse engineering. The developer faces two problems in this case:
Man-hours for creating an efficient protection against reverse engineering are significant.
There is a risk that protection against reverse engineering may not be efficient enough.
Solution
StarForce C++ Obfuscator enables the developers to save time for the development of a system that protects DRM against reverse engineering. Using StarForce C++ Obfuscator provides a high efficiency level that is known in advance. The developer estimates the level of efficiency when he decides to buy the obfuscator on the basis of the analysis of the obfuscation results.
StarForce C++ Obfuscator is a stand-alone application protected from copying with the help of StarForce ProActive for Business.
For obfuscation unprotected CPP files are used. In the files the methods with the code that should be protected against reverse engineering are marked with special attributes. The result of the obfuscation is also CPP files but the selected methods in them are obfuscated.
How to use StarForce C++ Obfuscator
1
Install the obfuscator. No special operations are required. Just unpack the archive with the obfuscator to any folder on a developer’s computer.
2
Activate the obfuscator. Run the omniform.exe executable file without any parameters, enter the serial number and activate the product.
3
Perform test obfuscation. To do that please:
А
Create the test_input.cpp file with the following contents.
__attribute__((obfuscate(0))) int f1( int a, int b )
{
if( a > b ) return a;
else return b;
}
B
Run the obfuscator with the obfrun.exe test_input.cpp test_output.cpp command.
C
Make sure that the test_output.cpp file contains the obfuscated code.
4
Prepare the source files for the obfuscation by adding the obfuscate attribute before the required methods. The simplest way to prepare the files is described above; see user guide for details on how to prepare the files.
5
Customize the obfuscator to work with the required compiler by editing the configuration files.
6
Run the obfuscation using command obfrun.exe.
7
Compile the obfuscated files.
7
Test the compiled application and make sure its functionality is equivalent to the one from non-obfuscated files.
To make the obfuscator easier to use, it should be integrated into the application build process during the development.
The obfuscator can work on the following operating systems
Windows 7 32/64-bit
Windows Vista 32/64-bit
Windows 8 32/64-bit
Windows 10 32/64-bit
Windows Server 32/64-bit
Linux (option)
macOS (Wine)
The obfuscator requires the following to operate
350 Mb of disk space for installation
4 GB of RAM
The obfuscator has the following C++ compatibility parameters
Supported compilers
MSVC6.0, MSVC7.0, MSVC7.1+
GCC 3
GCC 4
Supported standarts of C++ ISO/IEC
C++98
C++03
C++11
C++14
C++17
Supported target platforms for C++
Windows
Linux
Android
macOS
iOS
Obfuscation of the following C++ language constructions are not supported
Methods that contain Structured Exception Handling (SEH)
Constructors and destructors
Function templates and methods of the template classes
Some other structures that are used less often than those mentioned above. The full list of the restrictions is in the user guide