JP5277825B2 - Program obfuscation device and obfuscation program - Google Patents

Program obfuscation device and obfuscation program Download PDF

Info

Publication number
JP5277825B2
JP5277825B2 JP2008239860A JP2008239860A JP5277825B2 JP 5277825 B2 JP5277825 B2 JP 5277825B2 JP 2008239860 A JP2008239860 A JP 2008239860A JP 2008239860 A JP2008239860 A JP 2008239860A JP 5277825 B2 JP5277825 B2 JP 5277825B2
Authority
JP
Japan
Prior art keywords
program
obfuscation
subroutine
subroutines
branch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008239860A
Other languages
Japanese (ja)
Other versions
JP2010072958A (en
Inventor
裕一 大根田
耕二 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2008239860A priority Critical patent/JP5277825B2/en
Publication of JP2010072958A publication Critical patent/JP2010072958A/en
Application granted granted Critical
Publication of JP5277825B2 publication Critical patent/JP5277825B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、プログラム難読化装置及び難読化プログラムに関する。   The present invention relates to a program obfuscation apparatus and an obfuscation program.

プログラムを悪意あるリバースエンジニアリングから守るために、様々なプログラム難読化技術が提案されている。プログラム難読化とは、プログラムの実行時動作を変えない限りにおいて、プログラムを人間にとって理解しづらくなるように変換する技術である。プログラムに難読化を施すことにより、リバースエンジニアリングにかかる費用や時間を大きくすることができる。ここで、リバースエンジニアリングとは、プログラムを解析し、モジュール間の関係の解明やシステムの基本仕様の分析をすることをいう。   Various program obfuscation techniques have been proposed to protect programs from malicious reverse engineering. Program obfuscation is a technique for converting a program so that it is difficult for humans to understand unless the runtime behavior of the program is changed. By obfuscating the program, the cost and time for reverse engineering can be increased. Here, reverse engineering means analyzing a program, elucidating the relationship between modules, and analyzing the basic specifications of the system.

特許文献1は、プログラムのソースコードに対して関数へのポインタ変数を新たに複数個導入し、関数ポインタ変数のいずれかに関数のアドレスを代入する命令文を複数個挿入し、プログラムにおける関数の呼出を関数ポインタ変数の値に応じて関数を呼出すように変換する。   In Patent Document 1, a plurality of pointer variables to a function are newly introduced into the source code of a program, and a plurality of instruction statements for assigning a function address to one of the function pointer variables are inserted. The call is converted to call the function according to the value of the function pointer variable.

特許文献2は、プログラムに含まれる繰り返し制御文を検出し、当該繰り返し制御文のインデックス変数に入力される値の順番を変更するようにプログラムの内容を変換する。   Patent Document 2 detects a repetition control statement included in a program, and converts the contents of the program so as to change the order of values input to the index variable of the repetition control statement.

特許文献3は、アセンブリプログラムを構成する複数の命令コードを偽の命令コードYで偽装するとともに、偽の命令コードYを元の正しい命令コードyに戻すルーチンXと、ルーチンXが戻した正しい命令コードyを再度偽の命令コードYで偽装するルーチンZとを生成し、生成したルーチンX及びZをアセンブリプログラム上の所定の位置に書き込み、自己書換えプログラムを生成する。   Patent Document 3 discloses a routine X that disguises a plurality of instruction codes constituting an assembly program with a fake instruction code Y, returns the fake instruction code Y to the original correct instruction code y, and a correct instruction returned by the routine X. A routine Z for impersonating the code y again with a false instruction code Y is generated, and the generated routines X and Z are written at predetermined positions on the assembly program to generate a self-rewriting program.

特許文献4は、プログラム中のデータを符号化規則C(a,b)=ax+bを用いて符号化し、符号化された符号化データを含む演算式の各演算子に演算子変換規則R(a,b)〜R10(a,b)を適用することにより演算式を符号化演算式に変換し、符号化演算式を復号化規則D(a,b)を用いて復号化演算式とする。さらに同様のプログラムの難読化を行う文献が非特許文献1ないし6に開示されている。   In Patent Document 4, data in a program is encoded using an encoding rule C (a, b) = ax + b, and an operator conversion rule R (a (a) is added to each operator of an arithmetic expression including the encoded data. , B) to R10 (a, b) are used to convert the arithmetic expression into an encoding arithmetic expression, and the encoding arithmetic expression is set as a decoding arithmetic expression using the decoding rule D (a, b). Non-Patent Documents 1 to 6 disclose documents that obfuscate similar programs.

また、特許文献5では、プログラムの中から、複数の命令コードを含む関数を抽出し、抽出された関数に含まれる命令を非定型の関数呼出/復帰命令に変換する。したがって、逆コンパイラの異常終了や誤った出力結果を引き起こすことを可能にする実行形式の生成が可能となる。   In Patent Document 5, a function including a plurality of instruction codes is extracted from a program, and an instruction included in the extracted function is converted into an atypical function call / return instruction. Therefore, it is possible to generate an executable format that can cause abnormal termination of the decompiler and an erroneous output result.

特開2003−337629号公報JP 2003-337629 A 特開2004−185064号公報JP 2004-185064 A 特開2004−192068号公報Japanese Patent Laid-Open No. 2004-192068 特開2005−49925号公報JP 2005-49925 A 特開2007−304726号公報JP 2007-304726 A C. Collberg, C. Thomborson, and D. Low, “Manufacturing Cheap, Resilient, and Stealthy Opaque Constructs”, Proceedings of the 25th ACM Symposium on Principles of Programming Languages, 1998C. Collberg, C. Thomborson, and D. Low, “Manufacturing Cheap, Resilient, and Stealthy Opaque Constructs”, Proceedings of the 25th ACM Symposium on Principles of Programming Languages, 1998 C. Collberg, C. Thomborson, and D. Low, “Breaking Abstractions and Unstructuring Data Structures”, Proceedings of the 1998 IEEE International Conference on Computer Languages, 1998C. Collberg, C. Thomborson, and D. Low, “Breaking Abstractions and Unstructuring Data Structures”, Proceedings of the 1998 IEEE International Conference on Computer Languages, 1998 C. Wang and J. Hill and J. Knight and J. Davidson, “Software Tamper Resistance: Obstructing Static Analysis of Programs”, Technical Report CS-2000-12, Department of Computer Science, University of Virginia, 2000C. Wang and J. Hill and J. Knight and J. Davidson, “Software Tamper Resistance: Obstructing Static Analysis of Programs”, Technical Report CS-2000-12, Department of Computer Science, University of Virginia, 2000 門田暁人, 高田義広, 鳥居宏次, “ループを含むプログラムを難読化する方法の提案”, 電子情報通信学会論文誌, Vol. J80-D-I, No. 7, 1997Masato Kadota, Yoshihiro Takada, Koji Torii, “Proposal for Obfuscating Programs Containing Loops”, IEICE Transactions, Vol. J80-D-I, No. 7, 1997 J. Chan and W. Yang, “Advanced Obfuscations on Java(登録商標) Bytecode”,Journal of Systems and Software, vol. 71(1?2), 2004J. Chan and W. Yang, “Advanced Obfuscations on Java (registered trademark) Bytecode”, Journal of Systems and Software, vol. 71 (1? 2), 2004 非特許文献6): C. Linn and S. Debry, “Obfuscation of Executable Code to Improve Resistance to Static Disassembly”, Proceedings of the 10th ACM Conference on Computer and Communications Security, 2003Non-Patent Document 6): C. Linn and S. Debry, “Obfuscation of Executable Code to Improve Resistance to Static Disassembly”, Proceedings of the 10th ACM Conference on Computer and Communications Security, 2003

本発明は、インライン展開を使用したプログラム解析に必要な計算量と記憶領域を増大させるプログラムを生成するプログラム難読化装置及び難読化プログラムを提供することを目的とする。   An object of the present invention is to provide a program obfuscation apparatus and an obfuscation program that generate a program that increases the amount of calculation and storage area required for program analysis using inline expansion.

かかる目的を達成するために本発明の請求項1記載のプログラム難読化装置は、難読化の度合いを示す難読化指数n(nは2以上の整数)を入力する入力手段と、少なくとも1つの命令文を含む難読化対象プログラムを選択する選択手段と、選択された難読化対象プログラムにn個の複数のサブルーチンを追加する追加手段と、前記選択された難読化対象プログラム中の少なくとも1つの命令文を追加された前記n個のサブルーチンの1つである第1のサブルーチンを呼び出す呼出命令に変換する変換手段とを有し、第1から第n−1のサブルーチンの各々は分岐構造を有し、該分岐構造の分岐節の少なくとも1つが別の1つのサブルーチンの呼出命令を含み、前記n個のサブルーチンは前記第1のサブルーチンから1つずつ順番に実行されるように関連付けられており、最後に実行される第nのサブルーチンは前記変換手段により前記第1のサブルーチンを呼び出す呼出命令に変換された命令文を実行することを特徴としている。
In order to achieve this object, the program obfuscation device according to claim 1 of the present invention comprises an input means for inputting an obfuscation index n (n is an integer of 2 or more) indicating the degree of obfuscation, and at least one command. Selecting means for selecting an obfuscation target program including a sentence; adding means for adding a plurality of n subroutines to the selected obfuscation target program; and at least one imperative sentence in the selected obfuscation target program Is converted into a call instruction for calling a first subroutine that is one of the n subroutines added, and each of the first to n- 1th subroutines has a branch structure, At least one of the branch section of the branched structure but contains a call instruction of another one of the subroutine, the n subroutine is executed one by one in order from the first sub-routine Are associated as, the subroutine of the n that is executed last is characterized by executing the converted instruction statement calling instruction for calling the first subroutine by said converting means.

請求項2記載の発明は、請求項1記載の発明において、前記分岐構造の分岐節のいずれか一方は、他方とは異なる別の1つのサブルーチンの呼出命令を含むことを特徴としている。   According to a second aspect of the present invention, in the first aspect of the present invention, any one of the branching clauses of the branch structure includes a call instruction for another subroutine different from the other.

請求項3記載の発明は、請求項1または2に記載の発明において、前記分岐構造の分岐節のいずれもが、別の1つのサブルーチンの呼出命令を含むことを特徴としている。   The invention according to claim 3 is the invention according to claim 1 or 2, characterized in that each of the branch clauses of the branch structure includes a call instruction for another subroutine.

請求項4記載の発明は、請求項1から3のいずれか一項記載の発明において、前記追加手段は、前記難読化対象のプログラムに複数のダミーのサブルーチンを追加し、前記複数のサブルーチンの前記分岐構造の少なくとも1つは、前記複数のダミーのサブルーチンの呼出命令を含むことを特徴としている。   The invention according to claim 4 is the invention according to any one of claims 1 to 3, wherein the adding means adds a plurality of dummy subroutines to the obfuscated program, and At least one of the branch structures includes a call instruction for the plurality of dummy subroutines.

請求項5記載の発明は、請求項1から4のいずれか一項記載の発明において、前記追加手段は、前記難読化対象のプログラムに含まれる変数を可逆的に操作する可逆関数を生成し、前記分岐構造の分岐節の少なくとも1つは、前記可逆関数に基づいて前記変数を可逆的に操作する命令文を含むことを特徴としている。   The invention according to claim 5 is the invention according to any one of claims 1 to 4, wherein the adding means generates a reversible function that reversibly manipulates a variable included in the obfuscated program, At least one of the branch clauses of the branch structure includes a statement that reversibly manipulates the variable based on the reversible function.

請求項6記載の発明は、請求項1から5のいずれか一項記載の発明において、前記分岐構造の条件式は、常に偽となる条件式であることを特徴としている。   The invention according to claim 6 is the invention according to any one of claims 1 to 5, wherein the conditional expression of the branch structure is a conditional expression that is always false.

請求項7記載の発明は、コンピュータに、難読化の度合いを示す難読化指数n(nは2以上の整数)を入力する入力手順と、少なくとも1つの命令文を含む難読化対象プログラムを選択する選択手順と、選択された難読化対象プログラムにn個の複数のサブルーチンを追加するプログラムに複数のサブルーチンを追加する追加手順と、前記選択された難読化対象プログラム中の少なくとも1つの命令文を追加された前記n個のサブルーチンの1つである第1のサブルーチンを呼び出す呼出命令に変換する変換手順とを実行させ、第1から第n−1のサブルーチンの各々は分岐構造を有し、該分岐構造の分岐節の少なくとも1つが別の1つのサブルーチンの呼出命令を含み、前記n個のサブルーチンは前記第1のサブルーチンから1つずつ順番に実行されるように関連付けられており、最後に実行される第nのサブルーチンは前記変換手段により前記第1のサブルーチンを呼び出す呼出命令に変換された命令文を実行することを実現させることを特徴としている。 The invention according to claim 7 selects an obfuscation target program including an input procedure for inputting an obfuscation index n (n is an integer of 2 or more) indicating the degree of obfuscation and at least one imperative sentence. adding and selection procedure, and additional steps to add multiple subroutine program for adding the n multiple subroutine selected obfuscated target program, at least one statement in the selected obfuscated target program to execute the conversion procedure for converting the call instruction for calling the first subroutine, which is one of the n subroutines, each of the first n-1 of the subroutine from the first has a branched structure, the branched at least one branch node structure includes a call instruction of another one subroutine, the order said n number of subroutines one by one from said first subroutine Are associated as being performed, the subroutine of the n that is finally executed as characterized by realizing that executes the converted instruction statement calling instruction for calling the first subroutine by said converting means Yes.

請求項1の発明は、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   The invention of claim 1 generates a program that increases the amount of calculation and the amount of storage area required for program analysis by inline expansion.

請求項2の発明は、サブルーチンに含まれる分岐構造のいずれの分岐節も別のサブルーチン呼出を含み、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   According to the second aspect of the present invention, any branch clause of the branch structure included in the subroutine includes another subroutine call, and generates a program that increases the amount of calculation and storage area necessary for program analysis by inline expansion.

請求項3の発明は、サブルーチンに含まれる分岐構造のいずれの分岐節も別の同一のサブルーチン呼出を含み、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   According to another aspect of the present invention, any branch clause of the branch structure included in the subroutine includes another same subroutine call, and generates a program that increases the amount of calculation and storage area necessary for program analysis by inline expansion.

請求項4の発明は、任意の命令文を実行するダミーのサブルーチンを含み、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   The invention of claim 4 includes a dummy subroutine for executing an arbitrary command statement, and generates a program that increases the amount of calculation and the amount of storage area required for program analysis by inline expansion.

請求項5の発明は、可逆関数に基づいて変数を可逆的に操作するプログラム片を含み、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   The invention of claim 5 includes a program piece that reversibly manipulates a variable based on a reversible function, and generates a program that increases a calculation amount and a storage area amount necessary for program analysis by inline expansion.

請求項6の発明は、常に偽となる条件式を含み、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   The invention of claim 6 generates a program that includes a conditional expression that is always false and increases the amount of calculation and the amount of storage area required for program analysis by inline expansion.

請求項7の発明は、インライン展開によるプログラム解析に必要な計算量と記憶領域量を増大させるプログラムを生成する。   The invention of claim 7 generates a program that increases the amount of calculation and the amount of storage area required for program analysis by inline expansion.

以下、本発明の最良の実施形態について図面を参照して説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, exemplary embodiments of the invention will be described with reference to the drawings.

図1は、本発明の実施例に用いられるプログラム難読化装置の構成を示すブロック図である。プログラム難読化装置10は、入出力装置14、演算装置11、RAM12、外部記憶装置13を含む。入出力装置14は、難読化装置を使用するユーザから指示を受け付けたり、難読化処理の結果を表示したりする。外部記憶装置13は、難読化対象プログラムや難読化後のプログラムを格納する。RAM12は、難読化処理中のプログラムを一時的に保存する装置である。演算装置11は、RAM上の難読化対象プログラムに難読化を適用する装置である。   FIG. 1 is a block diagram showing a configuration of a program obfuscation apparatus used in an embodiment of the present invention. The program obfuscation device 10 includes an input / output device 14, an arithmetic device 11, a RAM 12, and an external storage device 13. The input / output device 14 receives an instruction from a user who uses the obfuscation device or displays the result of the obfuscation processing. The external storage device 13 stores the obfuscation target program and the obfuscated program. The RAM 12 is a device that temporarily stores a program that is being obfuscated. The arithmetic device 11 is a device that applies obfuscation to the obfuscation target program on the RAM.

次に、本発明の第1の実施例のプログラム難読化方法について、図2ないし図16を参照して説明する。図2は任意の実行形式のプログラムを難読化する演算装置11の機能を示したブロック図である。演算装置11は、1個以上の難読化前のプログラムを入力する入力部21、入力されたプログラムの難読化処理を行う難読化処理部22、及び難読化されたプログラムを出力する出力部23から構成される。   Next, the program obfuscation method of the first embodiment of the present invention will be described with reference to FIGS. FIG. 2 is a block diagram showing the function of the arithmetic unit 11 for obfuscating a program in an arbitrary execution format. The arithmetic unit 11 includes an input unit 21 that inputs one or more programs before obfuscation, an obfuscation processing unit 22 that performs obfuscation processing of the input program, and an output unit 23 that outputs the obfuscated program. Composed.

難読化処理部22は、入力手段221と選択手段222により、難読化処理に必要な初期条件を決定する。   The obfuscation processing unit 22 determines an initial condition necessary for the obfuscation process by using the input unit 221 and the selection unit 222.

まず、入力手段221について説明する。
難読化処理部22は、難読化の度合いを示す難読化指数nを入力する入力手段221を有する。難読化指数nは、予め定められていてもよいし、難読化指数nの指定に基づき定めてもよい。また、難読化指数nの指定は、演算装置11がランダムに指定するようにしてもよいし、入出力装置14を介してユーザが指定するようにしても良い。
First, the input unit 221 will be described.
The obfuscation processing unit 22 includes an input unit 221 for inputting an obfuscation index n indicating the degree of obfuscation. The obfuscation index n may be determined in advance or may be determined based on the designation of the obfuscation index n. Also, the designation of the obfuscation index n may be designated by the arithmetic device 11 at random or by the user via the input / output device 14.

次に、選択手段222について説明する。
難読化指数nが決定すると、難読化処理部22は、1個以上の難読化前プログラムから、難読化を行うプログラム(以下、難読化対象プログラムという)を選択する。難読化対象プログラムは、予め定められていてもよいし、難読化対象プログラムの指定に基づき定めてもよい。また、難読化対象プログラムの指定は、演算装置11がランダムに指定してもよいし、入出力装置14を介してユーザが指定しても良い。
Next, the selection unit 222 will be described.
When the obfuscation index n is determined, the obfuscation processing unit 22 selects a program for obfuscation (hereinafter referred to as an obfuscation target program) from one or more pre-obfuscation programs. The obfuscation target program may be determined in advance or may be determined based on the designation of the obfuscation target program. The obfuscation target program may be designated by the arithmetic device 11 at random or by the user via the input / output device 14.

次に、難読化処理部22は、選択された難読化対象プログラムに含まれるルーチンを選択する。ルーチンは、選択された難読化対象プログラムに含まれる全てのルーチンを選択しても良いし、特定の(1個以上の)ルーチンのみを選択しても良い。選択するルーチンは、予め定められていてもよいし、ルーチンの指定に基づき定めてもよい。また、ルーチンの指定は、演算装置11がランダムに指定してもよいし、入出力装置14を介してユーザが指定しても良い。   Next, the obfuscation processing unit 22 selects a routine included in the selected obfuscation target program. As the routines, all the routines included in the selected obfuscation target program may be selected, or only specific (one or more) routines may be selected. The routine to be selected may be determined in advance or may be determined based on the designation of the routine. The routine may be specified by the arithmetic device 11 at random, or by the user via the input / output device 14.

次に、難読化処理部22は、選択したルーチンに含まれる1以上の連続する命令文をプログラム片として選択する。選択するプログラム片は、予め定められていてもよいし、プログラム片の指定により選択しても良い。また、プログラム片の指定は、演算装置11がランダムに指定しても良いし、入出力装置14を介してユーザが指定しても良い。   Next, the obfuscation processing unit 22 selects one or more consecutive command statements included in the selected routine as a program piece. The program piece to be selected may be determined in advance or may be selected by specifying the program piece. The program piece may be designated by the arithmetic device 11 at random or by the user via the input / output device 14.

難読化処理部22は、入力手段221と選択手段222により決定された初期条件と難読化処理規則に従い、追加手段223によって難読化対象のプログラムにサブルーチンを追加する。
そして、難読化処理部22は変換手段224によって、選択手段222で選択したプログラム片を、追加手段224により追加したサブルーチンの呼出しに変換する。
難読化処理部22は、追加手段223と変換手段224により、難読化対象プログラムの難読化を終了する。
The obfuscation processing unit 22 adds a subroutine to the program to be obfuscated by the adding unit 223 in accordance with the initial condition and the obfuscation processing rule determined by the input unit 221 and the selection unit 222.
Then, the obfuscation processing unit 22 converts the program piece selected by the selection unit 222 into a subroutine call added by the addition unit 224 by the conversion unit 224.
The obfuscation processing unit 22 ends obfuscation of the obfuscation target program by the adding unit 223 and the converting unit 224.

出力部23は、難読化処理部22により難読化の処理が終了したプログラムを受け取る。そのプログラムが難読化装置の全体としての出力となる。難読化されたプログラムは例えば外部記憶装置13に記憶される。   The output unit 23 receives a program for which the obfuscation processing unit 22 has finished the obfuscation process. The program becomes the output of the obfuscation device as a whole. The obfuscated program is stored in the external storage device 13, for example.

次に、難読化処理手順について説明する。
まず、本発明の第1の実施例に係るプログラム難読化装置の操作画面と操作例について、図3を用いて説明する。
Next, the obfuscation processing procedure will be described.
First, an operation screen and an operation example of the program obfuscation apparatus according to the first embodiment of the present invention will be described with reference to FIG.

図3は、難読化処理装置の操作画面の1例を示したものである。
操作画面30は、入力部21に入力された1個以上の難読化前のプログラムを、ソースファイルリスト31に表示する。
ユーザは、そのソースファイルリスト31の中から、難読化したいプログラムを選択する。 難読化したいプログラムの選択を行うと、ルーチンリスト32に、選択したプログラムに含まれるルーチンが表示される。
FIG. 3 shows an example of the operation screen of the obfuscation processing apparatus.
The operation screen 30 displays one or more unobfuscated programs input to the input unit 21 in the source file list 31.
The user selects a program to be obfuscated from the source file list 31. When a program to be obfuscated is selected, routines included in the selected program are displayed in the routine list 32.

ユーザが、ルーチンリスト32から難読化を行うルーチンを選択すると、難読化前ルーチン欄33に選択したルーチンのソースコードが表示される。
図3では、mainというルーチンのソースコードが表示されている。 以上の操作により、ユーザは、難読化したいプログラムと、難読化対象のルーチンを選択する。
When the user selects a routine to be obfuscated from the routine list 32, the source code of the selected routine is displayed in the pre-obfuscation routine column 33.
In FIG. 3, the source code of a routine called main is displayed. Through the above operation, the user selects a program to be obfuscated and a routine to be obfuscated.

次に、ユーザは、難読化の度合いを決定する難読化指数nを指定するため、パラメタ入力34に、2以上の整数を入力する。 図3では、例として15が入力されている。この難読化指数nにより、難読化処理部22の追加手段によって、追加されるサブルーチンの個数が決定される。   Next, the user inputs an integer of 2 or more in the parameter input 34 in order to designate the obfuscation index n that determines the degree of obfuscation. In FIG. 3, 15 is input as an example. Based on the obfuscation index n, the number of subroutines to be added is determined by the adding means of the obfuscation processing unit 22.

ユーザは、変換手段によってサブルーチンに変換されるプログラム片を指定するため、難読化前ルーチン欄33に表示されたサブルーチンに含まれるプログラム片を、マウスカーソル35で選択する。 図3では、a+=bの演算命令が、プログラム片として選択されている。   The user uses the mouse cursor 35 to select a program piece included in the subroutine displayed in the pre-obfuscation routine column 33 in order to specify a program piece to be converted into a subroutine by the conversion means. In FIG. 3, the arithmetic instruction of a + = b is selected as the program piece.

上記処理にて、難読化処理に必要な初期条件の設定が終了したので、ユーザは難読化実行ボタン36を押す。 すると、難読化処理が実行され、難読化適用後のプログラムが難読化適用後ルーチン欄37に表示される。 ユーザは、難読化結果を確認した上で難読化後プログラムの保存ボタン38を押し、難読化後のプログラムを保存することができる。
難読化処理を終了するには、ユーザは終了ボタン39を押せばよい。
Since the initial conditions necessary for the obfuscation process have been set in the above process, the user presses the obfuscation execution button 36. Then, the obfuscation process is executed, and the program after the obfuscation application is displayed in the post-obfuscation application routine column 37. After confirming the obfuscation result, the user can press the obfuscated program save button 38 to save the obfuscated program.
To end the obfuscation process, the user may press the end button 39.

次に、上記操作による難読化処理を実現するために難読化処理部22が行う難読化処理手順を、図4を用いて説明する。
図4は、難読化処理部22が、1の難読化処理規則に従って行う難読化処理のフローチャートである。
Next, the obfuscation processing procedure performed by the obfuscation processing unit 22 in order to realize the obfuscation processing by the above operation will be described with reference to FIG.
FIG. 4 is a flowchart of the obfuscation processing performed by the obfuscation processing unit 22 in accordance with one obfuscation processing rule.

まず、ユーザまたは演算装置11は、難読化の度合いを決定する難読化指数n(nは2以上)を指定する(ステップS61)。本ステップは、図3に示した操作画面の例では、パラメタ入力34に2以上の整数を入力することに対応する。   First, the user or the computing device 11 designates an obfuscation index n (n is 2 or more) that determines the degree of obfuscation (step S61). This step corresponds to inputting an integer of 2 or more to the parameter input 34 in the example of the operation screen shown in FIG.

次に、ユーザまたは演算装置11は、複数ある難読化対象のプログラムの中から、難読化を行うプログラムP、プログラムPに含まれるルーチンR及びルーチンR中のプログラム片Bを選択する(ステップS62)。本ステップは、図3に示した操作画面の例では、プログラムPの選択は、ソースファイルリスト31から難読化を行うプログラムを選択することに対応する。また、ルーチンRの選択は、ルーチンリスト32からルーチンRを選択することに対応し、プログラム片Bの選択は、難読化前ルーチン欄33から、マウスカーソル35で「a+=b」を選択することに対応する。   Next, the user or the arithmetic unit 11 selects the obfuscation target program P, the routine P included in the program P, and the program piece B in the routine R (step S62). . This step corresponds to selecting the program to be obfuscated from the source file list 31 in the example of the operation screen shown in FIG. The selection of the routine R corresponds to the selection of the routine R from the routine list 32, and the selection of the program piece B is performed by selecting “a + = b” with the mouse cursor 35 from the routine block 33 before obfuscation. Corresponding to

プログラム難読化装置10は、ルーチンRに含まれるプログラム片Bの実行時動作を変えることなく、難読化が終了したプログラムPをユーザに提供するように、難読化処理を行う。   The program obfuscation apparatus 10 performs the obfuscation process so that the obfuscated program P is provided to the user without changing the execution operation of the program piece B included in the routine R.

本実施例では、任意のプログラムPに含まれる図5のメインルーチンmainをルーチンRとして選択し、mainに含まれる「a+=b」の演算命令をプログラム片Bとして選択した場合の難読化処理について説明する。   In this embodiment, the obfuscation process when the main routine main of FIG. 5 included in an arbitrary program P is selected as the routine R and the operation instruction “a + = b” included in main is selected as the program piece B. explain.

難読化処理部22は、プログラムPに、前処理(ステップS62)で選択されたプログラム片Bのソースコードを含むサブルーチンsubB(図6)と、任意のソースコードを含むダミーのサブルーチンsubDmmy(図7)を追加する(ステップS63)。従って、subBを呼出すと、選択されたプログラム片Bが実行されることになる。   The obfuscation processing unit 22 includes, in the program P, a subroutine subB (FIG. 6) including the source code of the program piece B selected in the preprocessing (step S62) and a dummy subroutine subDmmy (FIG. 7) including an arbitrary source code. ) Is added (step S63). Therefore, when subB is called, the selected program fragment B is executed.

次に、難読化処理部22は、プログラムPに、第1サブルーチンsub_1をプログラムPに追加する(ステップS64)。ただし、sub_1は、任意の常に偽となる条件式(以下、恒偽の条件式と略記する)を条件判定とし、かつ、真の条件節からsubDmmyを呼出し、偽の条件節からsubBを呼出す条件分岐から構成されるとする(図8)。ここで、図8中の「k*(k−1)%2!=0」は、常に偽となる条件式である。
本処理によって追加されたsub_1を呼出すと、subBが必ず呼出され、その結果、選択されたプログラム片Bが実行されることになる。
Next, the obfuscation processing unit 22 adds the first subroutine sub_1 to the program P to the program P (step S64). However, sub_1 uses a conditional expression that is always false (hereinafter abbreviated as a false conditional expression) as a condition determination, calls subDmmy from a true conditional clause, and calls subB from a false conditional clause. Assume that it is composed of branches (FIG. 8). Here, “k * (k−1)% 2! = 0” in FIG. 8 is a conditional expression that is always false.
When sub_1 added by this process is called, subB is always called, and as a result, the selected program piece B is executed.

難読化処理部22は、i=2、・・・、nに関して、iに対応するサブルーチンsub_i(i=2、・・・、n)をプログラムPに追加する(ステップS65)。
ただし、sub_iは、任意の恒偽の条件式を条件判定とし、かつ、真の条件節はsub_i−1の呼出しと、任意に作成した1以上の連続する命令文Dmmy_iから成り、偽の条件節はsub_i−1の呼出しからなる条件分岐、から構成されるとする(図9)。
The obfuscation processing unit 22 adds a subroutine sub_i (i = 2,..., N) corresponding to i to the program P for i = 2,..., N (step S65).
However, sub_i uses an arbitrary false conditional expression as a condition determination, and a true conditional clause consists of a call of sub_i-1 and one or more consecutive command statements Dmmy_i created arbitrarily, and a false conditional clause Is composed of conditional branches consisting of calls to sub_i-1 (FIG. 9).

本処理の結果、1処理前に追加されたサブルーチンの呼出しを行うサブルーチンが追加されることになる。つまり、sub_2は、前処理で追加されたsub_1の呼出しを行い、sub_3はsub_2の呼出しを行うことになる。   As a result of this process, a subroutine for calling a subroutine added before one process is added. That is, sub_2 calls sub_1 added in the pre-processing, and sub_3 calls sub_2.

難読化処理部22は、プログラム片Bを、前処理(ステップS65)の最後に追加されたサブルーチンsub_nの呼出しに変換する(ステップS66)。
これにより、本実施例では、ユーザがメインルーチンを実行すると、sub_nの実行により、sub_n−1が呼出され、sub_n−1によってsub_n-2が呼出されることになる。
そして、n回のサブルーチン呼出しを経た後に、サブルーチンsubBが呼出され、選択されたプログラム片Bが実行されることとなる。
The obfuscation processing unit 22 converts the program piece B into a call to the subroutine sub_n added at the end of the preprocessing (step S65) (step S66).
Thus, in this embodiment, when the user executes the main routine, sub_n-1 is called by executing sub_n, and sub_n-2 is called by sub_n-1.
After n times of subroutine calls, the subroutine subB is called, and the selected program piece B is executed.

上述の処理により、プログラムPの難読化が完了する。そこで、難読化処理部22は、難読化適用済みプログラムPを出力部23へ出力する(ステップS67)。   The obfuscation of the program P is completed by the above processing. Therefore, the obfuscation processing unit 22 outputs the obfuscation-applied program P to the output unit 23 (step S67).

本実施例によれば、図5の難読化前のルーチンmainを含むプログラムPは、図10のように難読化される。   According to the present embodiment, the program P including the routine main before obfuscation in FIG. 5 is obfuscated as shown in FIG.

本実施例によって得られた難読化後のプログラムは、インライン展開に必要な記憶領域及び処理量を増大させるものである。
そこで、難読化後のプログラム図10に対して、インライン展開を行った場合のプログラムの変化を模式的に示した図11を用いて、その難読化の効果を説明する。
図11では、丸はサブルーチンを、丸から丸への矢印はサブルーチンの呼出しを表している。丸1から丸2にk本の矢印がある場合、丸1に対応する関数の中に、丸2に対応するサブルーチン呼出しがk箇所ある事を示す。
The obfuscated program obtained by the present embodiment increases the storage area and processing amount necessary for inline expansion.
Therefore, the obfuscation effect will be described with reference to FIG. 11 schematically showing changes in the program when inline expansion is performed on the obfuscated program FIG.
In FIG. 11, a circle represents a subroutine, and a circle-to-circle arrow represents a subroutine call. If there are k arrows from circle 1 to circle 2, it indicates that there are k subroutine calls corresponding to circle 2 in the function corresponding to circle 1.

難読化後プログラム41は、難読化後のプログラム図10を模式的に表したものである。難読化後プログラム41のsub_nをインライン展開すると、第1インライン展開42のようになる。第1インライン展開42は、mainの中にsub_nの中身が1つ展開されたことを模式的に表している。   The obfuscated program 41 is a schematic representation of the obfuscated program FIG. When sub_n of the obfuscated program 41 is expanded inline, a first inline expansion 42 is obtained. The first inline expansion 42 schematically represents that one content of sub_n is expanded in main.

第1インライン展開42のsub_n−1をさらにインライン展開すると、第2インライン展開43のようになる。mainの中にsub_n−1の呼出が2箇所あったので、第2インライン展開43では、mainにsub_n−1の中身が2つ展開されている。第2インライン展開43のsub_n−2をさらにインライン展開すると、第3インライン展開44のようになる。   When sub_n−1 of the first inline expansion 42 is further expanded inline, a second inline expansion 43 is obtained. Since there are two calls of sub_n-1 in main, in the second inline expansion 43, two contents of sub_n-1 are expanded in main. When sub_n-2 of the second inline expansion 43 is further expanded inline, a third inline expansion 44 is obtained.

mainの中にsub_n−2の呼出が4箇所あったので、第3インライン展開44では、mainにsub_n−2の中身が4つ展開される。
以上に示したように、難読化後のプログラムにインライン展開を順次行っていくと、サブルーチンの展開数はnに関して指数関数的になる。そのため、難読化後のプログラムにインライン展開を適用すると、ルーチンmainのサイズがnに関して指数関数的に大きくなる。従って、nがある程度大きくなる(例えば、n=50)と、インライン展開は現実的に実行不可能となる。
Since there are four calls of sub_n-2 in main, in the third inline expansion 44, the contents of sub_n-2 are expanded in main.
As described above, when inline expansion is sequentially performed on the obfuscated program, the number of expansions of the subroutine becomes exponential with respect to n. Therefore, when inline expansion is applied to the obfuscated program, the size of the routine main increases exponentially with respect to n. Therefore, when n becomes large to some extent (for example, n = 50), inline expansion becomes practically impossible.

次に、図12を用いて、難読化処理部22が、上述の難読化処理規則とは別の難読化処理規則に従って行う難読化処理について説明する。   Next, an obfuscation process performed by the obfuscation processing unit 22 according to an obfuscation process rule different from the above-described obfuscation process rule will be described with reference to FIG.

まず、ユーザまたは演算装置11は、難読化を行うプログラムPと、難読化の度合いを決定する整数n(nは2以上)を指定する(ステップS131)。本ステップは、図3に示した操作画面の例では、パラメタ入力34に2以上の整数を入力することに対応する。   First, the user or the arithmetic unit 11 designates a program P that performs obfuscation and an integer n (n is 2 or more) that determines the degree of obfuscation (step S131). This step corresponds to inputting an integer of 2 or more to the parameter input 34 in the example of the operation screen shown in FIG.

次に、ユーザまたは演算装置11は、複数ある難読化プログラムの中から、難読化を行うプログラムP、プログラムPに含まれるルーチンR及びルーチンR中のプログラム片Bを選択する(ステップS132)。本ステップは、図3に示した操作画面の例では、プログラムPの選択は、ソースファイルリスト31から難読化を行うプログラムを選択することに対応する。また、ルーチンRの選択は、ルーチンリスト32からルーチンRを選択することに対応し、プログラム片Bの選択は、難読化前ルーチン欄33から、マウスカーソル35で「a+=b」を選択することに対応する。   Next, the user or the computing device 11 selects the obfuscation program P, the routine P included in the program P, and the program piece B in the routine R (step S132). This step corresponds to selecting the program to be obfuscated from the source file list 31 in the example of the operation screen shown in FIG. The selection of the routine R corresponds to the selection of the routine R from the routine list 32, and the selection of the program piece B is performed by selecting “a + = b” with the mouse cursor 35 from the routine block 33 before obfuscation. Corresponding to

プログラム難読化装置10は、ルーチンRに含まれるプログラム片Bの実行時動作を変えることなく、難読化が終了したプログラムPをユーザに提供するように、難読化処理を行う。   The program obfuscation apparatus 10 performs the obfuscation process so that the obfuscated program P is provided to the user without changing the execution operation of the program piece B included in the routine R.

本実施例では、任意のプログラムPに含まれる図5のメインルーチンmainをルーチンRとして選択し、mainに含まれる「a+=b」の演算命令をプログラム片Bとして選択した場合の難読化処理について説明する。   In this embodiment, the obfuscation process when the main routine main of FIG. 5 included in an arbitrary program P is selected as the routine R and the operation instruction “a + = b” included in main is selected as the program piece B. explain.

難読化処理部22は、プログラムPに、前処理(ステップS132)で選択されたプログラム片Bのソースコードを含むサブルーチンsubB(図6)と、任意のソースコードを含むダミーのサブルーチン(図7)を追加する(ステップS133)。従って、subBを呼出すと、選択されたプログラム片Bが実行されることになる。   The obfuscation processing unit 22 includes, in the program P, a subroutine subB (FIG. 6) including the source code of the program piece B selected in the preprocessing (step S132) and a dummy subroutine (FIG. 7) including an arbitrary source code. Is added (step S133). Therefore, when subB is called, the selected program fragment B is executed.

次に、難読化処理部22は、難読化対象のプログラムに、第1サブルーチンsub_1をプログラムPに追加する(ステップS134)。ただし、sub_1は、任意の恒偽の条件式を条件判定とし、かつ、真の条件節からsubDmmyを呼出し、偽の条件節からsubBを呼出す条件分岐から構成されるとする(図8)。ここで、図8中の「k*k−1%2!=0」は、常に偽となる条件式である。
本処理によって追加されたsub_1を呼出すと、subBが必ず呼出され、その結果、選択されたプログラム片Bが実行されることになる。
Next, the obfuscation processing unit 22 adds the first subroutine sub_1 to the program P as the obfuscation target program (step S134). However, it is assumed that sub_1 is composed of a conditional branch that uses an arbitrary false conditional expression as a condition determination, calls subDmmy from a true conditional clause, and calls subB from a false conditional clause (FIG. 8). Here, “k * k−1% 2! = 0” in FIG. 8 is a conditional expression that is always false.
When sub_1 added by this process is called, subB is always called, and as a result, the selected program piece B is executed.

次に、ユーザまたは演算装置11は、プログラムPから任意の整数変数xを選択し、難読化処理部22は選択された整数xを入出力とする可逆関数gを生成する(ステップS135)。本実施例では、可逆関数gとしてg(x)=2*x+3を生成したとする。
可逆関数gは、後述する処理で追加されるサブルーチン内で利用される。
Next, the user or the arithmetic unit 11 selects an arbitrary integer variable x from the program P, and the obfuscation processing unit 22 generates a reversible function g having the selected integer x as an input / output (step S135). In this embodiment, it is assumed that g (x) = 2 * x + 3 is generated as the reversible function g.
The reversible function g is used in a subroutine added in the process described later.

難読化処理部22は、i=2、・・・、2n+1に関して、iに対応するサブルーチンsub_i(i=2、・・・、2n+1)をプログラムPに追加する(ステップS136)。ただし、i=3,5、・・・、2n+1に関して、sub_iは、任意の条件式を条件判定とし、かつ、真/偽の条件節ともにx=g(x)と同一の結果を返すプログラム片とsub_i−1との呼出しから成る(図13)。
また、i=2、4、・・・、2nに関して、sub_iは、任意の条件式を条件判定とし、かつ、真/偽の条件節とともにx=g〜(x)と同じ結果を返すプログラム片と、sub_i−1との呼出しから成る(図14)。ここで、g〜とは、gの逆関数である。つまり、g〜(x)=(x−3)/2である。
The obfuscation processing unit 22 adds a subroutine sub_i (i = 2,..., 2n + 1) corresponding to i to the program P for i = 2,..., 2n + 1 (step S136). However, for i = 3, 5,..., 2n + 1, sub_i is a program fragment that uses an arbitrary conditional expression as a condition determination and returns the same result as x = g (x) for both true / false conditional clauses. And sub_i-1 (FIG. 13).
Also, for i = 2, 4,..., 2n, sub_i is a program fragment that uses an arbitrary conditional expression as a condition determination and returns the same result as x = g to (x) together with a true / false conditional clause. And a call of sub_i-1 (FIG. 14). Here, g˜ is an inverse function of g. That is, g to (x) = (x−3) / 2.

難読化処理部22は、プログラム片Bを、前処理(ステップS136)の最後に追加されたサブルーチンsub_2n+1の呼出しに変換する(ステップS137)。
これにより、本実施例では、ユーザがメインルーチンを実行すると、sub_2n+1の実行により、sub_2nが呼出され、sub_2nによって、sub_2(n−1)+1が呼出されることになる。
そして、2n+1回のサブルーチン呼出しを経た後に、サブルーチンsubBが呼出され、選択されたプログラム片Bが実行されることとなる。
The obfuscation processing unit 22 converts the program piece B into a call to the subroutine sub_2n + 1 added at the end of the preprocessing (step S136) (step S137).
Thereby, in this embodiment, when the user executes the main routine, sub_2n is called by executing sub_2n + 1, and sub_2 (n-1) +1 is called by sub_2n.
Then, after 2n + 1 subroutine calls, the subroutine subB is called, and the selected program piece B is executed.

上述した処理により、プログラムPの難読化処理は終了するため、難読化処理部22は、難読化適用済みプログラムPを出力部23へ出力する(ステップS138)   Since the obfuscation processing of the program P is completed by the above-described processing, the obfuscation processing unit 22 outputs the obfuscated application program P to the output unit 23 (step S138).

本実施例によれば、図5の難読化前のルーチンmainを含むプログラムPは、図15のように難読化される。   According to the present embodiment, the program P including the routine main before obfuscation in FIG. 5 is obfuscated as shown in FIG.

本実施例によって得られた難読化後のプログラムは、インライン展開に必要な記憶領域及び処理量を増大させるものである。
そこで、難読化後のプログラム図15に対して、インライン展開を行った場合のプログラムの変化を模式的に示した図16を用いて、その難読化の効果を説明する。
図16では、丸はサブルーチンを、丸から丸への矢印はサブルーチンの呼出しを表している。丸1から丸2にk本の矢印がある場合、丸1に対応する関数の中に、丸2に対応するサブルーチン呼出しがk箇所ある事を示す。
The obfuscated program obtained by the present embodiment increases the storage area and processing amount necessary for inline expansion.
Therefore, the obfuscation effect will be described with reference to FIG. 16 schematically showing the change of the program when inline expansion is performed on the obfuscated program FIG.
In FIG. 16, a circle represents a subroutine, and a circle-to-circle arrow represents a subroutine call. If there are k arrows from circle 1 to circle 2, it indicates that there are k subroutine calls corresponding to circle 2 in the function corresponding to circle 1.

難読化後プログラム51は、難読化後のプログラム図15を模式的に表したものである。難読化後プログラム51のsub_2n+1をインライン展開すると、第1インライン展開52のようになる。第1インライン展開42は、mainの中にsub_2n+1の中身が1つ展開されたことを模式的に表している。   The obfuscated program 51 is a schematic representation of the obfuscated program FIG. When sub_2n + 1 of the obfuscated program 51 is expanded inline, the first inline expansion 52 is obtained. The first inline expansion 42 schematically represents that one content of sub_2n + 1 is expanded in the main.

第1インライン展開52のsub_2n+1をさらにインライン展開すると、第2インライン展開53のようになる。mainの中にsub_2nの呼出が2箇所あったので、第2インライン展開53では、mainにsub_2nの中身が2つ展開されている。第2インライン展開53のsub_2nをさらにインライン展開すると、第3インライン展開44のようになる。   When sub_2n + 1 of the first inline expansion 52 is further expanded inline, a second inline expansion 53 is obtained. Since there are two calls of sub_2n in main, in the second inline expansion 53, two contents of sub_2n are expanded in main. When sub_2n of the second inline expansion 53 is further expanded inline, a third inline expansion 44 is obtained.

mainの中にsub_2(n−1)+1の呼出が4箇所あったので、第3インライン展開44では、mainにsub_2(n−1)+1の中身が4つ展開される。
以上に示したように、難読化後のプログラムにインライン展開を順次行っていくと、サブルーチンの展開数はnに関して指数関数的になる。そのため、難読化後のプログラムにインライン展開を適用すると、ルーチンmainのサイズがnに関して指数関数的に大きくなる。従って、nがある程度大きくなる(例えば、n=50)と、インライン展開は現実的に実行不可能となる。
Since there are four calls of sub_2 (n−1) +1 in the main, in the third inline expansion 44, the contents of sub_2 (n−1) +1 are expanded in the main.
As described above, when inline expansion is sequentially performed on the obfuscated program, the number of expansions of the subroutine becomes exponential with respect to n. Therefore, when inline expansion is applied to the obfuscated program, the size of the routine main increases exponentially with respect to n. Therefore, when n becomes large to some extent (for example, n = 50), inline expansion becomes practically impossible.

以上、本発明の好ましい実施の形態について詳述したが、本発明に係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific embodiments according to the present invention, and various modifications can be made within the scope of the gist of the present invention described in the claims. Deformation / change is possible.

プログラム難読化装置の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of a program obfuscation apparatus. 演算装置の機能ブロック図の一例である。It is an example of a functional block diagram of a computing device. 難読化処理装置の操作画面の例である。It is an example of the operation screen of an obfuscation processing apparatus. 難読化処理の一例を示すフローチャートである。It is a flowchart which shows an example of an obfuscation process. 難読化前のルーチン例である。It is an example routine before obfuscation. プログラム片を含むサブルーチン例である。It is an example of a subroutine including a program piece. ダミーのサブルーチン例である。It is an example of a dummy subroutine. 第1サブルーチンの例である。It is an example of a first subroutine. 番号iに対応するサブルーチンiの例である。It is an example of a subroutine i corresponding to the number i. 難読化後のプログラム例である。It is an example program after obfuscation. インライン展開の模式図である。It is a schematic diagram of inline expansion. 難読化処理の一例を示すフローチャートである。It is a flowchart which shows an example of an obfuscation process. iが偶数の場合の、番号iに対応するサブルーチンiの例である。It is an example of the subroutine i corresponding to the number i when i is an even number. iが奇数の場合の、番号iに対応するサブルーチンiの例である。It is an example of the subroutine i corresponding to the number i when i is an odd number. 難読化後のプログラム例である。It is an example program after obfuscation. インライン展開の模式図である。It is a schematic diagram of inline expansion.

符号の説明Explanation of symbols

10…プログラム難読化装置
11…演算装置
12…RAM
13…外部記憶装置
14…入出力装置
21…入力部
22…難読化処理部
23…出力部
30…操作画面
31…ソースファイルリスト
32…ルーチンリスト
33…難読化前ルーチン欄
34…パラメタ入力欄
35…難読化実行ボタン
37…難読化後ルーチン欄
38…難読化後プログラムの保存
39…終了ボタン
41…難読化後プログラム
42…第1インライン展開
43…第2インライン展開
44…第3インライン展開
51…難読化後プログラム
52…第1インライン展開
53…第2インライン展開
54…第3インライン展開
221…入力手段
222…選択手段
223…追加手段
224…変換手段
10 ... Program obfuscation device 11 ... Arithmetic device 12 ... RAM
DESCRIPTION OF SYMBOLS 13 ... External storage device 14 ... Input / output device 21 ... Input unit 22 ... Obfuscation processing unit 23 ... Output unit 30 ... Operation screen 31 ... Source file list 32 ... Routine list 33 ... Pre-obfuscation routine column 34 ... Parameter input column 35 ... obfuscation execution button 37 ... obfuscated routine column 38 ... obfuscated program storage 39 ... end button 41 ... obfuscated program 42 ... first inline expansion 43 ... second inline expansion 44 ... third inline expansion 51 ... Obfuscated program 52 ... first inline expansion 53 ... second inline expansion 54 ... third inline expansion 221 ... input means 222 ... selection means 223 ... addition means 224 ... conversion means

Claims (7)

難読化の度合いを示す難読化指数n(nは2以上の整数)を入力する入力手段と、
少なくとも1つの命令文を含む難読化対象プログラムを選択する選択手段と、
選択された難読化対象プログラムにn個の複数のサブルーチンを追加する追加手段と、
前記選択された難読化対象プログラム中の少なくとも1つの命令文を追加された前記n個のサブルーチンの1つである第1のサブルーチンを呼び出す呼出命令に変換する変換手段とを有し、
第1から第n−1のサブルーチンの各々は分岐構造を有し、該分岐構造の分岐節の少なくとも1つが別の1つのサブルーチンの呼出命令を含み、前記n個のサブルーチンは前記第1のサブルーチンから1つずつ順番に実行されるように関連付けられており、最後に実行される第nのサブルーチンは前記変換手段により前記第1のサブルーチンを呼び出す呼出命令に変換された命令文を実行することを特徴とするプログラム難読化装置。
An input means for inputting an obfuscation index n (n is an integer of 2 or more) indicating the degree of obfuscation,
Selecting means for selecting an obfuscation target program including at least one command statement;
An additional means for adding a plurality of n subroutines to the selected obfuscated program;
Conversion means for converting at least one instruction sentence in the selected obfuscation target program into a call instruction for calling a first subroutine which is one of the added n subroutines;
Each of the first to (n-1) -th subroutines has a branch structure, and at least one of the branch nodes of the branch structure includes a call instruction for another subroutine, and the n subroutines are the first subroutine. The n-th subroutine executed last is executed by the conversion means to execute the instruction sentence converted to a call instruction for calling the first subroutine. Feature program obfuscation device.
前記分岐構造の分岐節のいずれか一方は、他方とは異なる別の1つのサブルーチンの呼出命令を含むことを特徴とする請求項1に記載のプログラム難読化装置。   2. The program obfuscation apparatus according to claim 1, wherein one of the branch clauses of the branch structure includes a call instruction of another subroutine different from the other. 前記分岐構造の分岐節のいずれもが、別の1つのサブルーチンの呼出命令を含むことを特徴とする請求項1または2に記載のプログラム難読化装置。   3. The program obfuscation apparatus according to claim 1, wherein each of the branch clauses of the branch structure includes a call instruction for another subroutine. 前記追加手段は、前記難読化対象のプログラムに複数のダミーのサブルーチンを追加し、
前記複数のサブルーチンの前記分岐構造の少なくとも1つは、前記複数のダミーのサブルーチンの呼出命令を含むことを特徴とする請求項1から3のいずれか一項記載のプログラム難読化装置。
The adding means adds a plurality of dummy subroutines to the obfuscated program,
4. The program obfuscation apparatus according to claim 1, wherein at least one of the branch structures of the plurality of subroutines includes a call instruction for the plurality of dummy subroutines. 5.
前記追加手段は、前記難読化対象のプログラムに含まれる変数を可逆的に操作する可逆関数を生成し、
前記分岐構造の分岐節の少なくとも1つは、前記可逆関数に基づいて前記変数を可逆的に操作する命令文を含むことを特徴とする請求項1から4のいずれか一項記載のプログラム難読化装置。
The additional means generates a reversible function that reversibly manipulates variables included in the obfuscated program,
5. The program obfuscation according to claim 1, wherein at least one of the branch clauses of the branch structure includes a statement that reversibly manipulates the variable based on the reversible function. apparatus.
前記分岐構造の条件式は、常に偽となる条件式であることを特徴とする請求項1から5のいずれか一項記載のプログラム難読化装置。   The program obfuscation apparatus according to claim 1, wherein the conditional expression of the branch structure is a conditional expression that is always false. コンピュータに、
難読化の度合いを示す難読化指数n(nは2以上の整数)を入力する入力手順と、
少なくとも1つの命令文を含む難読化対象プログラムを選択する選択手順と、
選択された難読化対象プログラムにn個の複数のサブルーチンを追加するプログラムに複数のサブルーチンを追加する追加手順と、
前記選択された難読化対象プログラム中の少なくとも1つの命令文を追加された前記n個のサブルーチンの1つである第1のサブルーチンを呼び出す呼出命令に変換する変換手順とを実行させ、
第1から第n−1のサブルーチンの各々は分岐構造を有し、該分岐構造の分岐節の少なくとも1つが別の1つのサブルーチンの呼出命令を含み、前記n個のサブルーチンは前記第1のサブルーチンから1つずつ順番に実行されるように関連付けられており、最後に実行される第nのサブルーチンは前記変換手段により前記第1のサブルーチンを呼び出す呼出命令に変換された命令文を実行することを実現させるための難読化プログラム。
On the computer,
An input procedure for inputting an obfuscation index n (n is an integer of 2 or more) indicating the degree of obfuscation,
A selection procedure for selecting an obfuscated program including at least one statement;
An additional procedure for adding a plurality of subroutines to a program for adding a plurality of n subroutines to the selected obfuscation program;
A conversion procedure for converting at least one command statement in the selected obfuscation target program into a call command for calling a first subroutine that is one of the added n subroutines;
Each of the first to (n-1) -th subroutines has a branch structure, and at least one of the branch nodes of the branch structure includes a call instruction for another subroutine, and the n subroutines are the first subroutine. The n-th subroutine executed last is executed by the conversion means to execute the instruction sentence converted to a call instruction for calling the first subroutine. Obfuscation program to realize.
JP2008239860A 2008-09-18 2008-09-18 Program obfuscation device and obfuscation program Expired - Fee Related JP5277825B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008239860A JP5277825B2 (en) 2008-09-18 2008-09-18 Program obfuscation device and obfuscation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008239860A JP5277825B2 (en) 2008-09-18 2008-09-18 Program obfuscation device and obfuscation program

Publications (2)

Publication Number Publication Date
JP2010072958A JP2010072958A (en) 2010-04-02
JP5277825B2 true JP5277825B2 (en) 2013-08-28

Family

ID=42204673

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008239860A Expired - Fee Related JP5277825B2 (en) 2008-09-18 2008-09-18 Program obfuscation device and obfuscation program

Country Status (1)

Country Link
JP (1) JP5277825B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5378055B2 (en) * 2009-04-30 2013-12-25 Kddi株式会社 Program obfuscation apparatus, program obfuscation method, and program
US9811666B2 (en) 2011-03-24 2017-11-07 Irdeto B.V. System and method providing dependency networks throughout applications for attack resistance

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004185064A (en) * 2002-11-29 2004-07-02 Matsushita Electric Ind Co Ltd Device and method for making program difficult to read
JP4675642B2 (en) * 2005-02-22 2011-04-27 Kddi株式会社 Program obfuscation apparatus, method and program
JP4917861B2 (en) * 2006-10-17 2012-04-18 Kddi株式会社 Program analysis method and program
WO2008088073A1 (en) * 2007-01-18 2008-07-24 Panasonic Corporation Obfuscation assisting apparatus

Also Published As

Publication number Publication date
JP2010072958A (en) 2010-04-02

Similar Documents

Publication Publication Date Title
US11086502B2 (en) Actionable business entity operating models to drive user interface behavior
US11106437B2 (en) Lookup table optimization for programming languages that target synchronous digital circuits
CN107341374B (en) Insertion method and device of opaque predicates
CN110309629B (en) Webpage code reinforcement method, device and equipment
CN112839036B (en) Software running environment generation method and system based on mimicry defense theory
RU2680761C1 (en) Secure data transformations
JP2007304726A (en) Program obfuscation device, obfuscation method and obfuscation program
JP5277825B2 (en) Program obfuscation device and obfuscation program
JP4905480B2 (en) Program obfuscation program and program obfuscation device
Kang et al. Obfus: An obfuscation tool for software copyright and vulnerability protection
JP4667800B2 (en) Encoding method and program thereof
Luckow et al. Symbolic pathfinder v7
CN105095698B (en) Program code Fuzzy Processing based on the program code performed recently
Chrząszcz Exploring state machine CECA model
CN113282892A (en) Code obfuscation method, apparatus, computer device and storage medium
CN111126012A (en) Method and device for generating expression in customization mode
JP5149061B2 (en) Program obfuscation apparatus, program obfuscation method, and program
JP4924177B2 (en) Program obfuscation device and program
CN113946804B (en) Source code obfuscation method and device
JP5627444B2 (en) Software obfuscation device, software obfuscation method and program
JP2011209801A (en) Apparatus and method for obfuscating software, and program
JP2015035174A (en) Control program division device, control program division method, and recording medium therefor
JP6810380B2 (en) Source program conversion system, source program conversion method, and source program conversion program
US10949181B1 (en) Computing performance for execution of functions called by function handles
KR102066022B1 (en) Apparatus and method for generating function signature on executable code

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110822

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130212

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130403

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130423

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130506

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5277825

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees