The invention relates to the field of protecting data and computer programs, and more specifically relates to a method for obfuscating a computer program so as to prevent it from being disassembled, i.e. to prevent the reconstruction of the source code from the executable code and/or patching by unauthorized persons.
The invention also relates to a computer program recorded on a medium and including lines of instructions that, when they are executed by a computer, make it possible to obtain the obfuscation of said program.
The invention also relates to a use of the method according to the invention to obfuscate a computer program recorded on a medium and intended to perform the functions of a flight simulator when it is executed on a computer.
The known techniques for obfuscating computer programs are essentially based on the use of utility softwares called “packers,” the function of which consists of compressing the executable program (.exe, .dll, .ocx, etc.) and simultaneously encrypting it.
The packers are therefore made up of two parts:
The packers are more adapted to protection from copying than to obfuscating programs. Moreover, software tools called “depackers” exist that are able to automatically eliminate the protection placed on a program using a packer. Furthermore, packers introduce transformations into the program to be protected that complexify the execution thereof.
One aim of the invention is to perform a simple and effective obfuscation of a program without complexifying its execution.
Another aim of the invention is to mask the transformations of a program.
These aims are achieved using a method for obfuscating a computer program including the following steps:
a—selecting a numerical variable V used by said program or an instruction of said program using said numerical value V,
b—defining at least one operation which provides said numerical value V when executed,
c—substituting at least one line of said program using the numerical value V for at least one new program line performing the operation that supplies the value of said numerical variable V.
In a preferred embodiment, the inventive method also includes a step consisting of assembling the new program line to obtain the opcodes thereof and using the obtained opcodes as operands of the operation supplying the numerical value V.
Furthermore, the method according to the invention includes a step consisting of replacing the value of said numerical variable V with the result of the operation defined in step b).
Owing to the method according to the invention, it is impossible to distinguish between the instructions from the program and the data used by said instructions.
In a first alternative embodiment of the invention, the numerical encoding of the instruction using the numerical value V is replaced by the addressed memory location pointed to by the operation whereof the execution provides said numerical value V.
In the preferred embodiment, steps a), b) and c) of the inventive method are repeated recursively.
Other features and advantages of the invention will emerge from the following description, provided as a non-limiting example, in reference to the appended figure illustrating the essential steps of the method.
The invention applies to the obfuscation of a computer program recorded on a medium and intended to perform, when it is executed by a computer, simulation functions, security data processing or industrial process management.
In general, the method according to the invention is applicable to all computer programs having a plurality of lines of instructions written in a source language and intended to be translated by a compiler in a target language. The source language can for example be a programming language with a high level of abstraction and the target language is an assembly language or machine language called object code.
In one particular embodiment, the inventive method is used to obfuscate a computer program representing a flight simulator.
The appended figures illustrate the essential steps of the inventive method.
In step 2, a specific line of the source code is selected.
Preferably, a line is selected including an instruction or essential data of the program that one wishes to mask.
Step 4 consists in verifying that the selected line can be assembled independently of the other lines of the source code.
If the selected line can be assembled independently of the other lines of the source code, the assembly of the selected line is executed and it is replaced by these opcodes.
Else, a line is re-selected including an instruction or essential data of the program that one wishes to mask and step 4 is executed.
In step 8, a numerical variable V or an instruction with a numerical value V is selected.
In step 10, an operation is defined whereof the execution provides said numerical value V and at least one line of the program to be masked is substituted by a new program line performing said operation.
In step 12, the assembler code representing the operation defined in step 10 is generated.
In a first alternative embodiment of the inventive method shown by step 14, if V is a numerical variable, the initialization of said variable is replaced with the expression that makes it possible to obtain it.
In another variant embodiment shown by step 16, if V is a constant numerical value, the assembler code representing the operation defined in step 10 is placed before the instruction chosen in step 8 and the numerical value V is replaced by the register or the memory address containing the result of the operation defined in step 10.
The two alternative embodiments are respectively illustrated by the first example and the second example described below.
In the first example, the first code shows that the numerical value 0x12 is replaced by a calculation using the “non-numerical” element situated at address 0x2, in this case an instruction opcode 0x89 from which it subtracts 0x77 to find the value 0x12.
The original code is the following:
The code modified by the inventive method is the following:
In the second example, a global value situated at address 0x2000 worth 0x11223344 is replaced with the value 0xec53f375 from which the code removes a non-numerical element. In that case, the opcodes of the instructions at address 0x4 and 0x6 respectively equal to 31c0 and 31db result at 0x11223344, i.e. the original value.
The original code is:
The code modified by the inventive method is:
Number | Date | Country | Kind |
---|---|---|---|
09 51161 | Feb 2009 | FR | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/EP2010/052276 | 2/23/2010 | WO | 00 | 1/17/2012 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2010/097382 | 9/2/2010 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
7287166 | Chang et al. | Oct 2007 | B1 |
7739511 | Horne et al. | Jun 2010 | B2 |
7770016 | Horne et al. | Aug 2010 | B2 |
8140850 | Horne et al. | Mar 2012 | B2 |
8327452 | Oneda | Dec 2012 | B2 |
20050183072 | Horning et al. | Aug 2005 | A1 |
20060031686 | Atallah et al. | Feb 2006 | A1 |
20060218539 | Stiemens et al. | Sep 2006 | A1 |
20070234070 | Horning et al. | Oct 2007 | A1 |
20080028474 | Horne et al. | Jan 2008 | A1 |
20080046865 | Kerschbaum | Feb 2008 | A1 |
20080215891 | Horne et al. | Sep 2008 | A1 |
20080301452 | Horne et al. | Dec 2008 | A1 |
20090083521 | Sato et al. | Mar 2009 | A1 |
20090138704 | Delerablee | May 2009 | A1 |
20090177873 | Sato et al. | Jul 2009 | A1 |
20090307500 | Sato et al. | Dec 2009 | A1 |
20100199354 | Eker et al. | Aug 2010 | A1 |
Number | Date | Country |
---|---|---|
9901815 | Jan 1999 | WO |
2005020068 | Mar 2005 | WO |
Entry |
---|
Collberg et al; “Watermarking, Tamper-Proofing, and Obfuscation-Tools for Software Protection”, IEEE Transactions on Software Engineering, vol. 28, No. 8, Aug. 2002, pp. 735-746 ISSN: 0098-5589. |
Cohen; “Operating system protection through program evolution”, Computers and Security, Oct. 1993, vol. 12, No. 6, pp. 565-584, ISSN: 0167-4048. |
International Search Report for PCT/EP2010/052276 dated May 12, 2010. |
Number | Date | Country | |
---|---|---|---|
20120110349 A1 | May 2012 | US |