Patent ID: 8656501

Claim:
A method for selectively protecting one of a plurality of methods of a class of an application written in an object-orientated language, wherein a protected application is created by adding a protection module to the computer program, analyzing a first method to be protected of a plurality of methods of a first class of the computer program and determining first parameters needed for executing the first method, generating first gate code depending on the determined first parameters, replacing the first code of the first method by said first gate code and storing the replaced first code in a memory location accessible by said computer such that it can be accessed by the protection module during execution of the protected computer program, wherein, when the first method is called during execution of the protected computer program, the first gate code collects first data based on the determined first parameters and transmits the collected first data to the protection module, the protection module accesses the stored first code and generates a new class including a first substitution method based on the stored first code, instantiates the new class, invokes the first substitution method and passes at least a part of the collected first data to the invoked first substitution method so that the executed first substitution method provides the functionality of the first method, and returns execution to the first gate code after execution of the first substitution method, analyzing a second method to be protected of the first class or of a second class of the computer program and determining second parameters needed for execution of the second method, generating second gate code depending on the determined second parameters, replacing the second code of the second method by said second gate code and storing the replaced second code such that it can be accessed by the protection module during execution of the protected computer program, wherein, when the second method is called during execution of the protected computer program, the second gate code collects second data based on the determined second parameters and transmits the collected second data to the protection module, the protection module accesses the stored second code and generates a second new class including a second substitution method based on the stored second code, instantiates the second new class, invokes the second substitution method and passes at least a part of the collected second data to the invoked second substitution method so that the executed second substitution method provides the functionality of the second method, and returns execution to the second gate code after execution of the second substitution method.