This study proposes a method for constructing natural protection code, that is, code with no artificial code fragments, based on the instruction camouflage technique. An artificial code fragment is a code fragment that does not resemble raw compiled code, which often appears in protection code. In the proposed method, first, the artificiality of each n-gram which makes up the protection code is evaluated based on the probability of occurrence of the n-gram. Then the artificial code fragments are camouflaged with dummy code fragments that are less artificial. The routines which restore the code are also inserted so that they do not cause malfunction or produce another artificial code fragments, taking into account the control flow of the code. The protection code that is transformed by the proposed method can be difficult to locate by attackers, which may improve the stealth of the protection code. In the case study, the proposed method is applied to a program protected by a well-known obfuscation method and the stealth of the transformed code is discussed.
Keywords: software protection, obfuscation, instruction camouflage, code artificiality