JP2009110113A - Program converter, program, and program conversion method - Google Patents

Program converter, program, and program conversion method Download PDF

Info

Publication number
JP2009110113A
JP2009110113A JP2007279443A JP2007279443A JP2009110113A JP 2009110113 A JP2009110113 A JP 2009110113A JP 2007279443 A JP2007279443 A JP 2007279443A JP 2007279443 A JP2007279443 A JP 2007279443A JP 2009110113 A JP2009110113 A JP 2009110113A
Authority
JP
Japan
Prior art keywords
branch
branch destination
instruction
program
change
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.)
Granted
Application number
JP2007279443A
Other languages
Japanese (ja)
Other versions
JP4989418B2 (en
Inventor
Shoji Sakurai
鐘治 桜井
Tatsuji Nabunaka
達司 撫中
Atsushi Inoue
淳 井上
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2007279443A priority Critical patent/JP4989418B2/en
Publication of JP2009110113A publication Critical patent/JP2009110113A/en
Application granted granted Critical
Publication of JP4989418B2 publication Critical patent/JP4989418B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To convert a program to generate a program difficult in reverse engineering, while carrying out an operation the same as the original program. <P>SOLUTION: A branch instruction extracting device 130 extracts a branch instruction from an objective program 415 stored in an objective program storage device 120. A branch destination table generator 140 generates a branch destination table 630, based on the extracted branch instruction. A changed branch instruction generator 151 generates a post-changed branch instruction, and a branch instruction changing device 152 replaces the branch instruction extracted by the branch instruction extracting device 130, with the post-changed branch command. The post-changed branch instruction includes a command indicating the calculation of the branch destination by referring to the branched side table 630, and a command indicating the branch to the calculated branch destination. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

この発明は、プログラムを変換するプログラム変換装置に関する。   The present invention relates to a program conversion apparatus for converting a program.

プログラムを利用者に配布し、利用者が有するコンピュータにインストールするなどして利用させる場合、利用者がプログラムを逆アセンブルするなどリバースエンジニアリングする可能性がある。利用者は、リバースエンジニアリングの結果を利用して、例えば、パスワードを入力することによりプログラムの利用を制限する機能を無効化してプログラムを不正に利用したり、プログラムが用いている秘密のアルゴリズムを知得して盗用したりする可能性がある。
これを防ぐため、プログラムの動作をわざと複雑化することにより、耐タンパ性を高め、容易にリバースエンジニアリングできないよう、プログラムを変換する技術がある。
特表平11−514767号公報 特開平9−282156号公報 特開2002−244911号公報 特開2003−337629号公報 特開2004−185064号公報 特開2004−246637号公報 特開2005−85188号公報 特開2005−135265号公報
When a program is distributed to users and installed on a computer owned by the user, the user may perform reverse engineering, such as disassembling the program. The user can use the reverse engineering result to invalidate the function that restricts the use of the program by entering a password, for example, to illegally use the program, or to know the secret algorithm used by the program. There is a possibility of obtaining and plagiarizing.
In order to prevent this, there is a technique for converting a program so that the operation of the program is intentionally complicated to improve tamper resistance and cannot be easily reverse engineered.
Japanese National Patent Publication No. 11-514767 JP-A-9-282156 JP 2002-244911 A JP 2003-337629 A JP 2004-185064 A Japanese Patent Laid-Open No. 2004-246637 JP 2005-85188 A JP 2005-135265 A

しかし、従来のプログラム変換技術により変換されたプログラムは、必ずしも耐タンパ性が高いとは言えない場合がある。例えば、特定のアドレスにブレークポイントを設定することにより、難読化した情報を容易に収集できる場合がある。
この発明は、例えば、上記のような課題を解決するためになされたものであり、もとのプログラムと同じ動作をしつつ、容易にリバースエンジニアリングできないプログラムを生成することができるプログラム変換装置を得ることを目的とする。
However, a program converted by a conventional program conversion technique may not necessarily have high tamper resistance. For example, obfuscated information may be easily collected by setting a breakpoint at a specific address.
The present invention has been made, for example, in order to solve the above-described problems, and obtains a program conversion apparatus that can generate a program that cannot be easily reverse engineered while performing the same operation as the original program. For the purpose.

この発明にかかるプログラム変換装置は、
情報を処理する処理装置と、対象プログラム入力装置と、分岐命令抽出装置と、分岐先取得装置と、分岐先テーブル生成装置と、変更分岐命令生成装置と、分岐命令変更装置と、変換済プログラム出力装置とを有し、
上記対象プログラム入力装置は、上記処理装置を用いて、変換の対象となるプログラムを入力して、対象プログラムとし、
上記分岐命令抽出装置は、上記処理装置を用いて、上記対象プログラム入力装置が入力した対象プログラムを解析し、分岐を指示する分岐命令を抽出して、変更前分岐命令とし、
上記分岐先取得装置は、上記処理装置を用いて、上記分岐命令抽出装置が抽出した変更前分岐命令が指示する分岐の分岐先を表わす情報を取得して、変更前分岐先情報とし、
上記分岐先テーブル生成装置は、上記処理装置を用いて、上記分岐先取得装置が取得した変更前分岐先情報に基づいて、分岐先テーブルを生成し、
上記変更分岐命令生成装置は、上記処理装置を用いて、分岐先を表わす情報を算出することを指示する分岐先算出命令と、上記分岐先算出命令を実行することにより算出される情報が表わす分岐先への分岐を指示する分岐命令とを含む変更後分岐命令を、上記分岐先テーブル生成装置が生成した分岐先テーブルに基づいて生成し、
上記分岐命令変更装置は、上記処理装置を用いて、上記対象プログラム入力装置が入力した対象プログラムのうち、上記分岐命令抽出装置が抽出した変更前分岐命令を、上記変更分岐命令生成装置が生成した変更後分岐命令に置き換え、
上記変換済プログラム出力装置は、上記処理装置を用いて、上記分岐命令変更装置が分岐命令を置き換えた対象プログラムを、変換済プログラムとして出力することを特徴とする。
The program conversion apparatus according to the present invention includes:
Processing device for processing information, target program input device, branch instruction extraction device, branch destination acquisition device, branch destination table generation device, modified branch instruction generation device, branch instruction change device, converted program output Having a device,
The target program input device uses the processing device to input a program to be converted into a target program,
The branch instruction extraction device analyzes the target program input by the target program input device using the processing device, extracts a branch instruction instructing a branch, and sets it as a branch instruction before change.
The branch destination acquisition device acquires information indicating the branch destination of the branch indicated by the branch instruction before change extracted by the branch instruction extraction device using the processing device, and sets the branch destination information before change as
The branch destination table generation device generates a branch destination table using the processing device based on the pre-change branch destination information acquired by the branch destination acquisition device,
The changed branch instruction generation device uses the processing device to branch a branch destination calculation instruction for instructing to calculate information representing a branch destination, and a branch represented by information calculated by executing the branch destination calculation instruction. A branch instruction after change including a branch instruction for instructing a branch to a destination is generated based on the branch destination table generated by the branch destination table generation device;
In the branch instruction change device, the change branch instruction generation device generates the pre-change branch instruction extracted by the branch instruction extraction device from the target program input by the target program input device using the processing device. Replace with branch instruction after change
The converted program output device outputs, as the converted program, a target program in which the branch instruction changing device has replaced the branch instruction using the processing device.

この発明にかかるプログラム変換装置によれば、分岐命令抽出装置が抽出した変更前分岐命令を、変更分岐命令生成装置が生成した変更後分岐命令に、分岐命令変更装置が置き換えるので、対象プログラムと同じ動作をしながら対象プログラムよりもリバースエンジニアリングが困難な変換済プログラムを生成することができるという効果を奏する。   According to the program conversion device of the present invention, the branch instruction change device replaces the pre-change branch instruction extracted by the branch instruction extraction device with the post-change branch instruction generated by the change branch instruction generation device. There is an effect that it is possible to generate a converted program that is more difficult to reverse engineer than the target program while operating.

実施の形態1.
実施の形態1について、図1〜図7を用いて説明する。
Embodiment 1 FIG.
Embodiment 1 will be described with reference to FIGS.

図1は、この実施の形態におけるプログラム変換装置100を用いたプログラム配布システムの全体構成の一例を示すシステム構成図である。   FIG. 1 is a system configuration diagram showing an example of the overall configuration of a program distribution system using the program conversion apparatus 100 in this embodiment.

プログラム制作者は、制作側システムにおいてプログラムを制作する。制作されたプログラムは、利用側システムに配布される。プログラム利用者は、利用側システムにおいてコンピュータ300にプログラムを実行させる。
しかし、制作したプログラムをそのまま配布すると、利用者が、リバースエンジニアリングなどによりプログラムを解読し、パスワードチェック機能を無効化するなどの不正利用をしたり、プログラムで利用されている秘密のアルゴリズムを入手したりする可能性がある。
そのため、この実施の形態におけるプログラム配布システムでは、制作されたプログラム410(以下「対象プログラム」と呼ぶ。)を、プログラム変換装置100が変換して、同じ動作をするプログラム420(以下「変換済プログラム」と呼ぶ。)を生成し、生成された変換済プログラム420を配布する。変換済プログラム420は、容易にリバースエンジニアリングできないよう、難読化処理が施されている。
The program creator creates a program in the production system. The created program is distributed to the user system. The program user causes the computer 300 to execute the program in the user side system.
However, if the created program is distributed as it is, the user can use it for illegal use, such as deciphering the program by reverse engineering or invalidating the password check function, or obtain the secret algorithm used in the program. There is a possibility.
For this reason, in the program distribution system in this embodiment, the program 410 (hereinafter referred to as “target program”) produced is converted by the program conversion apparatus 100 and the same operation is performed (hereinafter referred to as “converted program”). And the generated converted program 420 is distributed. The converted program 420 is obfuscated so that it cannot be easily reverse engineered.

図2は、この実施の形態におけるプログラム変換装置100の外観の一例を示す図である。
プログラム変換装置100は、システムユニット910、CRT(Cathode・Ray・Tube)やLCD(液晶)の表示画面を有する表示装置901、キーボード902(Key・Board:K/B)、マウス903、FDD904(Flexible・Disk・Drive)、コンパクトディスク装置905(CDD)、プリンタ装置906、スキャナ装置907などのハードウェア資源を備え、これらはケーブルや信号線で接続されている。
システムユニット910は、コンピュータであり、ファクシミリ機932、電話器931とケーブルで接続され、また、ローカルエリアネットワーク942(LAN)、ゲートウェイ941を介してインターネット940に接続されている。
FIG. 2 is a diagram showing an example of the appearance of the program conversion apparatus 100 in this embodiment.
The program conversion apparatus 100 includes a system unit 910, a display device 901 having a CRT (Cathode / Ray / Tube) or LCD (Liquid Crystal) display screen, a keyboard 902 (Key / Board: K / B), a mouse 903, an FDD904 (Flexible). (Disk / Drive), compact disk device 905 (CDD), printer device 906, scanner device 907, and other hardware resources, which are connected by cables and signal lines.
The system unit 910 is a computer, and is connected to the facsimile machine 932 and the telephone 931 with a cable, and is connected to the Internet 940 via a local area network 942 (LAN) and a gateway 941.

図3は、この実施の形態におけるプログラム変換装置100のハードウェア資源の一例を示す図である。
プログラム変換装置100は、プログラムを実行するCPU911(Central・Processing・Unit、中央処理装置、処理装置、演算装置、マイクロプロセッサ、マイクロコンピュータ、プロセッサともいう)を備えている。CPU911は、バス912を介してROM913、RAM914、通信装置915、表示装置901、キーボード902、マウス903、FDD904、CDD905、プリンタ装置906、スキャナ装置907、磁気ディスク装置920と接続され、これらのハードウェアデバイスを制御する。磁気ディスク装置920の代わりに、光ディスク装置、メモリカード読み書き装置などの記憶装置でもよい。
RAM914は、揮発性メモリの一例である。ROM913、FDD904、CDD905、磁気ディスク装置920の記憶媒体は、不揮発性メモリの一例である。これらは、記憶装置あるいは記憶部の一例である。
通信装置915、キーボード902、スキャナ装置907、FDD904などは、入力部、入力装置の一例である。
また、通信装置915、表示装置901、プリンタ装置906などは、出力部、出力装置の一例である。
FIG. 3 is a diagram showing an example of hardware resources of the program conversion apparatus 100 in this embodiment.
The program conversion apparatus 100 includes a CPU 911 (also referred to as a central processing unit, a central processing unit, a processing unit, an arithmetic unit, a microprocessor, a microcomputer, or a processor) that executes a program. The CPU 911 is connected to a ROM 913, a RAM 914, a communication device 915, a display device 901, a keyboard 902, a mouse 903, an FDD 904, a CDD 905, a printer device 906, a scanner device 907, and a magnetic disk device 920 via a bus 912, and the hardware thereof. Control the device. Instead of the magnetic disk device 920, a storage device such as an optical disk device or a memory card read / write device may be used.
The RAM 914 is an example of a volatile memory. The storage media of the ROM 913, the FDD 904, the CDD 905, and the magnetic disk device 920 are an example of a nonvolatile memory. These are examples of a storage device or a storage unit.
A communication device 915, a keyboard 902, a scanner device 907, an FDD 904, and the like are examples of an input unit and an input device.
Further, the communication device 915, the display device 901, the printer device 906, and the like are examples of an output unit and an output device.

通信装置915は、ファクシミリ機932、電話器931、LAN942等に接続されている。通信装置915は、LAN942に限らず、インターネット940、ISDN等のWAN(ワイドエリアネットワーク)などに接続されていても構わない。インターネット940或いはISDN等のWANに接続されている場合、ゲートウェイ941は不用となる。
磁気ディスク装置920には、オペレーティングシステム921(OS)、ウィンドウシステム922、プログラム群923、ファイル群924が記憶されている。プログラム群923のプログラムは、CPU911、オペレーティングシステム921、ウィンドウシステム922により実行される。
The communication device 915 is connected to a facsimile machine 932, a telephone 931, a LAN 942, and the like. The communication device 915 is not limited to the LAN 942, and may be connected to the Internet 940, a WAN (wide area network) such as ISDN, or the like. When connected to a WAN such as the Internet 940 or ISDN, the gateway 941 is unnecessary.
The magnetic disk device 920 stores an operating system 921 (OS), a window system 922, a program group 923, and a file group 924. The programs in the program group 923 are executed by the CPU 911, the operating system 921, and the window system 922.

上記プログラム群923には、以下に述べる実施の形態の説明において「〜部」として説明する機能を実行するプログラムが記憶されている。プログラムは、CPU911により読み出され実行される。
ファイル群924には、以下に述べる実施の形態の説明において、「〜の判定結果」、「〜の計算結果」、「〜の処理結果」として説明する情報やデータや信号値や変数値やパラメータが、「〜ファイル」や「〜データベース」の各項目として記憶されている。「〜ファイル」や「〜データベース」は、ディスクやメモリなどの記録媒体に記憶される。ディスクやメモリになどの記憶媒体に記憶された情報やデータや信号値や変数値やパラメータは、読み書き回路を介してCPU911によりメインメモリやキャッシュメモリに読み出され、抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示などのCPUの動作に用いられる。抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示のCPUの動作の間、情報やデータや信号値や変数値やパラメータは、メインメモリやキャッシュメモリやバッファメモリに一時的に記憶される。
また、以下に述べる実施の形態の説明において説明するフローチャートの矢印の部分は主としてデータや信号の入出力を示し、データや信号値は、RAM914のメモリ、FDD904のフレキシブルディスク、CDD905のコンパクトディスク、磁気ディスク装置920の磁気ディスク、その他光ディスク、ミニディスク、DVD(Digital・Versatile・Disk)等の記録媒体に記録される。また、データや信号は、バス912や信号線やケーブルその他の伝送媒体によりオンライン伝送される。
The program group 923 stores programs that execute functions described as “˜units” in the description of the embodiments described below. The program is read and executed by the CPU 911.
The file group 924 includes information, data, signal values, variable values, and parameters that are described as “determination results of”, “calculation results of”, and “processing results of” in the description of the embodiments described below. Are stored as items of “˜file” and “˜database”. The “˜file” and “˜database” are stored in a recording medium such as a disk or a memory. Information, data, signal values, variable values, and parameters stored in a storage medium such as a disk or memory are read out to the main memory or cache memory by the CPU 911 via a read / write circuit, and extracted, searched, referenced, compared, Used for CPU operations such as calculation, calculation, processing, output, printing, and display. Information, data, signal values, variable values, and parameters are temporarily stored in the main memory, cache memory, and buffer memory during the CPU operations of extraction, search, reference, comparison, operation, calculation, processing, output, printing, and display. Is remembered.
In addition, the arrows in the flowcharts described in the following description of the embodiments mainly indicate input / output of data and signals. The data and signal values are the RAM 914 memory, the FDD 904 flexible disk, the CDD 905 compact disk, and the magnetic field. The data is recorded on a recording medium such as a magnetic disk of the disk device 920, another optical disk, a mini disk, and a DVD (Digital Versatile Disk). Data and signals are transmitted online via a bus 912, signal lines, cables, or other transmission media.

また、以下に述べる実施の形態の説明において「〜部」として説明するものは、「〜回路」、「〜装置」、「〜機器」であってもよく、また、「〜ステップ」、「〜手順」、「〜処理」であってもよい。すなわち、「〜部」として説明するものは、ROM913に記憶されたファームウェアで実現されていても構わない。或いは、ソフトウェアのみ、或いは、素子・デバイス・基板・配線などのハードウェアのみ、或いは、ソフトウェアとハードウェアとの組み合わせ、さらには、ファームウェアとの組み合わせで実施されても構わない。ファームウェアとソフトウェアは、プログラムとして、磁気ディスク、フレキシブルディスク、光ディスク、コンパクトディスク、ミニディスク、DVD等の記録媒体に記憶される。プログラムはCPU911により読み出され、CPU911により実行される。すなわち、プログラムは、以下に述べる「〜部」としてコンピュータを機能させるものである。あるいは、以下に述べる「〜部」の手順や方法をコンピュータに実行させるものである。   In the description of the embodiments described below, what is described as “to part” may be “to circuit”, “to device”, and “to device”, and “to step” and “to”. “Procedure” and “˜Process” may be used. That is, what is described as “˜unit” may be realized by firmware stored in the ROM 913. Alternatively, it may be implemented only by software, only hardware such as elements, devices, substrates, wirings, etc., or a combination of software and hardware, and further a combination of firmware. Firmware and software are stored as programs in a recording medium such as a magnetic disk, a flexible disk, an optical disk, a compact disk, a mini disk, and a DVD. The program is read by the CPU 911 and executed by the CPU 911. That is, the program causes the computer to function as “to part” described below. Alternatively, the procedure or method of “to part” described below is executed by a computer.

図4は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、プログラム変換装置100の各機能ブロックは、上述したように、コンピュータがプログラムを実行するすることにより実現してもよいし、1または複数の機能ブロックが物理的に独立した装置として存在し、全体として、プログラム変換装置100として機能するシステムを構成してもよい。
FIG. 4 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
Note that each functional block of the program conversion apparatus 100 may be realized by a computer executing a program as described above, or one or a plurality of functional blocks exist as physically independent devices, As a whole, a system that functions as the program conversion apparatus 100 may be configured.

プログラム変換装置100は、対象プログラム入力装置110、対象プログラム記憶装置120、分岐命令抽出装置130、分岐先取得装置133、分岐先テーブル生成装置140、変更分岐命令生成装置151、分岐命令変更装置152、分岐先挿入装置161、変換済プログラム記憶装置180、変換済プログラム出力装置191を有する。   The program conversion device 100 includes a target program input device 110, a target program storage device 120, a branch instruction extraction device 130, a branch destination acquisition device 133, a branch destination table generation device 140, a changed branch instruction generation device 151, a branch instruction change device 152, It has a branch destination insertion device 161, a converted program storage device 180, and a converted program output device 191.

対象プログラム入力装置110は、変換の対象となる対象プログラム410を入力する装置である。
対象プログラム入力装置110は、プログラム名入力装置111、プログラム取得装置112、種別判定装置113、コンパイル装置114、アセンブル装置115を有する。
The target program input device 110 is a device that inputs a target program 410 to be converted.
The target program input device 110 includes a program name input device 111, a program acquisition device 112, a type determination device 113, a compilation device 114, and an assembly device 115.

プログラム名入力装置111は、キーボード902などの入力装置を用いて、対象プログラム410のファイル名、パス名、URI(Uniform Resource Identifier)など、対象プログラム入力装置110が対象プログラム410を取得するための取得元に関する情報を入力する。
プログラム取得装置112は、CPU911などの処理装置を用いて、プログラム名入力装置111が入力した情報に基づいて、入力した情報が表わす取得元から、対象プログラム410を取得する。
種別判定装置113は、CPU911などの処理装置を用いて、プログラム取得装置112が取得した対象プログラム410の種別を判定する。
ここで、対象プログラム410の種別とは、対象プログラム410がC言語などの高級言語で記述されたソースコードであるか、アセンブリ言語などの低級言語で記述されたソースコードであるか、機械語などの実行形式のコードであるかの区別をいう。
The program name input device 111 uses an input device such as the keyboard 902 to acquire the target program input device 110 for acquiring the target program 410, such as the file name, path name, and URI (Uniform Resource Identifier) of the target program 410. Enter information about the origin.
The program acquisition device 112 uses the processing device such as the CPU 911 to acquire the target program 410 from the acquisition source represented by the input information based on the information input by the program name input device 111.
The type determination device 113 determines the type of the target program 410 acquired by the program acquisition device 112 using a processing device such as the CPU 911.
Here, the type of the target program 410 refers to whether the target program 410 is source code described in a high-level language such as C language, source code described in a low-level language such as assembly language, machine language, or the like. The distinction of whether the code is an executable code.

種別判定装置113が判定した結果、対象プログラム410がC言語などで記述されたソースコードである場合、コンパイル装置114は、CPU911などの処理装置を用いて、対象プログラム410をコンパイルして、実行形式のコードを生成する。
種別判定装置113が判定した結果、対象プログラム410がアセンブリ言語などで記述されたソースコードである場合、アセンブル装置115は、CPU911などの処理装置を用いて、対象プログラム410をアセンブルして、実行形式のコードを生成する。
As a result of the determination by the type determination device 113, when the target program 410 is a source code described in C language or the like, the compiling device 114 compiles the target program 410 using a processing device such as the CPU 911, and executes the execution format. Generate code for
As a result of the determination by the type determination device 113, when the target program 410 is source code described in an assembly language or the like, the assembling device 115 assembles the target program 410 using a processing device such as the CPU 911, and executes the execution format. Generate code for

対象プログラム記憶装置120は、磁気ディスク装置920などの記憶装置を用いて、実行形式のコードを、対象プログラム415として記憶する。
すなわち、種別判定装置113が判定した結果、対象プログラム410がC言語などのソースコードである場合、対象プログラム記憶装置120は、コンパイル装置114が生成した実行形式のコードを対象プログラム415として記憶する。種別判定装置113が判定した結果、対象プログラム410がアセンブリ言語などのソースコードである場合、対象プログラム記憶装置120は、アセンブル装置115が生成した実行形式のコードを対象プログラム415として記憶する。種別判定装置113が判定した結果、対象プログラム410が実行形式のコードである場合、対象プログラム記憶装置120は、プログラム取得装置112が取得した対象プログラム410を、対象プログラム415として記憶する。
The target program storage device 120 stores the execution format code as the target program 415 using a storage device such as the magnetic disk device 920.
That is, as a result of the determination by the type determination device 113, when the target program 410 is a source code such as C language, the target program storage device 120 stores the execution format code generated by the compiling device 114 as the target program 415. As a result of the determination by the type determination device 113, when the target program 410 is a source code such as an assembly language, the target program storage device 120 stores the execution format code generated by the assembly device 115 as the target program 415. As a result of the determination by the type determination device 113, when the target program 410 is an executable code, the target program storage device 120 stores the target program 410 acquired by the program acquisition device 112 as the target program 415.

分岐命令抽出装置130は、対象プログラム記憶装置120が記憶した対象プログラム415を解析して、分岐を指示する分岐命令を抽出する装置である。
分岐命令抽出装置130は、逆アセンブル装置131、分岐命令判定装置132を有する。
The branch instruction extraction device 130 is a device that analyzes the target program 415 stored in the target program storage device 120 and extracts a branch instruction instructing a branch.
The branch instruction extraction device 130 includes a disassembly device 131 and a branch instruction determination device 132.

逆アセンブル装置131は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415を逆アセンブルして、アセンブリコードを生成する。
分岐命令判定装置132は、CPU911などの処理装置を用いて、逆アセンブル装置131が生成したアセンブリコードに基づいて、その命令が分岐命令であるか否かを判定する。
ここで、分岐命令とは、例えば、無条件ジャンプ、条件付ジャンプ、サブルーチン呼出しなど、分岐を指示するインストラクションのことである。
なお、分岐命令判定装置132は、対象プログラム415に含まれる分岐命令をすべて分岐命令であると判定してもよいし、一部の分岐命令だけを分岐命令であると判定してもよい。一部の分岐命令だけを分岐命令であると判定する場合、分岐命令判定装置132は、分岐命令の種類によって分岐命令であると判定する命令を選択してもよいし、分岐命令の前後の処理を解析することにより、実行速度に対する影響が少ない分岐命令だけを分岐命令であると判定してもよい。
The disassembly device 131 uses a processing device such as the CPU 911 to disassemble the target program 415 stored in the target program storage device 120 to generate assembly code.
The branch instruction determination device 132 uses a processing device such as the CPU 911 to determine whether the instruction is a branch instruction based on the assembly code generated by the disassembly device 131.
Here, the branch instruction is an instruction for instructing a branch, such as an unconditional jump, a conditional jump, or a subroutine call.
Note that the branch instruction determination device 132 may determine that all branch instructions included in the target program 415 are branch instructions, or may determine that only some branch instructions are branch instructions. When it is determined that only some branch instructions are branch instructions, the branch instruction determination device 132 may select an instruction that is determined to be a branch instruction depending on the type of branch instruction, or processing before and after the branch instruction. By analyzing the above, it may be determined that only branch instructions that have little influence on the execution speed are branch instructions.

分岐命令抽出装置130は、分岐命令判定装置132が分岐命令であると判定した命令(以下「変更前分岐命令」と呼ぶ。)を抽出する。   The branch instruction extraction device 130 extracts an instruction (hereinafter referred to as “pre-change branch instruction”) that the branch instruction determination device 132 determines to be a branch instruction.

分岐先取得装置133は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令が指示する分岐の分岐先の絶対アドレス(以下「変更前分岐先アドレス」と呼ぶ。)を取得する。分岐命令の種類によっては、分岐先のアドレスが絶対アドレスで指示されているものと、相対アドレスで指示されているものとがある。分岐先のアドレスが絶対アドレスで指示されている分岐命令の場合、分岐先取得装置133は、指示された絶対アドレスを取得する。分岐先のアドレスが相対アドレスで指示されている分岐命令の場合、分岐先取得装置133は、分岐命令のアドレスと、指示された相対アドレスとに基づいて、分岐先の絶対アドレスを算出する。   The branch destination acquisition device 133 uses a processing device such as the CPU 911 to call the absolute address of the branch destination of the branch indicated by the branch instruction before change extracted by the branch instruction extraction device 130 (hereinafter referred to as “pre-change branch destination address”). ) To get. Depending on the type of branch instruction, there are an instruction in which the branch destination address is indicated by an absolute address and an instruction in which a relative address is indicated. If the branch destination address is a branch instruction indicated by an absolute address, the branch destination acquisition device 133 acquires the indicated absolute address. When the branch destination address is a branch instruction indicated by a relative address, the branch destination acquisition device 133 calculates the absolute address of the branch destination based on the address of the branch instruction and the indicated relative address.

分岐先テーブル生成装置140は、分岐先テーブルを生成する装置である。
分岐先テーブルとは、分岐命令が指示する分岐の分岐先を集めたテーブルである。なお、後述する分岐命令変更装置152が分岐命令を変更することにより、分岐先の絶対アドレスが変化する場合があるので、分岐先テーブル生成装置140は、変更前分岐先アドレスに基づいて変更後の分岐先の絶対アドレス(以下「変更後分岐先アドレス」と呼ぶ。)を算出し、算出した変更後分岐先アドレスから分岐先テーブルを生成する。
分岐先テーブル生成装置140は、分岐先記憶領域決定装置141、変更前分岐先記憶装置142、アドレス対応記憶装置143、分岐先決定装置144、分岐先記憶装置145を有する。
The branch destination table generation device 140 is a device that generates a branch destination table.
The branch destination table is a table in which branch destinations of branches designated by branch instructions are collected. Note that the branch destination absolute address may change due to the branch instruction changing device 152 described later changing the branch instruction, so the branch destination table generating device 140 may change the post-change branch destination address based on the pre-change branch destination address. The absolute address of the branch destination (hereinafter referred to as “the post-change branch destination address”) is calculated, and a branch destination table is generated from the calculated post-change branch destination address.
The branch destination table generation device 140 includes a branch destination storage area determination device 141, a pre-change branch destination storage device 142, an address correspondence storage device 143, a branch destination determination device 144, and a branch destination storage device 145.

分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブルを記憶する。
分岐先記憶装置145が記憶した分岐先テーブルは、後述する分岐先挿入装置161が、対象プログラム415のデータ部の後に挿入する。プログラム変換装置100が生成する変換済プログラム420は、分岐先テーブルを含んでいる。
The branch destination storage device 145 stores the branch destination table using a storage device such as the magnetic disk device 920.
The branch destination table stored in the branch destination storage device 145 is inserted after the data portion of the target program 415 by the branch destination insertion device 161 described later. The converted program 420 generated by the program conversion apparatus 100 includes a branch destination table.

分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、変換済プログラム420に含まれる分岐先テーブルの開始アドレスを算出する。分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、逆アセンブル装置131が逆アセンブルした結果に基づいて、対象プログラム415のデータ部の終わりのアドレスを取得し、取得したアドレスに基づいて、変換済プログラム420に含まれる分岐先テーブルの開始アドレスを算出する。
また、分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令に対応する変更後分岐先アドレスを、対象プログラム415が記憶した分岐先テーブル内のどの位置に格納するかを決定する。
例えば、分岐先記憶領域決定装置141は、分岐命令の出現順に、変更後分岐先アドレスを、分岐先テーブルに格納することとしてもよいし、変更後分岐先アドレスの昇順に格納することとしてもよい。あるいは、所定の規則性をもった順序で格納してもよいし、ランダムな順序で格納してもよい。
分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、算出した分岐先テーブルの開始アドレスと、決定した格納位置(以下「分岐先格納位置」と呼ぶ。)とに基づいて、変換済プログラム420に含まれる分岐先テーブルにおいて、分岐命令抽出装置130が抽出した変更前分岐命令に対応する変更後分岐先アドレスが格納される記憶領域のアドレス(以下「分岐先格納アドレス」と呼ぶ。)を算出する。
The branch destination storage area determination device 141 calculates the start address of the branch destination table included in the converted program 420 using a processing device such as the CPU 911. The branch destination storage area determination device 141 uses a processing device such as the CPU 911 to acquire the address of the end of the data portion of the target program 415 based on the result of the disassembly by the disassembly device 131, and based on the acquired address Thus, the start address of the branch destination table included in the converted program 420 is calculated.
In addition, the branch destination storage area determination device 141 uses a processing device such as the CPU 911 to store the branch destination address after change corresponding to the branch instruction before change extracted by the branch instruction extraction device 130. Decide where to store in the table.
For example, the branch destination storage area determining device 141 may store the changed branch destination addresses in the branch destination table in the order in which the branch instructions appear, or may store them in the ascending order of the changed branch destination addresses. . Or you may store in the order with predetermined | prescribed regularity, and may store in a random order.
The branch destination storage area determination device 141 uses a processing device such as the CPU 911 to convert based on the calculated start address of the branch destination table and the determined storage location (hereinafter referred to as “branch destination storage location”). In the branch destination table included in the completed program 420, the address of the storage area (hereinafter referred to as “branch destination storage address”) in which the post-change branch destination address corresponding to the pre-change branch instruction extracted by the branch instruction extraction device 130 is stored. ) Is calculated.

変更前分岐先記憶装置142は、磁気ディスク装置920などの記憶装置を用いて、分岐先取得装置133が取得した変更前分岐先アドレスを記憶する。
アドレス対応記憶装置143は、CPU911などの処理装置を用いて、後述する分岐命令変更装置152が分岐命令を変更した変更結果に基づいて、分岐命令を変更する前のアドレスと、分岐命令を変更した後のアドレスとの対応関係を算出し、算出した対応関係を表わす情報を記憶する。
分岐先決定装置144は、CPU911などの処理装置を用いて、アドレス対応記憶装置143が記憶したアドレスの対応関係を表わす情報に基づいて、変更前分岐先記憶装置142が記憶した変更前分岐先アドレスに対応する変更後分岐先アドレスを算出する。
分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先決定装置144が算出した変更後分岐先アドレスを、分岐先テーブルのうち、分岐先記憶領域決定装置141が決定した分岐先格納位置に記憶する。
The pre-change branch destination storage device 142 stores the pre-change branch destination address acquired by the branch destination acquisition device 133 using a storage device such as the magnetic disk device 920.
The address correspondence storage device 143 uses a processing device such as the CPU 911 to change the address before the branch instruction is changed and the branch instruction based on the change result of the branch instruction change device 152 described later changing the branch instruction. The correspondence relationship with the subsequent address is calculated, and information representing the calculated correspondence relationship is stored.
The branch destination determination device 144 uses a processing device such as the CPU 911 to store the pre-change branch destination address stored in the pre-change branch destination storage device 142 based on the information indicating the address correspondence stored in the address correspondence storage device 143. The post-change branch destination address corresponding to is calculated.
The branch destination storage device 145 uses a storage device such as the magnetic disk device 920 to determine the changed branch destination address calculated by the branch destination determination device 144 by the branch destination storage area determination device 141 in the branch destination table. Store in the branch destination storage location.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更後分岐命令を生成する。
変更後分岐命令とは、対象プログラム415のなかから分岐命令抽出装置130が抽出した変更前分岐命令を置き換える命令(または命令群)のことである。変更後分岐命令の長さ(バイト数)は、変更前分岐命令の長さと同じとは限らない。
変更後分岐命令は、分岐先格納アドレスを参照して分岐先格納アドレスに格納された分岐先アドレスへ分岐することを指示する命令である。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐先記憶領域決定装置141が算出した分岐先格納アドレスに基づいて、分岐先格納アドレスを参照する変更後分岐命令を生成する。
分岐命令変更装置152は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415のうち、分岐命令抽出装置130が抽出した変更前分岐命令を、変更分岐命令生成装置151が生成した変更後分岐命令に置き換える。
The changed branch instruction generation device 151 generates a changed branch instruction using a processing device such as the CPU 911.
The post-change branch instruction is an instruction (or instruction group) that replaces the pre-change branch instruction extracted by the branch instruction extraction device 130 from the target program 415. The length (number of bytes) of the post-change branch instruction is not necessarily the same as the length of the pre-change branch instruction.
The post-change branch instruction is an instruction that refers to the branch destination storage address and branches to the branch destination address stored in the branch destination storage address. The changed branch instruction generation device 151 uses a processing device such as the CPU 911 to generate a post-change branch instruction that refers to the branch destination storage address based on the branch destination storage address calculated by the branch destination storage area determination device 141.
The branch instruction changing device 152 uses a processing device such as the CPU 911 to change the branch instruction before change extracted by the branch instruction extracting device 130 out of the target program 415 stored in the target program storage device 120, to the changed branch instruction generating device 151. Replace with the modified branch instruction generated by.

分岐先挿入装置161は、CPU911などの処理装置を用いて、分岐命令変更装置152が分岐命令を変更前分岐命令から変更後分岐命令に変更した対象プログラム415に、分岐先テーブル生成装置140が生成した分岐先テーブルを挿入する。前述したように、分岐先挿入装置161は、対象プログラム415のデータ部の後に、分岐先テーブルを挿入する。   The branch destination insertion device 161 uses the processing device such as the CPU 911 to generate the branch destination table generation device 140 in the target program 415 in which the branch instruction change device 152 changes the branch instruction from the branch instruction before change to the branch instruction after change. Insert the branch destination table. As described above, the branch destination insertion device 161 inserts the branch destination table after the data portion of the target program 415.

変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先挿入装置161が分岐先テーブルを挿入した対象プログラム415を、変換済プログラム420として記憶する。
変換済プログラム出力装置191は、CPU911などの処理装置を用いて、変換済プログラム記憶装置180が記憶した変換済プログラム420を出力する。
The converted program storage device 180 uses the storage device such as the magnetic disk device 920 to store the target program 415 into which the branch destination insertion device 161 has inserted the branch destination table as the converted program 420.
The converted program output device 191 outputs the converted program 420 stored in the converted program storage device 180 using a processing device such as the CPU 911.

図5は、この実施の形態における変更分岐命令生成装置151が生成する変更後分岐命令の一例を示す図である。   FIG. 5 is a diagram showing an example of the post-change branch instruction generated by the change branch instruction generation device 151 in this embodiment.

分岐命令抽出装置130が対象プログラム415から抽出する分岐命令には、例えば、所定の条件を満たす場合にオペランド502が表わす分岐先相対アドレスへ分岐することを指示する条件付相対分岐を表わすオペコード501を有する分岐命令511や、所定の条件を満たす場合にオペランド502が表わす分岐先絶対アドレスへ分岐することを指示する条件付絶対分岐を表わすオペコード501を有する分岐命令512や、条件に関係なくオペランド502が表わす分岐先相対アドレスへ分岐することを指示する無条件相対分岐を表わすオペコード501を有する分岐命令513や、条件に関係なくオペランド502が表わす分岐先絶対アドレスへ分岐することを支持する無条件絶対分岐を表わすオペコード501を有する分岐命令514や、オペランド502が表わすサブルーチン相対アドレスから始まるサブルーチンを実行してサブルーチンの実行が終わったら次の命令に戻ってくることを指示するサブルーチン相対呼出を表わす分岐命令515や、オペランド502が表わすサブルーチン絶対アドレスから始まるサブルーチンを実行してサブルーチンの実行が終わったら次の命令に戻ってくることを指示するサブルーチン絶対呼出を表わす分岐命令516などがある。   The branch instruction extracted from the target program 415 by the branch instruction extraction device 130 includes, for example, an operation code 501 representing a conditional relative branch that instructs to branch to the branch destination relative address represented by the operand 502 when a predetermined condition is satisfied. The branch instruction 511 having the operation code 501 indicating a conditional absolute branch that instructs to branch to the branch destination absolute address represented by the operand 502 when a predetermined condition is satisfied, or the operand 502 regardless of the condition. A branch instruction 513 having an operation code 501 indicating an unconditional relative branch for instructing branching to the branch destination relative address to be represented, and an unconditional absolute branch for supporting branching to the branch destination absolute address represented by the operand 502 regardless of the condition Branch instruction 5 having an opcode 501 representing 4, a subroutine starting from the subroutine relative address represented by the operand 502, a subroutine instruction 515 indicating a subroutine relative call instructing to return to the next instruction when execution of the subroutine is completed, and a subroutine absolute represented by the operand 502 For example, there is a branch instruction 516 representing a subroutine absolute call for instructing to return to the next instruction when execution of the subroutine starting from the address is completed.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令の種類に対応する変更後オペコードを生成する。変更分岐命令生成装置151は、例えば、分岐命令が、条件付相対分岐や条件付絶対分岐を表わす分岐命令511,512である場合、条件付相対分岐を表わす変更後オペコードを生成し、分岐命令が、無条件相対分岐や無条件絶対分岐を表わす分岐命令513,514である場合、無条件相対分岐を表わす変更後オペコードを生成し、分岐命令が、サブルーチン相対呼出やサブルーチン絶対呼出を表わす分岐命令515,516である場合、サブルーチン相対呼出を表わす変更後オペコードを生成する。すなわち、変更分岐命令生成装置151は、分岐命令のオペコード501と同じ種類の分岐を指示する変更後オペコードを生成する。   The change branch instruction generation device 151 uses a processing device such as the CPU 911 to generate a post-change opcode corresponding to the type of pre-change branch instruction extracted by the branch instruction extraction device 130. For example, when the branch instruction is a branch instruction 511 or 512 that represents a conditional relative branch or a conditional absolute branch, the modified branch instruction generation device 151 generates a modified opcode that represents a conditional relative branch. If the branch instruction 513 or 514 represents an unconditional relative branch or unconditional absolute branch, a modified opcode representing an unconditional relative branch is generated, and the branch instruction is a branch instruction 515 representing a subroutine relative call or subroutine absolute call. , 516, a modified opcode representing a subroutine relative call is generated. In other words, the modified branch instruction generation device 151 generates a post-change operation code that indicates a branch of the same type as the operation code 501 of the branch instruction.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更後分岐命令520を生成する。変更後分岐命令520は、例えば、命令521〜523の3つの命令からなる。命令521のオペランド部分は、命令523の相対アドレスを表わす。命令522のオペコード部分は、無条件相対分岐を表し、命令522のオペランド部分は、次の命令531の相対アドレスを表わす。命令523のオペコード部分は、条件に関係なくオペランドが表わすアドレスに格納されたデータを取得し(分岐先算出命令)、取得したデータを分岐先アドレスとして分岐先アドレスへ分岐する(分岐命令)ことを指示する無条件間接分岐を表わす。   The changed branch instruction generation device 151 generates the changed branch instruction 520 using a processing device such as the CPU 911. The post-change branch instruction 520 includes, for example, three instructions 521 to 523. The operand part of instruction 521 represents the relative address of instruction 523. The opcode portion of instruction 522 represents an unconditional relative branch, and the operand portion of instruction 522 represents the relative address of the next instruction 531. The opcode part of the instruction 523 acquires data stored at the address indicated by the operand regardless of the condition (branch destination calculation instruction), and branches the acquired data as a branch destination address to the branch destination address (branch instruction). Indicates an unconditional indirect branch to indicate.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、生成した変更後オペコードを、命令521のオペコード部分とする。
変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐先記憶領域決定装置141が算出した分岐先格納アドレスを、命令523のオペランド部分とする。
The changed branch instruction generation device 151 uses the processing device such as the CPU 911 as the generated changed operation code as the operation code portion of the instruction 521.
The changed branch instruction generation device 151 uses the branch destination storage address calculated by the branch destination storage area determination device 141 as the operand part of the instruction 523 using a processing device such as the CPU 911.

変更分岐命令生成装置151が生成した変更後分岐命令520を、コンピュータ300が実行した場合の動作は、以下の通りである。
分岐工程S711において、コンピュータ300は、命令521の指示により、分岐命令抽出装置130が抽出した変更前分岐命令の分岐条件と同じ条件にしたがって分岐するかしないかを判定する。判定した結果、分岐する場合には、分岐先算出工程S718へ進む。分岐しない場合には、無条件分岐工程S712へ進む。
無条件分岐工程S712において、コンピュータ300は、命令522の指示により、次の命令531へ無条件に分岐する。
分岐先算出工程S718において、コンピュータ300は、命令523の指示により、分岐先格納アドレスに格納された分岐先絶対アドレスを取得する。
間接分岐工程S719において、コンピュータ300は、同じく命令523の指示により、分岐先算出工程S718で取得した分岐先絶対アドレスへ無条件に分岐する。
The operation when the computer 300 executes the post-change branch instruction 520 generated by the change branch instruction generation device 151 is as follows.
In the branch step S711, the computer 300 determines whether or not to branch according to the same condition as the branch condition of the branch instruction before change extracted by the branch instruction extracting device 130 according to the instruction of the instruction 521. As a result of the determination, if the branch is taken, the process proceeds to a branch destination calculation step S718. When not branching, it progresses to unconditional branch process S712.
In the unconditional branching step S712, the computer 300 branches unconditionally to the next instruction 531 in accordance with the instruction of the instruction 522.
In the branch destination calculation step S718, the computer 300 acquires the branch destination absolute address stored in the branch destination storage address according to the instruction of the instruction 523.
In the indirect branch step S719, the computer 300 branches unconditionally to the branch destination absolute address acquired in the branch destination calculation step S718 in accordance with the instruction of the instruction 523.

すなわち、変更後分岐命令520は、分岐命令抽出装置130が抽出した変更前分岐命令と同じ動作を指示する命令であるが、分岐先テーブルを参照して分岐先を求めるので、変換済プログラム420を逆アセンブルしても、分岐先がどこであるか容易にはわからず、リバースエンジニアリングを困難にしている。   That is, the post-change branch instruction 520 is an instruction for instructing the same operation as the pre-change branch instruction extracted by the branch instruction extraction device 130, but the branch destination is obtained by referring to the branch destination table. Even when disassembling, it is not easy to know where the branch is, and reverse engineering is difficult.

図6は、この実施の形態における分岐先テーブル生成装置140が分岐先テーブルを生成する様子の一例を示す図である。   FIG. 6 is a diagram illustrating an example of a state in which the branch destination table generation device 140 in this embodiment generates a branch destination table.

変更前分岐先記憶装置142は、磁気ディスク装置920などの記憶装置を用いて、変更前分岐先テーブル610を記憶する。変更前分岐先テーブル610は、変更前分岐先アドレス611を、分岐先記憶領域決定装置141が決定した順序で並べたものである。この例では、分岐命令抽出装置130が抽出した変更前分岐命令が3つあり、変更前分岐先テーブル610は、それに対応して3つの変更前分岐先アドレス611を含む。   The pre-change branch destination storage device 142 stores the pre-change branch destination table 610 using a storage device such as the magnetic disk device 920. The pre-change branch destination table 610 is a table in which the pre-change branch destination addresses 611 are arranged in the order determined by the branch destination storage area determining device 141. In this example, there are three pre-change branch instructions extracted by the branch instruction extraction device 130, and the pre-change branch destination table 610 includes three pre-change branch destination addresses 611 corresponding thereto.

アドレス対応記憶装置143は、磁気ディスク装置920などの記憶装置を用いて、アドレス対応テーブル620を記憶する。アドレス対応テーブル620は、変更前のアドレスと変更後のアドレスとの対応関係を表わすものであり、例えば、変更前アドレス621とオフセット622との組を並べたものである。この例では、分岐命令抽出装置130が抽出した変更前分岐命令が3つあり、アドレス対応テーブル620は、それに対応して3つの変更前アドレス621とオフセット622との組を含む。
変更前アドレス621は、変更前における分岐命令のアドレス(以下「変更前分岐元アドレス」と呼ぶ。)を表わす。
オフセット622は、変更前のアドレスと変更後のアドレスとの差を表わす。
この例において、アドレス対応テーブル620の1行目は、アドレス「00000012」にあった分岐命令を、分岐命令より8バイト長い変更後分岐命令で置き換えた結果、変更前のアドレスが「00000012」より大きい場合、変更前のアドレスに「8」を加えたアドレスが変更後のアドレスになることを表わしている。同様に、アドレス対応テーブル620の2行目は、アドレス「00000034」にあった分岐命令を置き換えた結果、変更前のアドレスが「00000034」より大きい場合、変更前のアドレスに「16」を加えたアドレスが変更後のアドレスになることを表わしている。
The address correspondence storage device 143 stores the address correspondence table 620 using a storage device such as the magnetic disk device 920. The address correspondence table 620 represents a correspondence relationship between the address before the change and the address after the change. For example, a set of the address 621 before the change and the offset 622 is arranged. In this example, there are three pre-change branch instructions extracted by the branch instruction extraction device 130, and the address correspondence table 620 includes a set of three pre-change addresses 621 and offsets 622 correspondingly.
The pre-change address 621 represents the address of the branch instruction before the change (hereinafter referred to as “pre-change branch source address”).
The offset 622 represents the difference between the address before the change and the address after the change.
In this example, in the first row of the address correspondence table 620, as a result of replacing the branch instruction at the address “00000012” with a post-change branch instruction that is 8 bytes longer than the branch instruction, the address before the change is larger than “00000012”. In this case, the address obtained by adding “8” to the address before the change becomes the address after the change. Similarly, the second line of the address correspondence table 620 adds “16” to the address before change when the address before the change is larger than “00000034” as a result of replacing the branch instruction at the address “00000034”. This indicates that the address becomes the changed address.

分岐先決定装置144は、CPU911などの処理装置を用いて、変更前分岐先記憶装置142が記憶した変更前分岐先テーブル610と、アドレス対応記憶装置143が記憶したアドレス対応テーブル620とに基づいて、変更後分岐先アドレス631を算出する。
分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブル630を記憶する。分岐先テーブル630は、分岐先決定装置144が算出した変更後分岐先アドレス631を、分岐先記憶領域決定装置141が決定した順序で並べたものである。
The branch destination determination device 144 uses a processing device such as the CPU 911 based on the pre-change branch destination table 610 stored in the pre-change branch destination storage device 142 and the address correspondence table 620 stored in the address correspondence storage device 143. Then, the post-change branch destination address 631 is calculated.
The branch destination storage device 145 stores the branch destination table 630 using a storage device such as the magnetic disk device 920. The branch destination table 630 is an array of post-change branch destination addresses 631 calculated by the branch destination determination device 144 in the order determined by the branch destination storage area determination device 141.

分岐先決定装置144は、例えば、変更前分岐先アドレス611が「00000020」である場合、アドレス対応テーブル620を参照して、「00000012」<「00000020」≦「00000034」であるから、対応するオフセット622「8」を取得して、変更前分岐先アドレス611「00000020」に加え、変更後分岐先アドレス631「00000028」を算出する。また、分岐先決定装置144は、変更前分岐先アドレス611が「00000006」である場合、アドレス対応テーブル620を参照して、「00000006」≦「00000012」であるから、変更前分岐先アドレス611「00000006」をそのまま変更後分岐先アドレス631とする。   For example, when the pre-change branch destination address 611 is “00000020”, the branch destination determining apparatus 144 refers to the address correspondence table 620 and satisfies “00000012” <“00000020” ≦ “00000034”, so that the corresponding offset 622 “8” is acquired, and the post-change branch destination address 631 “000000208” is calculated in addition to the pre-change branch destination address 611 “00000020”. Further, when the branch destination address 611 before change is “00000006”, the branch destination determination apparatus 144 refers to the address correspondence table 620, and “00000006” ≦ “00000012”. Therefore, the branch destination address 611 “before change” “00000006” is used as the post-change branch destination address 631.

次に、処理の流れについて説明する。   Next, the flow of processing will be described.

図7は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、変換済プログラム記憶装置180は、プログラム変換処理の開始前に、CPU911などの処理装置を用いて、変換済プログラム420を初期化して、磁気ディスク装置920などの記憶装置を用いて、空の変換済プログラム420を記憶している。
FIG. 7 is a flowchart showing an example of the flow of a program conversion process in which the program conversion apparatus 100 in this embodiment converts the target program 415 to generate the converted program 420.
Note that the converted program storage device 180 initializes the converted program 420 using a processing device such as the CPU 911 before starting the program conversion processing, and uses a storage device such as the magnetic disk device 920 to empty the converted program storage device 180. The converted program 420 is stored.

逆アセンブル工程S812において、逆アセンブル装置131は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415を最初から順に入力する。逆アセンブル装置131は、CPU911などの処理装置を用いて、入力した対象プログラム415を逆アセンブルして、アセンブリコードを1行ずつ生成する。逆アセンブル装置131は、CPU911などの処理装置を用いて、生成したアセンブリコードを出力する。   In the disassembly step S812, the disassembly device 131 inputs the target program 415 stored in the target program storage device 120 in order from the beginning using a processing device such as the CPU 911. The disassembling device 131 disassembles the input target program 415 using a processing device such as the CPU 911, and generates assembly code line by line. The disassembly device 131 outputs the generated assembly code using a processing device such as the CPU 911.

分岐命令判定工程S814において、分岐命令判定装置132は、CPU911などの処理装置を用いて、逆アセンブル工程S812で逆アセンブル装置131が生成したアセンブリコードを入力する。分岐命令判定装置132は、CPU911などの処理装置を用いて、入力したアセンブリコードが分岐命令であるか否かを判定する。
分岐命令であると判定した場合、分岐先取得工程S815へ進む。
分岐命令でないと判定した場合、命令出力工程S837へ進む。
In the branch instruction determination step S814, the branch instruction determination device 132 inputs the assembly code generated by the disassembly device 131 in the disassembly step S812 using a processing device such as the CPU 911. The branch instruction determination device 132 determines whether the input assembly code is a branch instruction using a processing device such as the CPU 911.
If it is determined that the instruction is a branch instruction, the process proceeds to a branch destination acquisition step S815.
If it is determined that the instruction is not a branch instruction, the process proceeds to instruction output step S837.

分岐先取得工程S815において、分岐先取得装置133は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令判定装置132が分岐命令であると判定したアセンブリコードを入力する。分岐先取得装置133は、CPU911などの処理装置を用いて、入力したアセンブリコードに基づいて、変更前分岐先アドレスを取得する。分岐先取得装置133は、CPU911などの処理装置を用いて、取得した変更前分岐先アドレスを出力する。   In the branch destination acquisition step S815, the branch destination acquisition device 133 uses the processing device such as the CPU 911 to input the assembly code determined by the branch instruction determination device 132 as a branch instruction in the branch instruction determination step S814. The branch destination acquisition device 133 uses a processing device such as the CPU 911 to acquire the pre-change branch destination address based on the input assembly code. The branch destination acquisition device 133 outputs the acquired pre-change branch destination address using a processing device such as the CPU 911.

分岐先記憶領域決定工程S818において、分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、分岐先格納位置を決定し、分岐先格納アドレスを算出する。分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、決定した分岐先格納位置と、算出した分岐先格納アドレスとを出力する。   In the branch destination storage area determination step S818, the branch destination storage area determination device 141 determines a branch destination storage position and calculates a branch destination storage address using a processing device such as the CPU 911. The branch destination storage area determination device 141 outputs the determined branch destination storage position and the calculated branch destination storage address using a processing device such as the CPU 911.

変更前分岐先記憶工程S819において、変更前分岐先記憶装置142は、CPU911などの処理装置を用いて、分岐先取得工程S815で分岐先取得装置133が出力した変更前分岐先アドレスと、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納位置とを入力する。変更前分岐先記憶装置142は、磁気ディスク装置920などの記憶装置を用いて、変更前分岐先テーブル610のうち、入力した分岐先格納位置に、入力した変更前分岐先アドレスを記憶する。   In the pre-change branch destination storage step S819, the pre-change branch destination storage device 142 uses the processing device such as the CPU 911 and the pre-change branch destination address output from the branch destination acquisition device 133 in the branch destination acquisition step S815 and the branch destination. The branch destination storage position output from the branch destination storage area determination device 141 in the storage area determination step S818 is input. The pre-change branch destination storage device 142 stores the input pre-change branch destination address in the input branch destination storage position in the pre-change branch destination table 610 using a storage device such as the magnetic disk device 920.

変更分岐命令生成工程S834において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、逆アセンブル工程S812で逆アセンブル装置131が出力したアセンブリコードと、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納アドレスとを入力する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、入力したアセンブリコードと、分岐先格納アドレスとに基づいて、変更後分岐命令520を生成する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、生成した変更後分岐命令520を出力する。   In the modified branch instruction generation step S834, the modified branch instruction generation device 151 uses the processing device such as the CPU 911 to branch the assembly code output by the disassembly device 131 in the disassembly step S812 and the branch destination storage area determination step S818. The branch destination storage address output by the destination storage area determination device 141 is input. The changed branch instruction generation device 151 uses a processing device such as the CPU 911 to generate the changed branch instruction 520 based on the input assembly code and the branch destination storage address. The changed branch instruction generation device 151 outputs the generated changed branch instruction 520 using a processing device such as the CPU 911.

変更分岐命令出力工程S835において、分岐命令変更装置152は、CPU911などの処理装置を用いて、変更分岐命令生成工程S834で変更分岐命令生成装置151が出力した変更後分岐命令520を入力する。分岐命令変更装置152は、CPU911などの処理装置を用いて、入力した変更後分岐命令520を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。
変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、変更後分岐命令520が追加された変換済プログラム420を記憶する。
その後、アドレス対応記憶工程S838へ進む。
In the change branch instruction output step S835, the branch instruction change device 152 inputs the post-change branch instruction 520 output from the change branch instruction generation device 151 in the change branch instruction generation step S834 using a processing device such as the CPU 911. The branch instruction changing device 152 uses the processing device such as the CPU 911 to add and write the input changed branch instruction 520 to the end of the converted program 420 stored in the converted program storage device 180.
The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the post-change branch instruction 520 is added.
Thereafter, the process proceeds to the address correspondence storage step S838.

命令出力工程S837において、分岐命令変更装置152は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415のうち、分岐命令判定工程S814で分岐命令判定装置132が分岐命令でないと判定したアセンブリコードに対応する部分を入力する。分岐命令変更装置152は、CPU911などの処理装置を用いて、入力した部分を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。
変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、もとの命令が追加された変換済プログラム420を記憶する。
In the instruction output step S837, the branch instruction changing device 152 uses the processing device such as the CPU 911, among the target programs 415 stored in the target program storage device 120, the branch instruction determining device 132 uses the branch instruction in the branch instruction determining step S814. The part corresponding to the assembly code determined to be not is input. The branch instruction change device 152 uses the processing device such as the CPU 911 to add and write the input portion to the end of the converted program 420 stored in the converted program storage device 180.
The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the original instruction is added.

アドレス対応記憶工程S838において、アドレス対応記憶装置143は、CPU911などの処理装置を用いて、逆アセンブル工程S812で逆アセンブル装置131が生成したアセンブリコードに対応する部分のバイト数と、変更分岐命令出力工程S835または命令出力工程S837で分岐命令変更装置152が書き込んだバイト数とを入力する。アドレス対応記憶装置143は、CPU911などの処理装置を用いて、入力した2つのバイト数が同じか否かを判定する。アドレス対応記憶装置143は、CPU911などの処理装置を用いて、入力した2つのバイト数が同じでない場合、両者の差を求める。アドレス対応記憶装置143は、CPU911などの処理装置を用いて、求めた差を、現在のオフセットに加える。アドレス対応記憶装置143は、磁気ディスク装置920などの記憶装置を用いて、アドレス対応テーブル620に、変更前アドレス621とオフセット622とを記憶する。   In the address correspondence storage step S838, the address correspondence storage device 143 uses the processing device such as the CPU 911 to output the number of bytes corresponding to the assembly code generated by the disassembly device 131 in the disassembly step S812 and the changed branch instruction output. The number of bytes written by the branch instruction change unit 152 in step S835 or instruction output step S837 is input. The address correspondence storage device 143 uses a processing device such as the CPU 911 to determine whether or not the two input byte numbers are the same. The address correspondence storage device 143 uses a processing device such as the CPU 911 to obtain the difference between the two when the input two byte numbers are not the same. The address correspondence storage device 143 uses the processing device such as the CPU 911 to add the obtained difference to the current offset. The address correspondence storage device 143 stores the pre-change address 621 and the offset 622 in the address correspondence table 620 using a storage device such as the magnetic disk device 920.

繰返し工程S839において、逆アセンブル装置131は、CPU911などの処理装置を用いて、対象プログラム415の最後まで逆アセンブルしたか否かを判定する。
最後まで逆アセンブルしたと判定した場合、変更後分岐先決定工程S841へ進む。
まだ逆アセンブルが終わっていないと判定した場合、逆アセンブル工程S812からの処理を繰り返す。
In the repetition step S839, the disassembly device 131 determines whether or not the disassembly has been completed up to the end of the target program 415 using a processing device such as the CPU 911.
When it is determined that the disassembly is completed to the end, the process proceeds to the post-change branch destination determination step S841.
When it is determined that the disassembly is not finished yet, the processing from the disassembly step S812 is repeated.

変更後分岐先決定工程S841において、分岐先決定装置144は、CPU911などの処理装置を用いて、アドレス対応記憶工程S838でアドレス対応記憶装置143が記憶したアドレス対応テーブル620と、変更前分岐先記憶工程S819で変更前分岐先記憶装置142が記憶した変更前分岐先テーブル610とを入力する。分岐先決定装置144は、CPU911などの処理装置を用いて、入力したアドレス対応テーブル620に基づいて、入力した変更前分岐先テーブル610に含まれる変更前分岐先アドレス611それぞれに対応する変更後分岐先アドレス631を算出する。分岐先決定装置144は、算出した変更後分岐先アドレス631を出力する。   In the post-change branch destination determination step S841, the branch destination determination device 144 uses the processing device such as the CPU 911 and the address correspondence table 620 stored in the address correspondence storage device 143 in the address correspondence storage step S838 and the pre-change branch destination storage. In step S819, the pre-change branch destination table 610 stored in the pre-change branch destination storage device 142 is input. The branch destination determining device 144 uses a processing device such as the CPU 911 and based on the input address correspondence table 620, the post-change branch corresponding to each of the pre-change branch destination addresses 611 included in the input pre-change branch destination table 610. The destination address 631 is calculated. The branch destination determination device 144 outputs the calculated post-change branch destination address 631.

変更後分岐先記憶工程S842において、分岐先記憶装置145は、CPU911などの処理装置を用いて、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納位置と、変更後分岐先決定工程S841で分岐先決定装置144が出力した変更後分岐先アドレス631を入力する。分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブル630のうち、入力した分岐先格納位置に、入力した変更後分岐先アドレス631を記憶する。   In the post-change branch destination storage step S842, the branch destination storage device 145 uses the processing device such as the CPU 911 to change the branch destination storage position output by the branch destination storage region determination device 141 in the branch destination storage region determination step S818 and the change. The post-change branch destination address 631 output from the branch destination determination device 144 in the post-branch destination determination step S841 is input. The branch destination storage device 145 stores the input post-change branch destination address 631 at the input branch destination storage position in the branch destination table 630 using a storage device such as the magnetic disk device 920.

分岐先テーブル挿入工程S844において、分岐先挿入装置161は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630を入力する。分岐先挿入装置161は、CPU911などの処理装置を用いて、入力した分岐先テーブル630を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。
変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブル630が追加された変換済プログラム420を記憶する。
In the branch destination table insertion step S844, the branch destination insertion device 161 inputs the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842 using a processing device such as the CPU 911. The branch destination insertion device 161 uses the processing device such as the CPU 911 to add and write the input branch destination table 630 to the end of the converted program 420 stored in the converted program storage device 180.
The converted program storage device 180 stores the converted program 420 to which the branch destination table 630 is added using a storage device such as the magnetic disk device 920.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、分岐先テーブル挿入工程S844で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力する。変換済プログラム出力装置191は、CPU911などの処理装置を用いて、入力した変換済プログラム420を出力する。
その後、プログラム変換処理を終了する。
In the changed program output step S862, the converted program output device 191 inputs the converted program 420 stored in the converted program storage device 180 in the branch destination table insertion step S844 using a processing device such as the CPU 911. The converted program output device 191 outputs the input converted program 420 using a processing device such as the CPU 911.
Thereafter, the program conversion process is terminated.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、情報を処理する処理装置(CPU911)と、対象プログラム入力装置110と、分岐命令抽出装置130と、分岐先取得装置133と、分岐先テーブル生成装置140と、変更分岐命令生成装置151と、分岐命令変更装置152と、変換済プログラム出力装置191とを有することを特徴とする。
上記対象プログラム入力装置110は、上記処理装置(CPU911)を用いて、変換の対象となるプログラム(対象プログラム410)を入力して、対象プログラム415とすることを特徴とする。
上記分岐命令抽出装置130は、上記処理装置(CPU911)を用いて、上記対象プログラム入力装置110が入力した対象プログラム415を解析し、分岐を指示する分岐命令を抽出して、変更前分岐命令とすることを特徴とする。
上記分岐先取得装置133は、上記処理装置(CPU911)を用いて、上記分岐命令抽出装置130が抽出した変更前分岐命令が指示する分岐の分岐先を表わす情報(変更前分岐先アドレス611)を取得して、変更前分岐先情報とすることを特徴とする。
上記分岐先テーブル生成装置140は、上記処理装置(CPU911)を用いて、上記分岐先取得装置133が取得した変更前分岐先情報(変更前分岐先アドレス611)に基づいて、分岐先テーブル630を生成することを特徴とする。
上記変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、分岐先を表わす情報(分岐先絶対アドレス)を算出することを指示する分岐先算出命令と、上記分岐先算出命令を実行することにより算出される情報が表わす分岐先への分岐を指示する分岐命令とを含む変更後分岐命令520を、上記分岐先テーブル生成装置140が生成した分岐先テーブル630に基づいて生成することを特徴とする。
上記分岐命令変更装置152は、上記処理装置(CPU911)を用いて、上記対象プログラム入力装置110が入力した対象プログラム415のうち、上記分岐命令抽出装置130が抽出した変更前分岐命令を、上記変更分岐命令生成装置151が生成した変更後分岐命令520に置き換えることを特徴とする。
上記変換済プログラム出力装置191は、上記処理装置(CPU911)を用いて、上記分岐命令変更装置152が分岐命令を置き換えた対象プログラム415を、変換済プログラム420として出力することを特徴とする。
The program conversion device 100 (program conversion system, program conversion method) in this embodiment includes a processing device (CPU 911) for processing information, a target program input device 110, a branch instruction extraction device 130, and a branch destination acquisition device 133. A branch destination table generation device 140, a changed branch instruction generation device 151, a branch instruction change device 152, and a converted program output device 191.
The target program input device 110 uses the processing device (CPU 911) to input a program to be converted (target program 410) to be a target program 415.
The branch instruction extraction unit 130 analyzes the target program 415 input by the target program input unit 110 using the processing unit (CPU 911), extracts a branch instruction instructing a branch, It is characterized by doing.
The branch destination acquisition device 133 uses the processing device (CPU 911) to obtain information (pre-change branch destination address 611) indicating the branch destination of the branch indicated by the pre-change branch instruction extracted by the branch instruction extraction device 130. It is acquired and used as pre-change branch destination information.
The branch destination table generation device 140 uses the processing device (CPU 911) to generate the branch destination table 630 based on the pre-change branch destination information (pre-change branch destination address 611) acquired by the branch destination acquisition device 133. It is characterized by generating.
The modified branch instruction generation device 151 uses the processing device (CPU 911) to execute a branch destination calculation instruction that instructs to calculate information (branch destination absolute address) indicating a branch destination and the branch destination calculation instruction. And generating a post-change branch instruction 520 including a branch instruction for instructing a branch to the branch destination represented by the information calculated as described above based on the branch destination table 630 generated by the branch destination table generation device 140. Features.
The branch instruction change device 152 uses the processing device (CPU 911) to change the branch instruction before change extracted by the branch instruction extractor 130 from the target program 415 input by the target program input device 110. The changed branch instruction 520 generated by the branch instruction generation device 151 is replaced.
The converted program output device 191 uses the processing device (CPU 911) to output the target program 415 in which the branch instruction change device 152 has replaced the branch instruction as a converted program 420.

この実施の形態におけるプログラム変換装置100によれば、分岐命令抽出装置130が抽出した変更前分岐命令を、変更分岐命令生成装置151が生成した変更後分岐命令に、分岐命令変更装置152が置き換えるので、対象プログラム415と同じ動作をしながら対象プログラム415よりもリバースエンジニアリングが困難な変換済プログラム420を生成することができるという効果を奏する。   According to the program conversion device 100 in this embodiment, the branch instruction change device 152 replaces the branch instruction before change extracted by the branch instruction extraction device 130 with the branch instruction after change generated by the change branch instruction generation device 151. Thus, the converted program 420 that is more difficult to reverse engineer than the target program 415 while performing the same operation as the target program 415 can be generated.

また、変換済プログラム420のなかの変更後分岐命令は、対象プログラム415のなかの変更前分岐命令があった位置に挿入されるので、変換済プログラム420の特定の位置にブレークポイントなどを設定しても、分岐先アドレスについての情報を収集することができず、リバースエンジニアリングの困難さが増すという効果を奏する。   Since the post-change branch instruction in the converted program 420 is inserted into the target program 415 at the position where the pre-change branch instruction was, a breakpoint or the like is set at a specific position in the converted program 420. However, the information about the branch destination address cannot be collected, and there is an effect that the difficulty of reverse engineering increases.

上記プログラム変換装置100は、更に、分岐先挿入装置161を有することを特徴とする。
上記分岐先挿入装置161は、上記処理装置(CPU911)を用いて、上記分岐先テーブル生成装置140が生成した分岐先テーブル630を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
上記変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、上記分岐先算出命令として、上記分岐先挿入装置161が挿入した分岐先テーブル630を参照して分岐先を表わす情報(分岐先アドレス)を取得する命令を生成することを特徴とする。
The program conversion apparatus 100 further includes a branch destination insertion apparatus 161.
The branch destination insertion device 161 uses the processing device (CPU 911) to insert the branch destination table 630 generated by the branch destination table generation device 140 into the target program 415 input by the target program input device 110. It is characterized by.
The changed branch instruction generation device 151 uses the processing device (CPU 911) to refer to the branch destination table 630 inserted by the branch destination insertion device 161 as the branch destination calculation instruction (branch destination information) (branch destination). A command for acquiring a destination address is generated.

上述したように、この実施の形態におけるプログラム変換装置100は、コンピュータをプログラム変換装置100として機能させるプログラムを、コンピュータが実行することにより実現することができる。
この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)として、コンピュータを機能させるプログラムによれば、対象プログラム415と同じ動作をしながら対象プログラム415よりもリバースエンジニアリングが困難な変換済プログラム420を生成することができるプログラム変換装置100を実現できるという効果を奏する。
As described above, the program conversion apparatus 100 according to this embodiment can be realized by causing a computer to execute a program that causes the computer to function as the program conversion apparatus 100.
According to the program that causes the computer to function as the program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment, the converted program that is the same operation as the target program 415 and is more difficult to reverse engineer than the target program 415 The program conversion apparatus 100 that can generate the program 420 can be realized.

この実施の形態におけるプログラム変換装置100が対象プログラム415を変換するプログラム変換方法は、以下の点を特徴とする。
上記処理装置(CPU911)が、変換の対象となるプログラムを入力して、対象プログラム415とする。
上記処理装置(CPU911)が、入力した対象プログラム415を解析し、分岐を指示する分岐命令を抽出して、変更前分岐命令とする。
上記処理装置(CPU911)が、抽出した変更前分岐命令が指示する分岐の分岐先を表わす情報(変更前分岐先アドレス)を取得して、変更前分岐先情報とする。
上記処理装置(CPU911)が、取得した変更前分岐先情報に基づいて、分岐先テーブル630を生成する。
上記処理装置(CPU911)が、分岐先を表わす情報を算出することを指示する分岐先算出命令と、上記分岐先算出命令を実行することにより算出される情報が表わす分岐先への分岐を指示する分岐命令とを含む変更後分岐命令を、生成した分岐先テーブル630に基づいて生成する。
上記処理装置(CPU911)が、入力した対象プログラム415のうち、抽出した変更前分岐命令を、生成した変更後分岐命令に置き換える。
上記処理装置(CPU911)が、分岐命令を置き換えた対象プログラムを、変換済プログラムとして出力する。
The program conversion method in which the program conversion apparatus 100 in this embodiment converts the target program 415 is characterized by the following points.
The processing device (CPU 911) inputs a program to be converted and sets it as a target program 415.
The processing device (CPU 911) analyzes the input target program 415, extracts a branch instruction instructing a branch, and sets it as a branch instruction before change.
The processor (CPU 911) obtains information (pre-change branch destination address) indicating the branch destination of the branch indicated by the extracted pre-change branch instruction and sets it as pre-change branch destination information.
The processing device (CPU 911) generates a branch destination table 630 based on the acquired pre-change branch destination information.
The processing device (CPU 911) instructs a branch to a branch destination that is calculated by executing the branch destination calculation instruction and a branch destination calculation instruction that instructs to calculate information indicating the branch destination. A post-change branch instruction including a branch instruction is generated based on the generated branch destination table 630.
The processor (CPU 911) replaces the extracted pre-change branch instruction in the input target program 415 with the generated post-change branch instruction.
The processing device (CPU 911) outputs the target program in which the branch instruction is replaced as a converted program.

この実施の形態におけるプログラム変換方法によれば、対象プログラム415と同じ動作をしながら対象プログラム415よりもリバースエンジニアリングが困難な変換済プログラム420を生成することができるという効果を奏する。   According to the program conversion method in this embodiment, there is an effect that it is possible to generate a converted program 420 that is more difficult to reverse engineer than the target program 415 while performing the same operation as the target program 415.

なお、この実施の形態では、分岐命令のみを変更しているが、分岐後に後処理(例えば、退避したレジスタの復旧など)が必要な場合には、分岐先の命令も変更する構成としてもよい。   In this embodiment, only the branch instruction is changed. However, when post-processing (for example, restoration of a saved register) is necessary after branching, the branch destination instruction may be changed. .

以上説明したプログラム変換装置100(プログラム変換方式)は、
プログラムを変換し実行を制御するプログラム変換方式であって、
実行プログラム(対象プログラム415)内の分岐命令を検索し、各分岐命令について、データ部のテーブル(分岐先テーブル630)に新たに計算した分岐先アドレス(変更後分岐先アドレス)を格納し、分岐元の命令をデータ部のテーブル(分岐先テーブル630)から取得したアドレス(変更後分岐アドレス)に分岐するように命令を置き換え、変更後の実行プログラム(変換済プログラム420)の動作が変更前の実行プログラム(対象プログラム415)と同じ動作になるように変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
A program conversion method for converting a program and controlling execution,
A branch instruction in the execution program (target program 415) is searched, and for each branch instruction, the newly calculated branch destination address (changed branch destination address) is stored in the data section table (branch destination table 630). The instruction is replaced so that the original instruction branches to the address (branch address after change) obtained from the data table (branch destination table 630), and the operation of the changed execution program (converted program 420) is the same as before the change. It changes so that it may become the same operation | movement as an execution program (target program 415).

この実施の形態におけるプログラム変換装置100は、変更前分岐命令を、分岐先テーブル630を参照して分岐先を算出し、算出した分岐先へ分岐することを指示する変更後分岐命令に置き換えるが、変更前分岐命令をサブルーチン呼出に限定し、変更前分岐命令を、分岐先を算出して分岐するサブルーチン呼出に置き換える構成(以下「比較例1」と呼ぶ。)も考えられる。
以下、この実施の形態におけるプログラム変換装置100と、比較例1との対比を行う。
比較例1では、本来目的とするサブルーチンのアドレスの算出をプログラムに付加したソフトウェア(サブルーチン)内で行うため、サブルーチンコールを置き換える前の呼び出し元のアドレスと呼出し先アドレスの対応を収集して置き換え前のプログラムを復元するすることが簡単に行える。
例えば、デバッガで付加したソフトウェアが本来目的とするサブルーチンのアドレスを復元してサブルーチンの呼び出しを行う命令にブレークポイントを設定してこの命令の実行直前でプログラムが停止するようにするだけで、サブルーチンの呼出し元のアドレスは付加したプログラムの呼び出しに対する戻り先としてスタックに格納されているため、サブルーチンコールを置き換える前の呼び出し元のアドレスと呼出し先アドレスの対応を収集することが簡単に行える。
また、プログラムに付加したソフトウェア内で本来目的とするサブルーチンを呼び出す命令に対してデバッガでブレークポイントを設定する代わりに、サブルーチンコールを置き換える前の呼び出し元のアドレスと呼出し先アドレスの対応を収集するパッチを当てることで、デバッガを使わずにこのアドレスの対応を収集することもできる。
さらに、一旦サブルーチンコールを置き換える前の本来のプログラムの呼び出し元のアドレスと呼出し先アドレスの対応を収集されてしまうと、本来のプログラムが同一であればサブルーチンコールを変更したプログラムのコード部は全て同じであるため、サブルーチンコールを置き換える前の本来のプログラムを復元するパッチを作成して配布することも可能になる。
The program conversion apparatus 100 in this embodiment replaces the pre-change branch instruction with a post-change branch instruction that instructs to branch to the calculated branch destination by calculating the branch destination with reference to the branch destination table 630. A configuration (hereinafter referred to as “Comparative Example 1”) in which the branch instruction before change is limited to a subroutine call and the branch instruction before change is replaced with a subroutine call that branches by calculating a branch destination is also conceivable.
Hereinafter, the program conversion apparatus 100 in this embodiment is compared with the comparative example 1.
In Comparative Example 1, since the calculation of the address of the originally intended subroutine is performed in the software (subroutine) added to the program, the correspondence between the caller address and the callee address before replacing the subroutine call is collected and before the replacement. It is easy to restore the program.
For example, the software added by the debugger restores the address of the originally intended subroutine, sets a breakpoint at the instruction that calls the subroutine, and stops the program immediately before executing this instruction. Since the call source address is stored in the stack as a return destination for the added program call, it is easy to collect the correspondence between the call source address and the call destination address before replacing the subroutine call.
Also, a patch that collects the correspondence between the caller address and the callee address before replacing the subroutine call instead of setting a breakpoint in the debugger for the instruction that calls the intended subroutine in the software added to the program It is also possible to collect the correspondence of this address without using a debugger.
Furthermore, once the correspondence between the call source address and the callee address of the original program before substituting the subroutine call is collected, if the original program is the same, all code parts of the program that changed the subroutine call are the same Therefore, it is possible to create and distribute a patch that restores the original program before replacing the subroutine call.

これに対し、この実施の形態におけるプログラム変換装置100は、プログラム内の分岐命令を、分岐命令のオペランドに分岐先のアドレスを直接指定せずに、データ部のアドレス(分岐先テーブル630)を使って分岐するよう書き換えることで、プログラムの解析(リバースエンジニアリング)を試みようとする者にとっては、コード部だけの参照ではプログラムのロジックが解析できず、コード部でなくデータ部も参照することが必要となり、解析の負荷が増大するため、プログラムの解析を制限することが可能となる。
また、プログラム内の分岐命令を、特定のアドレスにある命令を実行することなく、データ部に格納された分岐先アドレスを使って各分岐命令から直接分岐するようにすることによって、特定のアドレスにデバッガを使ってブレークポイントをかけたりパッチを当てたりすることで変換を行う前の本来のプログラムの呼び出し元と呼出し先のアドレスの対応を収集することはできないため、プログラムの解析に必要な情報を自動的に収集することを防止することができる。
これにより、プログラムの解析と不正な利用を制限することができる。
On the other hand, the program conversion apparatus 100 in this embodiment uses the address of the data part (branch destination table 630) for the branch instruction in the program without directly specifying the branch destination address in the operand of the branch instruction. For those who try to analyze the program (reverse engineering) by rewriting to branch, the logic of the program cannot be analyzed by referring only to the code part, and it is necessary to refer to the data part instead of the code part Thus, since the analysis load increases, it is possible to limit the analysis of the program.
In addition, branch instructions in a program can be directly branched from each branch instruction using the branch destination address stored in the data section without executing the instruction at the specific address. Since it is not possible to collect the correspondence between the caller's address and the callee's original address before conversion by applying breakpoints or applying patches using the debugger, information necessary for program analysis can be collected. Collecting automatically can be prevented.
This can restrict program analysis and unauthorized use.

実施の形態2.
実施の形態2について、図8〜図10を用いて説明する。
Embodiment 2. FIG.
The second embodiment will be described with reference to FIGS.

図8は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態1で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 8 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 1, and description is abbreviate | omitted here.

対象プログラム入力装置110は、更に、逆アセンブル装置116を有する。
逆アセンブル装置116は、CPU911などの処理装置を用いて、実行形式のコードを逆アセンブルして、アセンブリコードを生成する。すなわち、種別判定装置113が判定した結果、対象プログラム410がC言語などのソースコードである場合、逆アセンブル装置116は、コンパイル装置114が生成した実行形式のコードを逆アセンブルする。種別判定装置113が判定した結果、対象プログラム410がアセンブリ言語などのソースコードである場合、逆アセンブル装置116は、アセンブル装置115が生成した実行形式のコードを逆アセンブルする。種別判定装置113が判定した結果、対象プログラム410が実行形式のコードである場合、対象プログラム記憶装置120は、プログラム取得装置112が取得した対象プログラム410を逆アセンブルする。
対象プログラム記憶装置120は、逆アセンブル装置116が生成したアセンブリコードを、対象プログラム416として記憶する。
The target program input device 110 further includes a disassembly device 116.
The disassembly device 116 uses a processing device such as the CPU 911 to disassemble the executable code to generate assembly code. That is, as a result of the determination by the type determination device 113, when the target program 410 is a source code such as C language, the disassembly device 116 disassembles the executable code generated by the compiling device 114. As a result of the determination by the type determination device 113, when the target program 410 is a source code such as an assembly language, the disassembly device 116 disassembles the executable code generated by the assembly device 115. As a result of the determination by the type determination device 113, when the target program 410 is an executable code, the target program storage device 120 disassembles the target program 410 acquired by the program acquisition device 112.
The target program storage device 120 stores the assembly code generated by the disassembly device 116 as the target program 416.

対象プログラム記憶装置120が記憶した対象プログラム416がアセンブリコードなので、分岐命令抽出装置130は、逆アセンブル装置131を有さない。
また、分岐先テーブル生成装置140は、変更前と変更後の分岐先アドレスの変化を考慮する必要がないので、変更前分岐先記憶装置142、アドレス対応記憶装置143、分岐先決定装置144を有さない。
Since the target program 416 stored in the target program storage device 120 is an assembly code, the branch instruction extraction device 130 does not have the disassembly device 131.
Further, the branch destination table generation device 140 does not need to consider the change of the branch destination address before and after the change, and therefore has the branch destination storage device 142 before the change, the address correspondence storage device 143, and the branch destination determination device 144. No.

プログラム変換装置100は、更に、アセンブル装置171を有する。
アセンブル装置171は、CPU911などの処理装置を用いて、分岐先挿入装置161が分岐先テーブル630を挿入した対象プログラム416をアセンブルして、実行形式のコードを生成する。
変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、アセンブル装置171が生成した実行形式のコードを、変換済プログラム420として記憶する。
The program conversion device 100 further includes an assembly device 171.
The assembling device 171 uses a processing device such as the CPU 911 to assemble the target program 416 into which the branch destination inserting device 161 has inserted the branch destination table 630, and generates an executable code.
The converted program storage device 180 stores the execution format code generated by the assembling device 171 as the converted program 420 using a storage device such as the magnetic disk device 920.

すなわち、実施の形態1におけるプログラム変換装置100が実行形式のコードのレベルでプログラム変換処理をするのに対し、この実施の形態におけるプログラム変換装置100は、アセンブリコードのレベルでプログラム変換処理をする点が異なっている。   That is, the program conversion apparatus 100 according to the first embodiment performs program conversion processing at the code level of the execution format, whereas the program conversion apparatus 100 according to this embodiment performs program conversion processing at the assembly code level. Is different.

図9は、この実施の形態における分岐命令変更装置152が分岐命令を変更する処理を説明するための図である。
逆アセンブル装置116は、各行にラベル(この例では、「L0001」〜「L0015」など)が付した変換前アセンブリコード640(対象プログラム416)を生成する。ラベルは、必ずしもすべての行に付されている必要はないが、少なくとも分岐先となる行には、必ずラベルが付される。
逆アセンブル装置116が生成した変換前アセンブリコード640は、対象プログラム記憶装置120が記憶し、分岐命令抽出装置130が、CPU911などの処理装置を用いて、1行ずつ入力する。
FIG. 9 is a diagram for explaining processing in which the branch instruction changing device 152 in this embodiment changes a branch instruction.
The disassembly device 116 generates pre-conversion assembly code 640 (target program 416) in which labels (in this example, “L0001” to “L0015”, etc.) are attached to each row. A label does not necessarily have to be attached to every line, but a label is always attached to at least a branch destination line.
The pre-conversion assembly code 640 generated by the disassembly device 116 is stored in the target program storage device 120, and the branch instruction extraction device 130 is input line by line using a processing device such as the CPU 911.

分岐命令抽出装置130は、CPU911などの処理装置を用いて、入力した変換前アセンブリコード640から分岐命令を抽出して、変更前分岐命令とする。分岐命令抽出装置130は、例えば、入力した変換前アセンブリコード640のニモニックが、「jmp」「jnz」「call」などであれば、分岐命令であると判定し、抽出する。この例において、分岐命令抽出装置130は、「L0001:jmp L0010」「L0007:jnz L0005」「L0012:call L0002」の3行を変更前分岐命令として抽出する。   The branch instruction extraction device 130 extracts a branch instruction from the input pre-conversion assembly code 640 using a processing device such as the CPU 911 and sets it as a branch instruction before change. For example, if the mnemonic of the input pre-conversion assembly code 640 is “jmp”, “jnz”, “call” or the like, the branch instruction extraction device 130 determines that it is a branch instruction and extracts it. In this example, the branch instruction extraction device 130 extracts three lines “L0001: jmp L0010”, “L0007: jnz L0005”, and “L0012: call L0002” as the branch instruction before change.

分岐先取得装置133は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令から、変更前分岐命令が指示する分岐の分岐先を表わすラベル(以下「分岐先ラベル」と呼ぶ。)を取得する。この例において、分岐先取得装置133は、「L0010」「L0005」「L0002」の3つの分岐先ラベル632を取得する。   The branch destination acquisition device 133 uses a processing device such as the CPU 911 to label the branch destination of the branch indicated by the branch instruction before change from the branch instruction before change extracted by the branch instruction extraction device 130 (hereinafter referred to as “branch destination label”). ").). In this example, the branch destination acquisition apparatus 133 acquires three branch destination labels 632 “L0010”, “L0005”, and “L0002”.

分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先取得装置133が取得した分岐先ラベル632を、分岐先テーブル630のうち、分岐先記憶領域決定装置141が決定した分岐先格納位置に記憶する。この例では、分岐先記憶領域決定装置141は、分岐先ラベル632を変更前分岐命令が変換前アセンブリコード640に出現した順序で記憶すると決定したものとする。分岐先記憶装置145は、分岐先取得装置133が取得した分岐先ラベル632を、「L0010」「L0005」「L0002」の順序で記憶する。   The branch destination storage device 145 uses a storage device such as the magnetic disk device 920 to determine the branch destination label 632 acquired by the branch destination acquisition device 133 in the branch destination table 630 by the branch destination storage area determination device 141. Store in the branch destination storage location. In this example, it is assumed that the branch destination storage area determination device 141 determines that the branch destination label 632 is stored in the order in which the branch instruction before change appears in the assembly code 640 before conversion. The branch destination storage device 145 stores the branch destination labels 632 acquired by the branch destination acquisition device 133 in the order of “L0010”, “L0005”, and “L0002”.

分岐命令変更装置152は、CPU911などの処理装置を用いて、変換前アセンブリコード640のうち、分岐命令抽出装置130が抽出した変更前分岐命令を、変更分岐命令生成装置151が生成した変更後分岐命令で置き換えて、変更部分651とする。   The branch instruction changing device 152 uses a processing device such as the CPU 911 to branch the pre-change branch instruction extracted by the branch instruction extracting device 130 in the pre-conversion assembly code 640 generated by the changed branch instruction generating device 151. The changed portion 651 is replaced with an instruction.

分岐先挿入装置161は、CPU911などの処理装置を用いて、分岐先記憶装置145が記憶した分岐先テーブル630をアセンブリコード形式に変換する。分岐先挿入装置161は、CPU911などの処理装置を用いて、アセンブリコード形式に変換した分岐先テーブル630を、分岐命令変更装置152が分岐命令を置き換えた変更部分651に、追加部分652として追加して、変換済アセンブリコード650とする。   The branch destination insertion device 161 converts the branch destination table 630 stored in the branch destination storage device 145 into an assembly code format by using a processing device such as the CPU 911. The branch destination insertion device 161 uses the processing device such as the CPU 911 to add the branch destination table 630 converted into the assembly code format as the addition portion 652 to the change portion 651 in which the branch instruction change device 152 replaced the branch instruction. Thus, the converted assembly code 650 is obtained.

図10は、この実施の形態におけるプログラム変換装置100が対象プログラム416を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、アセンブル装置171は、プログラム変換処理の開始前にあらかじめ、CPU911などの処理装置を用いて、変換済アセンブリコード650を初期化して、空の変換済アセンブリコード650を生成し、磁気ディスク装置920などの記憶装置を用いて、記憶しておく。
FIG. 10 is a flowchart showing an example of the flow of program conversion processing in which the program conversion apparatus 100 in this embodiment converts the target program 416 to generate the converted program 420.
The assembler 171 initializes the converted assembly code 650 by using a processing device such as the CPU 911 in advance before starting the program conversion processing, generates an empty converted assembly code 650, and generates the magnetic disk device 920. This is stored using a storage device such as

命令取得工程S813において、分岐命令判定装置132は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した変換前アセンブリコード640からアセンブリコードを1行ずつ取得する。   In the instruction acquisition step S813, the branch instruction determination device 132 acquires an assembly code line by line from the pre-conversion assembly code 640 stored in the target program storage device 120 using a processing device such as the CPU 911.

分岐命令判定工程S814において、分岐命令判定装置132は、CPU911などの処理装置を用いて、命令取得工程S813で取得したアセンブリコードが分岐命令であるか否かを判定する。
分岐命令であると判定した場合、分岐先取得工程S815へ進む。
分岐命令でないと判定した場合、命令出力工程S837へ進む。
In the branch instruction determination step S814, the branch instruction determination device 132 determines whether the assembly code acquired in the instruction acquisition step S813 is a branch instruction using a processing device such as the CPU 911.
If it is determined that the instruction is a branch instruction, the process proceeds to a branch destination acquisition step S815.
If it is determined that the instruction is not a branch instruction, the process proceeds to instruction output step S837.

分岐先取得工程S815において、分岐先取得装置133は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令であると判定したアセンブリコードを入力する。分岐先取得装置133は、CPU911などの処理装置を用いて、入力したアセンブリコードに基づいて、分岐先ラベル632を取得する。分岐先取得装置133は、CPU911などの処理装置を用いて、取得した分岐先ラベル632を出力する。   In the branch destination acquisition step S815, the branch destination acquisition device 133 inputs an assembly code determined to be a branch instruction in the branch instruction determination step S814 using a processing device such as the CPU 911. The branch destination acquisition device 133 uses a processing device such as the CPU 911 to acquire the branch destination label 632 based on the input assembly code. The branch destination acquisition device 133 outputs the acquired branch destination label 632 using a processing device such as the CPU 911.

分岐先記憶領域決定工程S818において、分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、分岐先格納位置を決定し、分岐先格納アドレスを算出する。分岐先記憶領域決定装置141は、決定した分岐先格納位置と、算出した分岐先格納アドレスとを出力する。   In the branch destination storage area determination step S818, the branch destination storage area determination device 141 determines a branch destination storage position and calculates a branch destination storage address using a processing device such as the CPU 911. The branch destination storage area determining device 141 outputs the determined branch destination storage position and the calculated branch destination storage address.

分岐先ラベル記憶工程S820において、分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先取得工程S815で分岐先取得装置133が取得した分岐先ラベルを、分岐先テーブル630のうち、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納位置に記憶する。   In the branch destination label storage step S820, the branch destination storage device 145 uses the storage device such as the magnetic disk device 920 to store the branch destination label acquired by the branch destination acquisition device 133 in the branch destination acquisition step S815. Among them, the branch destination storage area is stored in the branch destination storage position output by the branch destination storage area determining device 141 in step S818.

変更分岐命令生成工程S834において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令判定装置132が分岐命令であると判定した変更前分岐命令と、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納アドレスとを入力する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、入力した変更前分岐命令と、入力した分岐先格納アドレスとに基づいて、変更後分岐命令を生成する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、生成した変更後分岐命令を出力する。   In the change branch instruction generation step S834, the change branch instruction generation device 151 uses a processing device such as the CPU 911 and the branch instruction before change that the branch instruction determination device 132 has determined as a branch instruction in the branch instruction determination step S814. The branch destination storage address output from the branch destination storage area determination device 141 in the branch destination storage area determination step S818 is input. The changed branch instruction generation device 151 uses a processing device such as the CPU 911 to generate a post-change branch instruction based on the input pre-change branch instruction and the input branch destination storage address. The changed branch instruction generation device 151 outputs the generated changed branch instruction using a processing device such as the CPU 911.

変更分岐命令出力工程S835において、分岐命令変更装置152は、CPU911などの処理装置を用いて、変更分岐命令生成工程S834で変更分岐命令生成装置151が出力した変更後分岐命令を入力する。分岐命令変更装置152は、CPU911などの処理装置を用いて、入力した変更後分岐命令を、アセンブル装置171が記憶した変換済アセンブリコード650の最後に追加して書き込む。アセンブル装置171は、磁気ディスク装置920などの記憶装置を用いて、変更後分岐命令が追加された変換済アセンブリコード650を記憶する。
その後、繰返し工程S839へ進む。
In the change branch instruction output step S835, the branch instruction change device 152 inputs the post-change branch instruction output from the change branch instruction generation device 151 in the change branch instruction generation step S834 using a processing device such as the CPU 911. The branch instruction changing device 152 uses the processing device such as the CPU 911 to add and write the input changed branch instruction to the end of the converted assembly code 650 stored in the assembling device 171. The assembling device 171 stores the converted assembly code 650 to which the post-change branch instruction is added, using a storage device such as the magnetic disk device 920.
Then, it progresses to repetition process S839.

命令出力工程S837において、分岐命令変更装置152は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令判定装置132が分岐命令でないと判定したアセンブリコードを入力する。分岐命令変更装置152は、CPU911などの処理装置を用いて、入力したアセンブリコードを、アセンブル装置171が記憶した変換済アセンブリコード650の最後に追加して書き込む。アセンブル装置171は、磁気ディスク装置920などの記憶装置を用いて、もとのアセンブリコードが追加された変換済アセンブリコード650を記憶する。   In the instruction output step S837, the branch instruction change device 152 inputs an assembly code determined by the branch instruction determination device 132 that the branch instruction determination device 132 is not a branch instruction in the branch instruction determination step S814 using a processing device such as the CPU 911. The branch instruction changing device 152 uses the processing device such as the CPU 911 to add and write the input assembly code to the end of the converted assembly code 650 stored in the assembling device 171. The assembling device 171 stores the converted assembly code 650 to which the original assembly code is added, using a storage device such as the magnetic disk device 920.

繰返し工程S839において、分岐命令判定装置132は、対象プログラム記憶装置120が記憶した変換前アセンブリコード640をすべて取得したか否かを判定する。
変換前アセンブリコード640をすべて取得したと判定した場合、分岐先テーブル挿入工程S844へ進む。
まだ取得が終わっていないと判定した場合、命令取得工程S813からの処理を繰り返す。
In the repetition step S839, the branch instruction determination device 132 determines whether or not all the pre-conversion assembly codes 640 stored in the target program storage device 120 have been acquired.
If it is determined that all the pre-conversion assembly codes 640 have been acquired, the process proceeds to the branch destination table insertion step S844.
If it is determined that the acquisition has not yet been completed, the processing from the instruction acquisition step S813 is repeated.

分岐先テーブル挿入工程S844において、分岐先挿入装置161は、CPU911などの処理装置を用いて、分岐先ラベル記憶工程S820で分岐先記憶装置145が記憶した分岐先テーブル630を入力する。分岐先挿入装置161は、CPU911などの処理装置を用いて、入力した分岐先テーブル630をアセンブリコード形式に変換する。分岐先挿入装置161は、CPU911などの処理装置を用いて、変換した分岐先テーブル630を、アセンブル装置171が記憶した変換済アセンブリコード650の最後に追加して書き込む。アセンブル装置171は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブル630が追加された変換済アセンブリコード650を記憶する。   In the branch destination table insertion step S844, the branch destination insertion device 161 inputs the branch destination table 630 stored in the branch destination storage device 145 in the branch destination label storage step S820 using a processing device such as the CPU 911. The branch destination insertion device 161 converts the input branch destination table 630 into an assembly code format using a processing device such as the CPU 911. The branch destination insertion device 161 uses a processing device such as the CPU 911 to add and write the converted branch destination table 630 to the end of the converted assembly code 650 stored in the assembly device 171. The assembly device 171 stores the converted assembly code 650 to which the branch destination table 630 is added, using a storage device such as the magnetic disk device 920.

アセンブル工程S861において、アセンブル装置171は、CPU911などの処理装置を用いて、記憶した変換済アセンブリコード650をアセンブルして、実行形式のコードを生成する。アセンブル装置171は、CPU911などの処理装置を用いて、生成した実行形式のコードを出力する。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、アセンブル装置171が出力した実行形式のコードを、変換済プログラム420として記憶する。   In the assembling step S861, the assembling device 171 assembles the stored converted assembly code 650 using a processing device such as the CPU 911 to generate an executable code. The assembling device 171 outputs the generated executable code using a processing device such as the CPU 911. The converted program storage device 180 stores the execution format code output from the assembly device 171 as the converted program 420 using a storage device such as the magnetic disk device 920.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、アセンブル工程S861で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力する。変換済プログラム出力装置191は、CPU911などの処理装置を用いて、入力した変換済プログラム420を出力する。
その後、プログラム変換処理を終了する。
In the changed program output step S862, the converted program output device 191 inputs the converted program 420 stored in the converted program storage device 180 in the assembly step S861 using a processing device such as the CPU 911. The converted program output device 191 outputs the input converted program 420 using a processing device such as the CPU 911.
Thereafter, the program conversion process is terminated.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、更に、アセンブル装置171とを有することを特徴とする。
上記対象プログラム入力装置110は、上記処理装置(CPU911)を用いて、上記対象プログラムとして、アセンブリコード形式の対象プログラム416を入力することを特徴とする。
上記アセンブル装置171は、上記処理装置(CPU911)を用いて、上記分岐命令変更装置152が分岐命令を変更した対象プログラム416をアセンブルして、実行形式のコードを生成し、変換済プログラム420とすることを特徴とする。
上記変換済プログラム出力装置191は、上記処理装置(CPU911)を用いて、上記アセンブル装置171が生成した変換済プログラム420を出力することを特徴とする。
The program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment further includes an assembly apparatus 171.
The target program input device 110 inputs the target program 416 in an assembly code format as the target program using the processing device (CPU 911).
The assembly device 171 uses the processing device (CPU 911) to assemble the target program 416 whose branch instruction change device 152 has changed the branch instruction, generates an executable code, and sets it as the converted program 420. It is characterized by that.
The converted program output device 191 outputs the converted program 420 generated by the assembly device 171 using the processing device (CPU 911).

この実施の形態におけるプログラム変換装置100によれば、変更前分岐命令の長さと変更後分岐命令の長さとが異なる場合であっても、アドレスの変化を考慮する必要がないので、分岐先テーブル生成装置140の処理を簡略化することができ、プログラム変換処理の負荷を軽減することができるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, even if the length of the branch instruction before change and the length of the branch instruction after change are different, it is not necessary to consider the change of the address. The processing of the device 140 can be simplified, and the load of program conversion processing can be reduced.

実施の形態3.
実施の形態3について、図11〜図15を用いて説明する。
Embodiment 3 FIG.
A third embodiment will be described with reference to FIGS.

図11は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態1で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 11 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 1, and description is abbreviate | omitted here.

分岐先テーブル生成装置140は、アドレス対応記憶装置143に代えて、分岐元取得装置146、変更前分岐元記憶装置148を有する。
分岐元取得装置146は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令に基づいて、変更前の対象プログラム415における変更前分岐命令のアドレス(以下「変更前分岐元アドレス」と呼ぶ。)を取得する。
The branch destination table generation device 140 includes a branch source acquisition device 146 and a pre-change branch source storage device 148 instead of the address correspondence storage device 143.
Based on the branch instruction before change extracted by the branch instruction extraction apparatus 130 using a processing device such as the CPU 911, the branch source acquisition apparatus 146 uses the address of the branch instruction before change in the target program 415 before change (hereinafter referred to as “before change”). Called "branch source address").

変更前分岐元記憶装置148は、磁気ディスク装置920などの記憶装置を用いて、変更前分岐元テーブルに、分岐元取得装置146が取得した変更前分岐元アドレスを記憶する。
なお、変更前分岐先テーブルと変更前分岐元テーブルとは、一つのテーブルであってもよい。その場合、分岐先であるか分岐元であるかを区別するフラグを設けることにより、両者を区別してもよい。
The pre-change branch source storage device 148 uses a storage device such as the magnetic disk device 920 to store the pre-change branch source address acquired by the branch source acquisition device 146 in the pre-change branch source table.
Note that the pre-change branch destination table and the pre-change branch source table may be one table. In that case, the two may be distinguished by providing a flag for distinguishing between the branch destination and the branch source.

分岐命令変更装置152は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415から、アセンブリコードの1行に相当する命令を、1命令ずつ取得する。
変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更前分岐元記憶装置148が記憶した変更前分岐元アドレスのなかに、分岐命令変更装置152が取得した命令のアドレス(変更前アドレス)と一致するアドレスがある場合、分岐先記憶領域決定装置141が算出した分岐先格納アドレスに基づいて、変更後分岐命令を生成する。
分岐命令変更装置152は、CPU911などの処理装置を用いて、変更分岐命令生成装置151が生成した変更後分岐命令で、もとの命令(変更前分岐命令)を置き換える。
The branch instruction change device 152 uses a processing device such as the CPU 911 to acquire instructions corresponding to one line of assembly code one by one from the target program 415 stored in the target program storage device 120.
Using the processing device such as the CPU 911, the changed branch instruction generation device 151 uses the address of the instruction acquired by the branch instruction change device 152 (before the change) in the branch source address before change stored in the branch source storage device 148 before change. If there is an address that matches the (address), a post-change branch instruction is generated based on the branch destination storage address calculated by the branch destination storage area determination device 141.
The branch instruction change device 152 replaces the original instruction (pre-change branch instruction) with the post-change branch instruction generated by the change branch instruction generation device 151 using a processing device such as the CPU 911.

分岐先決定装置144は、CPU911などの処理装置を用いて、変更前分岐先記憶装置142が記憶した変更前分岐先アドレスのなかに、変更前アドレスと一致するアドレスがある場合、変更前アドレスに対応する変更後アドレスを算出する。
分岐先記憶装置145は、CPU911などの処理装置を用いて、分岐先決定装置144が算出した変更後アドレスを、分岐先テーブル630のうち、分岐先記憶領域決定装置141が決定した記憶領域に対応する位置に、変更後分岐先アドレスとして記憶する。
The branch destination determination device 144 uses the processing device such as the CPU 911, and if the pre-change branch destination address stored in the pre-change branch destination storage device 142 has an address that matches the pre-change address, The corresponding changed address is calculated.
The branch destination storage device 145 uses the processing device such as the CPU 911 to correspond the changed address calculated by the branch destination determination device 144 to the storage area determined by the branch destination storage region determination device 141 in the branch destination table 630. Is stored as the post-change branch destination address.

図12及び図13は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、実施の形態1で説明したプログラム変換処理と共通する部分については、同一の符号を付す。
なお、変換済プログラム記憶装置180は、プログラム変換処理の開始前にあらかじめ、CPU911などの処理装置を用いて、変換済プログラム420を初期化して、空の変換済プログラム420を生成し、磁気ディスク装置920などの記憶装置を用いて、記憶しておく。
12 and 13 are flowcharts showing an example of the flow of a program conversion process in which the program conversion apparatus 100 according to this embodiment converts the target program 415 to generate the converted program 420.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion process demonstrated in Embodiment 1. FIG.
The converted program storage device 180 initializes the converted program 420 using a processing device such as the CPU 911 in advance before starting the program conversion processing, generates an empty converted program 420, and generates a magnetic disk device. The data is stored using a storage device such as 920.

逆アセンブル工程S812において、逆アセンブル装置131は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415を最初から順に逆アセンブルして、アセンブリコードを1行ずつ生成し、出力する。   In the disassembling step S812, the disassembling device 131 uses a processing device such as the CPU 911 to disassemble the target program 415 stored in the target program storage device 120 in order from the beginning, and generates assembly code line by line. Output.

分岐命令判定工程S814において、分岐命令判定装置132は、CPU911などの処理装置を用いて、逆アセンブル工程S812で逆アセンブル装置131が生成したアセンブリコードを入力し、分岐命令であるか否かを判定する。
分岐命令であると判定した場合、分岐先取得工程S815へ進む。
分岐命令でないと判定した場合、繰返し工程S822へ進む。
In the branch instruction determination step S814, the branch instruction determination device 132 uses the processing device such as the CPU 911 to input the assembly code generated by the disassembly device 131 in the disassembly step S812, and determines whether the instruction is a branch instruction. To do.
If it is determined that the instruction is a branch instruction, the process proceeds to a branch destination acquisition step S815.
If it is determined that the instruction is not a branch instruction, the process proceeds to the repetition step S822.

分岐先取得工程S815において、分岐先取得装置133は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令判定装置132が分岐命令であると判定したアセンブリコードに基づいて、変更前分岐先アドレスを取得し、出力する。   In the branch destination acquisition step S815, the branch destination acquisition device 133 uses a processing device such as the CPU 911, based on the assembly code determined by the branch instruction determination device 132 as a branch instruction in the branch instruction determination step S814, before the change. Get branch destination address and output.

分岐元取得工程S816において、分岐元取得装置146は、CPU911などの処理装置を用いて、分岐命令判定工程S814で分岐命令判定装置132が分岐命令であると判定したアセンブリコードのアドレスを取得して、変更前分岐元アドレスとする。分岐元取得装置146は、CPU911などの処理装置を用いて、取得した変更前分岐元アドレスを出力する。   In the branch source acquisition step S816, the branch source acquisition device 146 uses a processing device such as the CPU 911 to acquire the address of the assembly code determined by the branch instruction determination device 132 as a branch instruction in the branch instruction determination step S814. The pre-change branch source address. The branch source acquisition device 146 outputs the acquired pre-change branch source address using a processing device such as the CPU 911.

分岐先記憶領域決定工程S818において、分岐先記憶領域決定装置141は、CPU911などの処理装置を用いて、分岐先格納位置を決定し、分岐先格納アドレスを算出して、決定した分岐先格納位置と、算出した分岐先格納アドレスとを出力する。   In the branch destination storage area determination step S818, the branch destination storage area determination device 141 uses a processing device such as the CPU 911 to determine a branch destination storage position, calculate a branch destination storage address, and determine the determined branch destination storage position. And the calculated branch destination storage address are output.

変更前分岐先記憶工程S819において、変更前分岐先記憶装置142は、CPU911などの処理装置を用いて、分岐先取得工程S815で分岐先取得装置133が出力した変更前分岐先アドレスを入力する。変更前分岐先記憶装置142は、磁気ディスク装置920などの記憶装置を用いて、変更前分岐先テーブル610に、入力した変更前分岐先アドレスを記憶する。   In the pre-change branch destination storage step S819, the pre-change branch destination storage device 142 inputs the pre-change branch destination address output from the branch destination acquisition device 133 in the branch destination acquisition step S815 using a processing device such as the CPU 911. The pre-change branch destination storage device 142 stores the input pre-change branch destination address in the pre-change branch destination table 610 using a storage device such as the magnetic disk device 920.

変更前分岐元記憶工程S821において、変更前分岐元記憶装置148は、CPU911などの処理装置を用いて、分岐元取得工程S816で分岐元取得装置146が出力した変更前分岐元アドレスを入力する。変更前分岐元記憶装置148は、磁気ディスク装置920などの記憶装置を用いて、変更前分岐元テーブルに、入力した変更前分岐元アドレスを記憶する。   In the pre-change branch source storage step S821, the pre-change branch source storage device 148 inputs the pre-change branch source address output by the branch source acquisition device 146 in the branch source acquisition step S816 using a processing device such as the CPU 911. The pre-change branch source storage device 148 stores the input pre-change branch source address in the pre-change branch source table using a storage device such as the magnetic disk device 920.

繰返し工程S822において、逆アセンブル装置131は、CPU911などの処理装置を用いて、対象プログラム415の最後まで逆アセンブルしたか否かを判定する。
最後まで逆アセンブルしたと判定した場合、命令取得工程S831へ進む。
まだ逆アセンブルが終わっていないと判定した場合、逆アセンブル工程S812からの処理を繰り返す。
In the repetition step S822, the disassembly device 131 determines whether or not the disassembly has been completed to the end of the target program 415 using a processing device such as the CPU 911.
If it is determined that the disassembly is completed to the end, the process proceeds to the instruction acquisition step S831.
When it is determined that the disassembly is not finished yet, the processing from the disassembly step S812 is repeated.

命令取得工程S831において、分岐命令変更装置152は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415から、アセンブリコードの1行に相当する実行形式のコードを取得する。   In the instruction acquisition step S831, the branch instruction change device 152 uses a processing device such as the CPU 911 to acquire an execution format code corresponding to one line of assembly code from the target program 415 stored in the target program storage device 120. .

分岐先判定工程S832において、分岐先決定装置144は、CPU911などの処理装置を用いて、変更前分岐先記憶工程S819で変更前分岐先記憶装置142が記憶した変更前分岐先テーブル610のなかに、命令取得工程S831で分岐命令変更装置152が取得した実行形式のコードのアドレスと同じアドレスが記憶されているか否かを判定する。
同じアドレスが記憶されていると判定した場合、変更後分岐先決定工程S841へ進む。
同じアドレスが記憶されていないと判定した場合、分岐元判定工程S833へ進む。
なお、分岐先判定工程S832の実行速度を速くするため、分岐先決定装置144は、あらかじめ変更前分岐先テーブル610をソートして、変更前分岐先アドレス順に並べておいてもよい。
In the branch destination determination step S832, the branch destination determination device 144 uses the processing device such as the CPU 911 in the pre-change branch destination table 610 stored in the pre-change branch destination storage device 142 in the pre-change branch destination storage step S819. Then, it is determined whether or not the same address as the address of the code in the execution format acquired by the branch instruction change device 152 is stored in the instruction acquisition step S831.
If it is determined that the same address is stored, the process proceeds to the post-change branch destination determination step S841.
When it is determined that the same address is not stored, the process proceeds to the branch source determination step S833.
In order to increase the execution speed of the branch destination determination step S832, the branch destination determination device 144 may sort the pre-change branch destination table 610 in advance and arrange them in the order of the pre-change branch destination addresses.

変更後分岐先決定工程S841において、分岐先決定装置144は、CPU911などの処理装置を用いて、変更後分岐先アドレスを取得する。分岐先決定装置144は、例えば、あらかじめ、分岐命令変更装置152が出力した実行形式のコードのバイト数を数えておくことにより、次に分岐命令変更装置152が出力する実行形式のコードのアドレスを算出し、算出したアドレスを変更後分岐先アドレスとして取得する。分岐先決定装置144は、CPU911などの処理装置を用いて、取得した変更後分岐先アドレスを出力する。   In the post-change branch destination determination step S841, the branch destination determination device 144 acquires the post-change branch destination address using a processing device such as the CPU 911. The branch destination determination device 144 counts the number of bytes of the execution format code output from the branch instruction change device 152 in advance, for example, and thereby determines the address of the execution format code output next from the branch instruction change device 152. Calculate and obtain the calculated address as the post-change branch destination address. The branch destination determination device 144 outputs the acquired post-change branch destination address using a processing device such as the CPU 911.

変更後分岐先記憶工程S842において、分岐先記憶装置145は、CPU911などの処理装置を用いて、変更後分岐先決定工程S841で分岐先決定装置144が出力した変更後分岐先アドレスと、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納位置とを入力する。分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、入力した変更後分岐先アドレスを、分岐先テーブル630のうち、入力した分岐先格納位置に記憶する。   In the post-change branch destination storage step S842, the branch destination storage device 145 uses the processing device such as the CPU 911, the post-change branch destination address output from the branch destination determination device 144 in the post-change branch destination determination step S841, and the branch destination. The branch destination storage position output from the branch destination storage area determination device 141 in the storage area determination step S818 is input. The branch destination storage device 145 uses a storage device such as the magnetic disk device 920 to store the input post-change branch destination address in the input branch destination storage position in the branch destination table 630.

分岐元判定工程S833において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更前分岐元記憶工程S821で変更前分岐元記憶装置148が記憶した変更前分岐元テーブルのなかに、命令取得工程S831で分岐命令変更装置152が取得した実行形式のコードのアドレスと同じアドレスが記憶されているか否かを判定する。
同じアドレスが記憶されていると判定した場合、変更分岐命令生成工程S834へ進む。
同じアドレスが記憶されていないと判定した場合、命令出力工程S837へ進む。
In the branch source determination step S833, the changed branch instruction generation device 151 uses a processing device such as the CPU 911 in the pre-change branch source table stored in the pre-change branch source storage device 148 in the pre-change branch source storage step S821. Then, it is determined whether or not the same address as the address of the code in the execution format acquired by the branch instruction change device 152 is stored in the instruction acquisition step S831.
If it is determined that the same address is stored, the process advances to a modified branch instruction generation step S834.
If it is determined that the same address is not stored, the process proceeds to the instruction output step S837.

変更分岐命令生成工程S834において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、命令取得工程S831で分岐命令変更装置152が取得した実行形式のコードと、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納アドレスとを入力する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、入力した実行形式のコードと、分岐先格納アドレスとに基づいて、変更後分岐命令520を生成する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、生成した変更後分岐命令520を出力する。   In the modified branch instruction generation step S834, the modified branch instruction generation device 151 uses the processing device such as the CPU 911 and the execution format code acquired by the branch instruction change device 152 in the instruction acquisition step S831 and the branch destination storage area determination step. In S818, the branch destination storage address output by the branch destination storage area determination device 141 is input. The changed branch instruction generation device 151 uses a processing device such as the CPU 911 to generate the changed branch instruction 520 based on the input execution format code and the branch destination storage address. The changed branch instruction generation device 151 outputs the generated changed branch instruction 520 using a processing device such as the CPU 911.

変更分岐命令出力工程S835において、分岐命令変更装置152は、CPU911などの処理装置を用いて、変更分岐命令生成工程S834で変更分岐命令生成装置151が出力した変更後分岐命令520を入力し、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、変更後分岐命令520が追加された変換済プログラム420を記憶する。
その後、繰返し工程S839へ進む。
In the changed branch instruction output step S835, the branch instruction change device 152 inputs the converted branch instruction 520 output from the changed branch instruction generation device 151 in the changed branch instruction generation step S834 using a processing device such as the CPU 911, and converts it. Is added to the end of the converted program 420 stored in the stored program storage device 180. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the post-change branch instruction 520 is added.
Then, it progresses to repetition process S839.

命令出力工程S837において、分岐命令変更装置152は、CPU911などの処理装置を用いて、命令取得工程S831で取得した実行形式のコードを、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、実行形式のコードが追加された変換済プログラム420を記憶する。   In the instruction output step S837, the branch instruction change device 152 uses the processing device such as the CPU 911 to end the code of the execution format acquired in the instruction acquisition step S831 with the last of the converted program 420 stored in the converted program storage device 180. Add to and write. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the executable code is added.

繰返し工程S839において、分岐命令変更装置152は、CPU911などの処理装置を用いて、対象プログラム415から実行形式のコードを最後まで取得したか否かを判定する。
最後まで取得したと判定した場合、分岐先テーブル挿入工程S844へ進む。
まだ取得が終わっていないと判定した場合、命令取得工程S831からの処理を繰り返す。
In the repetition step S839, the branch instruction changing device 152 determines whether or not the execution format code has been acquired from the target program 415 to the end using a processing device such as the CPU 911.
If it is determined that it has been acquired to the end, the process proceeds to the branch destination table insertion step S844.
If it is determined that the acquisition has not been completed, the processing from the instruction acquisition step S831 is repeated.

分岐先テーブル挿入工程S844において、分岐先挿入装置161は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630を入力し、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先テーブル630が追加された変換済プログラム420を記憶する。   In the branch destination table insertion step S844, the branch destination insertion device 161 uses the processing device such as the CPU 911 to input the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842, and has been converted. It is additionally written at the end of the converted program 420 stored in the program storage device 180. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the branch destination table 630 has been added.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、分岐先テーブル挿入工程S844で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力する。変換済プログラム出力装置191は、CPU911などの処理装置を用いて、入力した変換済プログラム420を出力する。
その後、プログラム変換処理を終了する。
In the changed program output step S862, the converted program output device 191 inputs the converted program 420 stored in the converted program storage device 180 in the branch destination table insertion step S844 using a processing device such as the CPU 911. The converted program output device 191 outputs the input converted program 420 using a processing device such as the CPU 911.
Thereafter, the program conversion process is terminated.

図14は、この実施の形態における変更前分岐先記憶装置142が記憶する変更前分岐先テーブル610と、変更前分岐元記憶装置148が記憶する変更前分岐元テーブル670と、分岐先記憶装置145が記憶する分岐先テーブル630との一例を示す図である。
この例において、変更前分岐先テーブル610と変更前分岐元テーブル670とは一つのテーブルであり、アドレスタイプ612により分岐先か分岐元かを区別する。アドレスタイプ612が「S」なら、変更前分岐元アドレス671であることを示し、アドレスタイプ612が「D」なら、変更前分岐先アドレス611であることを示す。
分岐方向613は、分岐が前方分岐(分岐元アドレスより分岐先アドレスのほうが大きい)か後方分岐(分岐元アドレスより分岐先アドレスのほうが小さい)かを区別するものであり、「+」は前方分岐、「−]は後方分岐を示す。
分岐番号614は、分岐先記憶領域決定装置141が各分岐命令に付けた番号であり、分岐先テーブル630における変更後分岐先アドレス631の格納位置を示す。
この例は、逆アセンブル工程S812から繰返し工程S822までのループが終了した段階での状態を示している。このため、変更後分岐先アドレス631は、まだ算出されていない。
FIG. 14 shows a pre-change branch destination table 610 stored in the pre-change branch destination storage device 142, a pre-change branch source table 670 stored in the pre-change branch source storage device 148, and a branch destination storage device 145 in this embodiment. It is a figure which shows an example with the branch destination table 630 memorize | stored.
In this example, the pre-change branch destination table 610 and the pre-change branch source table 670 are one table, and the address type 612 distinguishes between the branch destination and the branch source. If the address type 612 is “S”, it indicates that it is the pre-change branch source address 671, and if the address type 612 is “D”, it indicates that it is the pre-change branch destination address 611.
The branch direction 613 distinguishes whether a branch is a forward branch (a branch destination address is larger than a branch source address) or a backward branch (a branch destination address is smaller than a branch source address), and “+” indicates a forward branch. "-" Indicates a backward branch.
The branch number 614 is a number assigned to each branch instruction by the branch destination storage area determination device 141 and indicates the storage position of the post-change branch destination address 631 in the branch destination table 630.
This example shows a state at the stage where the loop from the disassembly process S812 to the repetition process S822 is completed. For this reason, the post-change branch destination address 631 has not yet been calculated.

図15は、この実施の形態における変更前分岐先記憶装置142が記憶する変更前分岐先テーブル610と、変更前分岐元記憶装置148が記憶する変更前分岐元テーブル670と、分岐先記憶装置145が記憶する分岐先テーブル630との別の例を示す図である。
この例は、命令取得工程S831から繰返し工程S839までのループが終了した段階での状態を示している。なお、変更前分岐先テーブル610・変更前分岐元テーブル670は、分岐先決定装置144が、あらかじめ変更前分岐先テーブル610及び変更前分岐元テーブル670の昇順に並べ替えて、分岐先判定工程S832及び分岐元判定工程S833の処理を高速化している。
FIG. 15 shows a pre-change branch destination table 610 stored in the pre-change branch destination storage device 142, a pre-change branch source table 670 stored in the pre-change branch source storage device 148, and a branch destination storage device 145 in this embodiment. It is a figure which shows another example with the branch destination table 630 which memorize | stores.
This example shows a state at the stage where the loop from the instruction acquisition step S831 to the repetition step S839 is completed. The branch destination determination table 144 arranges the branch destination table 610 and the branch source table 670 before the change in advance in the ascending order of the branch destination table 610 and the branch source table 670 before the change, and the branch destination determination step S832. In addition, the processing speed of the branch source determination step S833 is increased.

この実施の形態における分岐先テーブル生成装置140は、上記処理装置(CPU911)を用いて、上記分岐命令抽出装置130が抽出した分岐命令の位置を表わす情報(変更前分岐元アドレス)を取得して、変更前分岐元情報とすることを特徴とする。
上記分岐命令変更装置152は、上記処理装置(CPU911)を用いて、分岐先テーブル生成装置140が取得した変更前分岐元情報が表わす位置の命令を、上記変更分岐命令生成装置151が生成した変更後分岐命令に置き換えることを特徴とする。
The branch destination table generation device 140 in this embodiment uses the processing device (CPU 911) to acquire information (branch source address before change) indicating the position of the branch instruction extracted by the branch instruction extraction device 130. The branch source information before change is used.
The branch instruction changing device 152 uses the processing device (CPU 911) to change the instruction generated by the changed branch instruction generating device 151 at the position indicated by the pre-change branch source information acquired by the branch destination table generating device 140. It is characterized by being replaced with a post-branch instruction.

この実施の形態におけるプログラム変換装置100によれば、分岐先テーブル生成装置140が取得した変更前分岐元情報が表わす位置の命令を、分岐命令変更装置152が変更後分岐命令に置き換えるので、変更前と変更後とのアドレスの対応を記憶しておく必要がなく、記憶装置の容量が小さくて済むという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the instruction at the position represented by the pre-change branch source information acquired by the branch destination table generation apparatus 140 is replaced with the post-change branch instruction by the branch instruction change apparatus 152. Thus, there is no need to store the correspondence between the addresses and the addresses after the change, and the capacity of the storage device can be reduced.

実施の形態4.
実施の形態4について、図16〜図20を用いて説明する。
Embodiment 4 FIG.
The fourth embodiment will be described with reference to FIGS.

図16は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態3で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 16 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 3, and description is abbreviate | omitted here.

プログラム変換装置100は、分岐先挿入装置161に代えて、分岐先読込領域挿入装置164を有し、更に、分岐先書出装置192、分岐先読込命令記憶装置162、分岐先読込命令挿入装置163を有する。   The program conversion apparatus 100 includes a branch destination read area insertion device 164 instead of the branch destination insertion device 161, and further includes a branch destination writing device 192, a branch destination read instruction storage device 162, and a branch destination read instruction insertion device 163. Have

分岐先読込領域挿入装置164は、CPU911などの処理装置を用いて、分岐命令変更装置152が分岐命令を変更した対象プログラム415に、分岐先テーブル生成装置140が生成した分岐先テーブル630を読み込むための領域(以下「分岐先読込領域」と呼ぶ。)を挿入する。
変換済プログラム記憶装置180は、分岐先読込領域挿入装置164が分岐先読込領域を挿入した対象プログラム415を、変換済プログラム420として記憶する。
分岐先テーブル630は、変換済プログラム420をコンピュータ300が実行する際に、分岐先読込領域に読み込まれる。
The branch destination read area insertion device 164 uses a processing device such as the CPU 911 to read the branch destination table 630 generated by the branch destination table generation device 140 into the target program 415 whose branch instruction change device 152 has changed the branch instruction. (Hereinafter referred to as “branch destination read area”).
The converted program storage device 180 stores the target program 415 into which the branch destination reading area inserting device 164 has inserted the branch destination reading area as the converted program 420.
The branch destination table 630 is read into the branch destination read area when the computer 300 executes the converted program 420.

分岐先書出装置192は、CPU911などの処理装置を用いて、分岐先テーブル生成装置140が生成した分岐先テーブルを書き出して、磁気ディスク装置920などの記憶装置にファイル(以下「分岐先ファイル」と呼ぶ。)を生成する。
分岐先書出装置192が生成した分岐先ファイルは、例えば、変換済プログラム420とともに配布される。コンピュータ300は、配布された分岐先ファイルを、磁気ディスク装置を用いて、変換済プログラム420と同じフォルダに記憶する。
The branch destination writing device 192 writes the branch destination table generated by the branch destination table generation device 140 using a processing device such as the CPU 911 and stores the file in a storage device such as the magnetic disk device 920 (hereinafter “branch destination file”). Is called).
The branch destination file generated by the branch destination writing device 192 is distributed together with the converted program 420, for example. The computer 300 stores the distributed branch destination file in the same folder as the converted program 420 using a magnetic disk device.

分岐先読込命令記憶装置162は、磁気ディスク装置920などの記憶装置を用いて、分岐先読込命令を記憶する。分岐先読込命令とは、分岐先書出装置192が生成した分岐先ファイルを読み込んで、分岐先テーブルを取得し、取得した分岐先テーブルを、分岐先読込領域挿入装置164が挿入した分岐先読込領域に読み込むことを指示する命令(群)のことである。
分岐先読込命令挿入装置163は、対象プログラム記憶装置120が記憶した対象プログラム415の先頭(コンピュータ300が変換済プログラム420を実行する際、一番最初に実行する命令の位置)に、分岐先読込命令記憶装置162が記憶した分岐先読込命令を挿入する。
The branch destination read instruction storage device 162 stores a branch destination read instruction using a storage device such as the magnetic disk device 920. The branch destination read instruction reads the branch destination file generated by the branch destination writing device 192, acquires the branch destination table, and reads the branch destination read by the branch destination read area insertion device 164 inserted. It is a command (group) instructing reading into the area.
The branch destination read instruction insertion device 163 reads the branch destination at the head of the target program 415 stored in the target program storage device 120 (the position of the first instruction executed when the computer 300 executes the converted program 420). The branch destination read instruction stored in the instruction storage device 162 is inserted.

図17は、この実施の形態における分岐先読込命令挿入装置163が挿入した分岐先読込命令を、コンピュータ300が実行した場合の動作の流れの一例を示すフローチャート図である。
分岐先読込命令は、コンピュータ300が変換済プログラム420を実行する際、一番最初に実行される。
FIG. 17 is a flowchart showing an example of the operation flow when the computer 300 executes the branch destination read instruction inserted by the branch destination read instruction insertion device 163 in this embodiment.
The branch destination read instruction is executed first when the computer 300 executes the converted program 420.

ファイルオープン工程S723において、コンピュータ300は、分岐先読込命令の指示により、分岐先ファイルを開く。分岐先ファイルが存在しない場合など、分岐先ファイルのオープンに失敗した場合、エラー表示工程S729へ進む。分岐先ファイルのオープンに成功した場合、テーブル読込工程S724へ進む。
テーブル読込工程S724において、コンピュータ300は、分岐先読込命令の指示により、ファイルオープン工程S723で開いた分岐先ファイルから、分岐先読込領域に分岐先テーブルを読み込む。
ファイルクローズ工程S725において、コンピュータ300は、分岐先読込命令の指示により、ファイルオープン工程S723で開いた分岐先ファイルを閉じる。
その後、次の命令(分岐先読込命令が挿入されなければ一番最初に実行されるはずだった命令)へ進む。
エラー表示工程S729において、コンピュータ300は、分岐先読込命令の指示により、分岐先ファイルの読込みに失敗したことを示すエラーメッセージを表示する。
その後、変換済プログラム420の実行を中止し、異常終了する。
In the file open step S723, the computer 300 opens the branch destination file according to the instruction of the branch destination read instruction. If the branch destination file fails to open, such as when the branch destination file does not exist, the process proceeds to error display step S729. If the branch destination file is successfully opened, the process proceeds to the table reading step S724.
In the table reading step S724, the computer 300 reads the branch destination table from the branch destination file opened in the file opening step S723 into the branch destination reading area according to the instruction of the branch destination reading instruction.
In the file closing step S725, the computer 300 closes the branch destination file opened in the file opening step S723 according to the instruction of the branch destination reading instruction.
Thereafter, the process proceeds to the next instruction (the instruction that would have been executed first if the branch destination read instruction was not inserted).
In the error display step S729, the computer 300 displays an error message indicating that the reading of the branch destination file has failed in response to the instruction of the branch destination reading instruction.
Thereafter, the execution of the converted program 420 is stopped and abnormally terminated.

図18は、この実施の形態における分岐先読込命令挿入装置163が挿入した分岐先読込命令を、コンピュータ300が実行した場合の動作の流れの別の例を示すフローチャート図である。
この例において、分岐先ファイルは、変換済プログラム420とともに配布されるのではなく、変換済プログラム420を実行する際、サーバ装置(以下「分岐先サーバ」と呼ぶ。)からダウンロードされる。
FIG. 18 is a flowchart showing another example of the flow of operations when the computer 300 executes a branch destination read instruction inserted by the branch destination read instruction insertion device 163 in this embodiment.
In this example, the branch destination file is not distributed with the converted program 420 but is downloaded from a server device (hereinafter referred to as “branch destination server”) when the converted program 420 is executed.

サーバ接続工程S721において、コンピュータ300は、分岐先読込命令の指示により、インターネットなどのネットワークを介して、分岐先サーバに接続する。接続に失敗した場合、エラー表示工程S729へ進む。接続に成功した場合、ダウンロード工程S722へ進む。
ダウンロード工程S722において、コンピュータ300は、分岐先読込命令の指示により、サーバ接続工程S721で接続した分岐先サーバから、分岐先ファイルをダウンロードする。なお、分岐先サーバが、コンピュータ300に分岐先ファイルをダウンロードする権利があるか否かを確認するため、ユーザID(Identifier)やパスワードなどを要求する場合、コンピュータ300は、キーボードなどの入力装置を用いて、ユーザIDなどを入力し、入力したユーザIDなどを分岐先サーバに対して送信してもよい。
ダウンロードに失敗した場合、エラー表示工程S729へ進む。ダウンロードに成功した場合、ファイルオープン工程S723へ進む。
ファイルオープン工程S723〜ファイルクローズ工程S25及びエラー表示工程S29の処理は、図17で説明したものと同様なので、ここでは説明を省略する。
ファイルクローズ工程S25の後、削除工程S726へ進む。
削除工程S726において、コンピュータ300は、分岐先読込命令の指示により、ダウンロード工程S722でダウンロードした分岐先ファイルを削除する。
その後、次の命令へ進む。
In the server connection step S721, the computer 300 connects to the branch destination server via a network such as the Internet according to the instruction of the branch destination read command. If the connection fails, the process proceeds to error display step S729. If the connection is successful, the process proceeds to the download step S722.
In the download step S722, the computer 300 downloads the branch destination file from the branch destination server connected in the server connection step S721 according to the instruction of the branch destination read instruction. When the branch destination server requests a user ID (Identifier), a password, or the like in order to confirm whether the computer 300 has the right to download the branch destination file, the computer 300 uses an input device such as a keyboard. The user ID may be input and the input user ID may be transmitted to the branch destination server.
If the download has failed, the process proceeds to error display step S729. If the download is successful, the process proceeds to the file opening process S723.
Since the processing of the file open process S723 to the file close process S25 and the error display process S29 is the same as that described in FIG. 17, the description thereof is omitted here.
After the file closing step S25, the process proceeds to the deleting step S726.
In the deletion step S726, the computer 300 deletes the branch destination file downloaded in the download step S722 according to the instruction of the branch destination read instruction.
Thereafter, the process proceeds to the next instruction.

図19は、この実施の形態におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す模式図である。
変換済プログラム420は、分岐先読込命令661と、変更後対象プログラム662と、分岐先読込領域663との3つの部分を有する。
分岐先読込命令661は、分岐先読込命令挿入装置163が挿入したものである。
変更後対象プログラム662は、分岐命令変更装置152が対象プログラム415の分岐命令を変更したものである。
分岐先読込領域663は、分岐先読込領域挿入装置164が挿入したものである。
FIG. 19 is a schematic diagram showing an example of the structure of the converted program 420 generated by the program conversion apparatus 100 according to this embodiment.
The converted program 420 has three parts: a branch destination read instruction 661, a post-change target program 662, and a branch destination read area 663.
The branch destination read instruction 661 is inserted by the branch destination read instruction insertion device 163.
The post-change target program 662 is obtained by changing the branch instruction of the target program 415 by the branch instruction changing device 152.
The branch destination read area 663 is inserted by the branch destination read area insertion device 164.

上述したように、コンピュータ300が分岐先読込命令661を実行することにより、分岐先テーブル630が分岐先読込領域663に読み込まれる。コンピュータ300が変更後対象プログラム662に含まれる変更後分岐命令を実行する際、読み込まれた分岐先テーブル630を参照して分岐先アドレスを算出し、算出した分岐先アドレスへ分岐する。   As described above, when the computer 300 executes the branch destination read instruction 661, the branch destination table 630 is read into the branch destination read area 663. When the computer 300 executes the post-change branch instruction included in the post-change target program 662, the branch destination address is calculated with reference to the read branch destination table 630, and the branch is made to the calculated branch destination address.

図20は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、実施の形態3で説明したプログラム変換処理と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 20 is a flowchart showing an example of the flow of program conversion processing in which the program conversion apparatus 100 in this embodiment converts the target program 415 to generate the converted program 420.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion process demonstrated in Embodiment 3, and description is abbreviate | omitted here.

分岐先読込命令挿入工程S805において、分岐先読込命令挿入装置163は、CPU911などの処理装置を用いて、分岐先読込命令記憶装置162が記憶した分岐先読込命令661を入力する。分岐先読込命令挿入装置163は、CPU911などの処理装置を用いて、入力した分岐先読込命令661を変換済プログラム420の先頭に書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先読込命令661が書き込まれた変換済プログラム420を記憶する。
その後、逆アセンブル工程S812へ進む。
In the branch destination read instruction insertion step S805, the branch destination read instruction insertion device 163 inputs the branch destination read instruction 661 stored in the branch destination read instruction storage device 162 using a processing device such as the CPU 911. The branch destination read instruction insertion device 163 writes the input branch destination read instruction 661 at the head of the converted program 420 using a processing device such as the CPU 911. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 in which the branch destination read instruction 661 is written.
Thereafter, the process proceeds to the disassembly step S812.

繰返し工程S839において、分岐命令判定装置132が変換前アセンブリコード640をすべて取得したと判定した場合、分岐先読込領域挿入工程S845へ進む。
分岐先読込領域挿入工程S845において、分岐先読込領域挿入装置164は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630を入力する。分岐先読込領域挿入装置164は、CPU911などの処理装置を用いて、入力した分岐先テーブル630を読み込むために必要な領域の大きさを算出する。分岐先読込領域挿入装置164は、CPU911などの処理装置を用いて、算出した大きさを有する分岐先読込領域663を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先読込領域663が追加された変換済プログラム420を記憶する。
If it is determined in the repetition step S839 that the branch instruction determination device 132 has acquired all the pre-conversion assembly code 640, the process proceeds to the branch destination read area insertion step S845.
In the branch destination read area insertion step S845, the branch destination read area insertion device 164 uses the processing device such as the CPU 911 to input the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842. . The branch destination read area insertion device 164 calculates the size of an area necessary for reading the input branch destination table 630 using a processing device such as the CPU 911. The branch destination read area inserting device 164 uses a processing device such as the CPU 911 to add the branch destination read area 663 having the calculated size to the end of the converted program 420 stored in the converted program storage device 180. Write. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the branch destination read area 663 is added.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、分岐先読込領域挿入工程S845で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力し、入力した変換済プログラム420を出力する。   In the changed program output step S862, the converted program output device 191 uses the processing device such as the CPU 911 to input the converted program 420 stored in the converted program storage device 180 in the branch destination read area insertion step S845, The input converted program 420 is output.

分岐先書出工程S863において、分岐先書出装置192は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630を入力する。分岐先書出装置192は、CPU911などの処理装置を用いて、入力した分岐先テーブル630を出力し、分岐先ファイルを生成する。
その後、プログラム変換処理を終了する。
In the branch destination writing step S863, the branch destination writing device 192 inputs the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842 using a processing device such as the CPU 911. The branch destination writing device 192 uses a processing device such as the CPU 911 to output the input branch destination table 630 and generate a branch destination file.
Thereafter, the program conversion process is terminated.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、更に、分岐先書出装置192と、分岐先読込命令挿入装置163とを有することを特徴とする。
上記分岐先書出装置192は、上記処理装置(CPU911)を用いて、上記分岐先テーブル生成装置140が生成した分岐先テーブル630を書き出して、分岐先ファイルを生成することを特徴とする。
上記分岐先読込命令挿入装置163は、上記処理装置(CPU911)を用いて、上記分岐先書出装置192が生成した分岐先ファイルを読み込んで上記分岐先テーブル630を取得することを指示する分岐先読込命令661を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
上記変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、上記分岐先算出命令として、上記分岐先読込命令挿入装置163が挿入した分岐先読込命令661を実行することにより取得される分岐先テーブル630を参照して分岐先を表わす情報を算出する命令を生成することを特徴とする。
The program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment further includes a branch destination writing apparatus 192 and a branch destination read instruction insertion apparatus 163.
The branch destination writing device 192 uses the processing device (CPU 911) to write the branch destination table 630 generated by the branch destination table generation device 140 and generate a branch destination file.
The branch destination read instruction insertion device 163 uses the processing device (CPU 911) to instruct to read the branch destination file generated by the branch destination writing device 192 and acquire the branch destination table 630. The read command 661 is inserted into the target program 415 input by the target program input device 110.
The modified branch instruction generation device 151 is obtained by executing the branch destination read instruction 661 inserted by the branch destination read instruction insertion device 163 as the branch destination calculation instruction using the processing device (CPU 911). An instruction for calculating information representing a branch destination is generated with reference to the branch destination table 630.

この実施の形態におけるプログラム変換装置100によれば、分岐先テーブルを参照して分岐する変更後分岐命令を含む変換済プログラム420と、分岐先テーブルを含む分岐先ファイルとが別ファイルなので、変換済プログラム420単体をリバースエンジニアリングしても変更後分岐命令の分岐先を知ることができず、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the converted program 420 including the post-change branch instruction for branching with reference to the branch destination table and the branch destination file including the branch destination table are separate files. Even if the program 420 alone is reverse-engineered, the branch destination of the post-change branch instruction cannot be known, and the reverse engineering becomes more difficult.

上記分岐先読込命令挿入装置163は、上記処理装置(CPU911)を用いて、上記分岐先読込命令661として、上記分岐先書出装置192が生成した分岐先ファイルを、インターネットを介してダウンロードすることを指示する命令を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。   The branch destination read instruction insertion device 163 uses the processor (CPU 911) to download the branch destination file generated by the branch destination writing device 192 as the branch destination read instruction 661 via the Internet. Is inserted into the target program 415 input by the target program input device 110.

この実施の形態におけるプログラム変換装置100によれば、コンピュータ300が変換済プログラム420を実行する際、分岐先ファイルをインターネットを介してダウンロードするので、分岐先ファイルを変換済プログラム420とともに配布する必要がない。また、分岐先ファイルのダウンロードの際、ユーザIDやパスワードなどで利用者を認証すれば、不正利用者が分岐先ファイルを入手できないので、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, when the computer 300 executes the converted program 420, the branch destination file is downloaded via the Internet. Therefore, it is necessary to distribute the branch destination file together with the converted program 420. Absent. In addition, if the user is authenticated with a user ID or a password when the branch destination file is downloaded, an illegal user cannot obtain the branch destination file, so that reverse engineering becomes more difficult.

なお、この実施の形態では、実施の形態3で説明したプログラム変換装置100を元にした変形例について説明したが、実施の形態1または実施の形態2で説明したプログラム変換装置100を元にして、この実施の形態で説明した変形と同様の変形をしてもよい。   In this embodiment, the modification based on the program conversion apparatus 100 described in the third embodiment has been described. However, based on the program conversion apparatus 100 described in the first or second embodiment. The same modifications as those described in this embodiment may be made.

以上説明したプログラム変換装置100(プログラム変換方式)は、
分岐先アドレスのテーブル(分岐先テーブル630)を実行ファイル(変換済プログラム420)とは別のファイル(分岐先ファイル)に書き出し、プログラム(変換済プログラム420)の実行開始時にファイル(分岐先ファイル)からデータ部に分岐先アドレスのテーブル(分岐先テーブル630)をロードするコード(分岐先読込命令661)が実行されるように実行プログラム(対象プログラム415)を変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
The branch destination address table (branch destination table 630) is written to a file (branch destination file) different from the execution file (converted program 420), and the file (branch destination file) at the start of execution of the program (converted program 420) The execution program (target program 415) is changed so that a code (branch destination read instruction 661) for loading a branch destination address table (branch destination table 630) into the data portion is executed.

以上説明したプログラム変換装置100(プログラム変換方式)は、
分岐先アドレスのテーブル(分岐先テーブル630)を実行ファイル(変換済プログラム420)とは別のファイル(分岐先ファイル)に書き出し、プログラム(変換済プログラム420)の実行開始時にネットワーク上に配置したファイル(分岐先ファイル)からデータ部に分岐先アドレスのテーブル(分岐先テーブル630)をロードするコード(分岐先読込命令661)が実行されるように実行プログラム(対象プログラム415)を変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
A file of branch destination addresses (branch destination table 630) written to a file (branch destination file) different from the execution file (converted program 420) and placed on the network at the start of program (converted program 420) execution The execution program (target program 415) is changed so that the code (branch destination read instruction 661) for loading the branch destination address table (branch destination table 630) from the (branch destination file) to the data portion is executed. And

実施の形態5.
実施の形態5について、図21〜図25を用いて説明する。
Embodiment 5 FIG.
The fifth embodiment will be described with reference to FIGS.

図21は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態3で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 21 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 3, and description is abbreviate | omitted here.

プログラム変換装置100は、更に、パスワード入力装置154、認証生成装置156、認証記憶装置157、認証取得命令生成装置158、認証取得命令挿入装置159、分岐先復元命令記憶装置165、分岐先復元命令挿入装置166を有する。
分岐先テーブル生成装置140は、更に、分岐先撹乱装置149を有する。
The program conversion apparatus 100 further includes a password input device 154, an authentication generation device 156, an authentication storage device 157, an authentication acquisition command generation device 158, an authentication acquisition command insertion device 159, a branch destination restoration command storage device 165, and a branch destination restoration command insertion. Device 166.
The branch destination table generation device 140 further includes a branch destination disturbance device 149.

パスワード入力装置154は、キーボード902などの入力装置を用いて、パスワードを入力する。パスワード入力装置154が入力するパスワードは、コンピュータ300が変換済プログラム420を実行する際、利用者に変換済プログラム420を実行する権限があるかを認証するために入力させるパスワードと同じものである。   The password input device 154 inputs a password using an input device such as a keyboard 902. The password input by the password input device 154 is the same as the password that is input to authenticate whether the user has the authority to execute the converted program 420 when the computer 300 executes the converted program 420.

認証生成装置156は、CPU911などの処理装置を用いて、パスワード入力装置154が入力したパスワードに基づいて、認証情報と検証情報とを生成する。
認証情報は、後述する分岐先撹乱装置149分岐先テーブルを撹乱するために用いられる情報である。コンピュータ300が変換済プログラム420を実行する際には、コンピュータ300が入力したパスワードから認証情報を生成し、生成した認証情報を用いて分岐先テーブルを復元する。コンピュータ300が入力したパスワードが正しくないと、正しくないパスワードから生成した認証情報も正しくないので、分岐先テーブルを正しく復元できない。このため、変換済プログラム420を実行することができない。
検証情報は、認証情報が正しいことを検証するための情報である。正しくない認証情報により復元された(正しくない)分岐先テーブルを用いて変換済プログラム420を実行すると、変換済プログラム420が暴走するなど予期せぬ動作をする可能性がある。そこで、分岐先テーブルを復元する前に、検証情報により認証情報が正しいことを検証し、変換済プログラム420が予期せぬ動作をすることを防ぐ。
The authentication generation device 156 generates authentication information and verification information based on the password input by the password input device 154 using a processing device such as the CPU 911.
The authentication information is information used to disturb a branch destination disturbing device 149 branch destination table described later. When the computer 300 executes the converted program 420, authentication information is generated from the password input by the computer 300, and the branch destination table is restored using the generated authentication information. If the password entered by the computer 300 is not correct, the authentication information generated from the incorrect password is also incorrect, so that the branch destination table cannot be restored correctly. For this reason, the converted program 420 cannot be executed.
The verification information is information for verifying that the authentication information is correct. If the converted program 420 is executed using a branch destination table restored (incorrect) with incorrect authentication information, the converted program 420 may run unexpectedly, such as runaway. Therefore, before restoring the branch destination table, the verification information verifies that the authentication information is correct, and prevents the converted program 420 from operating unexpectedly.

認証生成装置156は、パスワード入力装置154が入力したパスワードに基づいて、例えば、SHA(Secure Hash Algorithm)−2などのハッシュ関数を用いて、認証情報及び検証情報を生成する。認証情報及び検証情報は、パスワードから一意に生成される情報であり、逆に、認証情報や検証情報からパスワードを推測することが事実上不可能な情報である。また、認証情報と検証情報とは、互いに異なる情報であり、検証情報から認証情報を推測することが事実上不可能な情報である。
例えば、認証生成装置156は、パスワードに所定のデータを付加し、所定のデータを付加したパスワードをハッシュして、認証情報を生成する。また、認証生成装置156は、認証情報の生成に用いたデータとは異なるデータをパスワードに付加し、異なるデータを付加したパスワードをハッシュして、検証情報を生成する。まお、認証情報と検証情報とのうちいずれか一方は、データを付加せずパスワードをそのままハッシュしてもよい。
あるいは、認証生成装置156は、パスワードをハッシュして認証情報を生成し、生成した認証情報をハッシュして検証情報を生成してもよい。
しかし、それとは逆に、認証生成装置156が、パスワードをハッシュして検証情報を生成し、生成した検証情報をハッシュして認証情報を生成する方式は、検証情報から認証情報を推測できるので、好ましくない。
The authentication generation device 156 generates authentication information and verification information based on the password input by the password input device 154 using a hash function such as SHA (Secure Hash Algorithm) -2, for example. The authentication information and the verification information are information uniquely generated from the password, and conversely, it is practically impossible to guess the password from the authentication information and the verification information. Further, the authentication information and the verification information are different from each other, and it is virtually impossible to guess the authentication information from the verification information.
For example, the authentication generation device 156 adds predetermined data to the password and hashes the password with the predetermined data added thereto to generate authentication information. Also, the authentication generation device 156 generates verification information by adding data different from the data used for generating the authentication information to the password and hashing the password with the different data added. Any one of the authentication information and the verification information may be hashed as it is without adding data.
Alternatively, the authentication generation device 156 may generate authentication information by hashing the password, and may generate verification information by hashing the generated authentication information.
However, on the contrary, the method in which the authentication generation device 156 generates the verification information by hashing the password and generates the authentication information by hashing the generated verification information can infer the authentication information from the verification information. It is not preferable.

認証記憶装置157は、磁気ディスク装置920などの記憶装置を用いて、認証生成装置156が生成した認証情報及び検証情報を記憶する。   The authentication storage device 157 stores authentication information and verification information generated by the authentication generation device 156 using a storage device such as the magnetic disk device 920.

分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証記憶装置157が記憶した認証情報に基づいて、分岐先記憶装置145が記憶した分岐先テーブル630を撹乱する。分岐先テーブル630の撹乱とは、正しい認証情報がわからなければ、正しい分岐先テーブル630を復元できないようにすることであり、分岐先テーブル630の暗号化と呼んでもよい。
分岐先撹乱装置149が撹乱した分岐先テーブル630(以下、「撹乱分岐先テーブル」と呼ぶ。)は、分岐先記憶装置145が磁気ディスク装置920などの記憶装置を用いて再び記憶する。
The branch destination disturbance device 149 uses a processing device such as the CPU 911 to disturb the branch destination table 630 stored in the branch destination storage device 145 based on the authentication information stored in the authentication storage device 157. The disturbance of the branch destination table 630 means that the correct branch destination table 630 cannot be restored unless the correct authentication information is known, and may be called encryption of the branch destination table 630.
The branch destination table 630 disturbed by the branch destination disturbing device 149 (hereinafter referred to as “disturbed branch destination table”) is stored again by the branch destination storage device 145 using a storage device such as the magnetic disk device 920.

認証取得命令生成装置158は、CPU911などの処理装置を用いて、認証取得命令を生成する。認証取得命令とは、認証情報を取得することを指示する命令(群)のことである。認証取得命令生成装置158が生成する認証取得命令には、パスワード取得命令と、認証算出命令と、検証算出命令と、検証命令とが含まれる。パスワード取得命令とは、パスワードを取得することを指示する命令(群)のことである。認証算出命令とは、パスワード取得命令を実行することにより取得されるパスワードに基づいて認証情報を算出することを指示する命令(群)のことである。検証算出命令とは、パスワード取得命令を実行することにより取得されるパスワードに基づいて検証情報を算出することを指示する命令(群)のことである。検証命令とは、検証算出命令を実行することにより算出される検証情報が正しいか否かを検証することを指示する命令(群)のことであり、認証記憶装置157が記憶した検証情報に基づいて認証取得命令生成装置158が生成する。
認証取得命令挿入装置159は、CPU911などの処理装置を用いて、対象プログラム記憶装置120が記憶した対象プログラム415の先頭(コンピュータ300が変換済プログラム420を実行する際、一番最初に実行する命令の位置)に、認証取得命令生成装置158が生成した認証取得命令を挿入する。
The authentication acquisition command generation device 158 generates an authentication acquisition command using a processing device such as the CPU 911. The authentication acquisition command is a command (group) instructing to acquire authentication information. The authentication acquisition command generated by the authentication acquisition command generation device 158 includes a password acquisition command, an authentication calculation command, a verification calculation command, and a verification command. The password acquisition command is a command (group) instructing to acquire a password. The authentication calculation command is a command (group) that instructs to calculate authentication information based on a password acquired by executing a password acquisition command. The verification calculation command is a command (group) instructing to calculate verification information based on a password acquired by executing a password acquisition command. The verification command is a command (group) for instructing whether or not the verification information calculated by executing the verification calculation command is correct, and is based on the verification information stored in the authentication storage device 157. And the authentication acquisition command generation device 158 generates.
The authentication acquisition command insertion device 159 uses a processing device such as the CPU 911 to start the target program 415 stored in the target program storage device 120 (the first command executed when the computer 300 executes the converted program 420). ), The authentication acquisition command generated by the authentication acquisition command generation device 158 is inserted.

分岐先復元命令記憶装置165は、磁気ディスク装置920などの記憶装置を用いて、分岐先復元命令を記憶する。分岐先復元命令とは、認証取得命令挿入装置159が挿入した認証取得命令をコンピュータ300が実行することにより取得される認証情報に基づいて撹乱分岐先テーブルから分岐先テーブル630を復元することを指示する命令(群)のことである。
分岐先復元命令挿入装置166は、CPU911などの処理装置を用いて、認証取得命令挿入装置159が認証取得命令を挿入した対象プログラム415の認証取得命令の次(に実行する命令の位置)に、分岐先復元命令記憶装置165が記憶した分岐先復元命令を挿入する。
The branch destination restoration instruction storage device 165 stores a branch destination restoration instruction using a storage device such as the magnetic disk device 920. The branch destination restoration instruction is an instruction to restore the branch destination table 630 from the disturbance branch destination table based on the authentication information acquired by the computer 300 executing the authentication acquisition instruction inserted by the authentication acquisition instruction insertion device 159. It is an instruction (group) to do.
The branch destination restoration command insertion device 166 uses a processing device such as the CPU 911 to place the authentication acquisition command of the target program 415 into which the authentication acquisition command insertion device 159 has inserted the authentication acquisition command (the position of the command to be executed). The branch destination restoration instruction stored in the branch destination restoration instruction storage device 165 is inserted.

図22は、この実施の形態におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す図である。
変換済プログラム420は、認証取得命令664と、分岐先復元命令665と、変更後対象プログラム662と、撹乱分岐先テーブル666との4つの部分を有する。
認証取得命令664は、認証取得命令挿入装置159が挿入したものである。
分岐先復元命令665は、分岐先復元命令挿入装置166が挿入したものである。
変更後対象プログラム662は、対象プログラム記憶装置120が記憶した対象プログラム415の分岐命令を分岐命令変更装置152が変更後分岐命令に変更したものである。
撹乱分岐先テーブル666は、分岐先撹乱装置149が撹乱した撹乱分岐先テーブルを分岐先挿入装置161が挿入したものである。
この例において、分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証記憶装置157が記憶した認証情報に基づいて、0以上n未満(nは、分岐先テーブル630に含まれる変更後分岐先アドレス631の数)の整数kを算出し、算出した整数kに基づいて、分岐先テーブル630における1番目〜k番目の変更後分岐先アドレス631と、(k+1)番目〜n番目の変更後分岐先アドレス631とを交換することにより、分岐先テーブル630を撹乱し、撹乱分岐先テーブルを生成する。
FIG. 22 is a diagram showing an example of the structure of the converted program 420 generated by the program conversion apparatus 100 according to this embodiment.
The converted program 420 has four parts: an authentication acquisition instruction 664, a branch destination restoration instruction 665, a post-change target program 662, and a disturbance branch destination table 666.
The authentication acquisition command 664 is inserted by the authentication acquisition command insertion device 159.
The branch destination restoration instruction 665 is inserted by the branch destination restoration instruction insertion device 166.
The post-change target program 662 is obtained by changing the branch instruction of the target program 415 stored in the target program storage device 120 to the post-change branch instruction by the branch instruction change device 152.
The disturbance branch destination table 666 is obtained by inserting the disturbance branch destination table disturbed by the branch destination disturbance device 149 into the branch destination insertion device 161.
In this example, the branch destination disturbing device 149 uses a processing device such as the CPU 911 and is based on the authentication information stored in the authentication storage device 157 and is less than 0 and less than n (n is a post-change included in the branch destination table 630). The number k of the branch destination addresses 631) is calculated, and the first to kth post-change branch destination addresses 631 and the (k + 1) th to nth changes in the branch destination table 630 are calculated based on the calculated integer k. By exchanging with the post branch destination address 631, the branch destination table 630 is disturbed to generate a disturbed branch destination table.

図23は、この実施の形態における認証取得命令挿入装置159が挿入する認証取得命令664及び分岐先復元命令挿入装置166が挿入する分岐先復元命令665を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図である。
認証取得命令は、コンピュータ300が変換済プログラム420を実行する際、一番最初に実行される。また、分岐先復元命令は、コンピュータ300が変換済プログラム420を実行する際、認証取得命令の次に実行される。
FIG. 23 shows a flow of operations when the computer 300 executes the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159 and the branch destination restoration command 665 inserted by the branch destination restoration command insertion device 166 in this embodiment. It is a flowchart figure which shows an example.
The authentication acquisition command is executed first when the computer 300 executes the converted program 420. The branch destination restoration instruction is executed next to the authentication acquisition instruction when the computer 300 executes the converted program 420.

パスワード入力工程S731において、コンピュータ300は、認証取得命令664のうちパスワード取得命令の指示により、パスワードを入力する。
認証生成工程S733において、コンピュータ300は、認証取得命令664のうち認証算出命令の指示により、パスワード入力工程S731で入力したパスワードに基づいて、認証情報を生成する。
検証生成工程S734において、コンピュータ300は、認証取得命令664のうち検証算出命令の指示により、パスワード入力工程S731で入力したパスワードに基づいて、検証情報を生成する。
検証工程S735において、コンピュータ300は、認証取得命令664のうち検証命令の指示により、検証生成工程S734で生成した検証情報が、あらかじめ定められた検証情報と一致するか否かを検証する。あらかじめ定められた検証情報は、認証取得命令生成装置158が検証命令のなかに埋め込んだものである。検証情報が一致した場合、検証成功として、シフト算出工程S741へ進む。検証情報が不一致の場合、検証失敗として、エラー表示工程S739へ進む。
エラー表示工程S739において、コンピュータ300は、認証取得命令664の指示により、エラーメッセージを表示する。その後、変換済プログラム420の実行を中止し、異常終了する。
In the password input step S <b> 731, the computer 300 inputs a password according to the instruction of the password acquisition command in the authentication acquisition command 664.
In the authentication generation step S733, the computer 300 generates authentication information based on the password input in the password input step S731 according to the instruction of the authentication calculation command in the authentication acquisition command 664.
In the verification generation step S734, the computer 300 generates verification information based on the password input in the password input step S731 according to the verification calculation command in the authentication acquisition command 664.
In the verification step S735, the computer 300 verifies whether the verification information generated in the verification generation step S734 matches the predetermined verification information according to the instruction of the verification command in the authentication acquisition command 664. The predetermined verification information is embedded in the verification command by the authentication acquisition command generation device 158. If the verification information matches, the verification is successful and the process proceeds to the shift calculation step S741. If the verification information does not match, the process proceeds to error display step S739 as verification failure.
In the error display step S739, the computer 300 displays an error message according to the instruction of the authentication acquisition command 664. Thereafter, the execution of the converted program 420 is stopped and abnormally terminated.

シフト算出工程S741において、コンピュータ300は、分岐先復元命令665の指示により、認証生成工程S733で生成した認証情報に基づいて、整数kを算出する。例えば、コンピュータ300は、分岐先テーブルに含まれる変更後分岐先アドレス631の数nを取得し、認証情報を符号なし整数とみなして、取得した数nで割った余りを算出し、算出した余りを整数kとする。
シフト工程S742において、コンピュータ300は、分岐先復元命令665の指示により、撹乱分岐先テーブル666に含まれる変更後分岐先アドレス631のうち、1番目〜(n−k)番目の変更後分岐先アドレス631と、(n−k+1)番目〜n番目の変更後分岐先アドレス631とを入れ替えて、分岐先テーブル630を復元する。
その後、次の命令へ進む。
In the shift calculation step S741, the computer 300 calculates an integer k based on the authentication information generated in the authentication generation step S733 according to the instruction of the branch destination restoration instruction 665. For example, the computer 300 obtains the number n of the post-change branch destination addresses 631 included in the branch destination table, regards the authentication information as an unsigned integer, calculates the remainder divided by the obtained number n, and calculates the remainder Is an integer k.
In the shift step S742, the computer 300, in accordance with the instruction of the branch destination restoration instruction 665, includes the first to (n−k) -th post-change branch destination addresses among the post-change branch destination addresses 631 included in the disturbed branch destination table 666. 631 and the (n−k + 1) th to nth post-change branch destination addresses 631 are exchanged to restore the branch destination table 630.
Thereafter, the process proceeds to the next instruction.

変換済プログラム420を不正に利用しようとする者は、変換済プログラム420にパッチを当てるなどして、検証工程S735を回避し、検証情報が一致しなくてもシフト算出工程S741以降の処理をするよう、変換済プログラム420を改造する可能性がある。この改造により、正しいパスワードを知らなくても、コンピュータ300にシフト算出工程S741以降の処理をさせることができる。
しかし、パスワード入力工程S731で正しいパスワードが入力されていなければ、認証生成工程S733で生成した認証情報も正しくないので、分岐先テーブル630は正しく復元されない。したがって、変換済プログラム420に含まれる変更後分岐命令を実行する際、正しい分岐先へ分岐することができないので、不正利用者は、変換済プログラム420を利用することができない。
A person who intends to illegally use the converted program 420 avoids the verification step S735 by applying a patch to the converted program 420, and performs the processes after the shift calculation step S741 even if the verification information does not match. There is a possibility that the converted program 420 may be modified. By this modification, the computer 300 can be processed after the shift calculation step S741 without knowing the correct password.
However, if the correct password is not input in the password input step S731, the authentication information generated in the authentication generation step S733 is also incorrect, so that the branch destination table 630 is not correctly restored. Therefore, when executing the post-change branch instruction included in the converted program 420, it is not possible to branch to the correct branch destination, so that an unauthorized user cannot use the converted program 420.

また、検証情報は、検証命令のなかに埋め込まれているので、不正利用者は、変換済プログラム420を逆アセンブルするなどしてリバースエンジニアリングすることにより、検証情報を知ることができる。しかし、パスワードや認証情報は、変換済プログラム420のなかに埋め込まれていないので、不正利用者は、認証情報を知ることができない。したがって、不正利用者は、正しい分岐先テーブルを復元することができない。   Since the verification information is embedded in the verification command, an unauthorized user can know the verification information by reverse-engineering the converted program 420 by, for example, disassembling it. However, since the password and authentication information are not embedded in the converted program 420, an unauthorized user cannot know the authentication information. Therefore, an unauthorized user cannot restore a correct branch destination table.

図24は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、実施の形態3で説明したプログラム変換処理と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 24 is a flowchart showing an example of the flow of a program conversion process in which the program conversion apparatus 100 in this embodiment converts the target program 415 to generate the converted program 420.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion process demonstrated in Embodiment 3, and description is abbreviate | omitted here.

パスワード入力工程S801において、パスワード入力装置154は、キーボード902などの入力装置を用いて、パスワードを入力する。パスワード入力装置154は、CPU911などの処理装置を用いて、入力したパスワードを出力する。
認証生成工程S802において、認証生成装置156は、CPU911などの処理装置を用いて、パスワード入力工程S801でパスワード入力装置154が出力したパスワードを入力する。認証生成装置156は、CPU911などの処理装置を用いて、入力したパスワードに基づいて、認証情報と検証情報とを生成する。認証生成装置156は、CPU911などの処理装置を用いて、生成した認証情報と検証情報とを出力する。
認証記憶装置157は、CPU911などの処理装置を用いて、認証生成装置156が出力した認証情報と検証情報とを入力する。認証記憶装置157は、磁気ディスク装置920などの記憶装置を用いて、入力した認証情報と検証情報とを記憶する。
In the password input step S801, the password input device 154 inputs a password using an input device such as a keyboard 902. The password input device 154 outputs the input password using a processing device such as the CPU 911.
In the authentication generation step S802, the authentication generation device 156 inputs the password output by the password input device 154 in the password input step S801 using a processing device such as the CPU 911. The authentication generation device 156 uses a processing device such as the CPU 911 to generate authentication information and verification information based on the input password. The authentication generation device 156 outputs the generated authentication information and verification information using a processing device such as the CPU 911.
The authentication storage device 157 inputs the authentication information and the verification information output from the authentication generation device 156 using a processing device such as the CPU 911. The authentication storage device 157 stores the input authentication information and verification information using a storage device such as the magnetic disk device 920.

認証取得命令生成工程S803において、認証取得命令生成装置158は、CPU911などの処理装置を用いて、認証生成工程S802で認証記憶装置157が記憶した検証情報に基づいて、検証命令を生成する。認証取得命令生成装置158は、CPU911などの処理装置を用いて、生成した検証命令を含む認証取得命令を生成する。認証取得命令生成装置158は、CPU911などの処理装置を用いて、生成した認証取得命令を出力する。
認証取得命令挿入工程S804において、認証取得命令挿入装置159は、CPU911などの処理装置を用いて、認証取得命令生成工程S803で認証取得命令生成装置158が生成した認証取得命令を入力する。認証取得命令挿入装置159は、CPU911などの処理装置を用いて、入力した認証取得命令を、変換済プログラム420の先頭に書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、認証取得命令が書き込まれた変換済プログラム420を記憶する。
In the authentication acquisition command generation step S803, the authentication acquisition command generation device 158 uses a processing device such as the CPU 911 to generate a verification command based on the verification information stored in the authentication storage device 157 in the authentication generation step S802. The authentication acquisition command generation device 158 generates an authentication acquisition command including the generated verification command using a processing device such as the CPU 911. The authentication acquisition command generation device 158 outputs the generated authentication acquisition command using a processing device such as the CPU 911.
In the authentication acquisition command insertion step S804, the authentication acquisition command insertion device 159 inputs the authentication acquisition command generated by the authentication acquisition command generation device 158 in the authentication acquisition command generation step S803 using a processing device such as the CPU 911. The authentication acquisition command insertion device 159 writes the input authentication acquisition command at the top of the converted program 420 using a processing device such as the CPU 911. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 in which the authentication acquisition command is written.

分岐先復元命令挿入工程S806において、分岐先復元命令挿入装置166は、CPU911などの処理装置を用いて、分岐先復元命令記憶装置165が記憶した分岐先復元命令を入力する。分岐先復元命令挿入装置166は、CPU911などの処理装置を用いて、入力した分岐先復元命令を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、分岐先復元命令が追加された変換済プログラム420を記憶する。
その後、逆アセンブル工程S812へ進む。
In the branch destination restoration instruction insertion step S806, the branch destination restoration instruction insertion device 166 inputs the branch destination restoration instruction stored in the branch destination restoration instruction storage device 165 using a processing device such as the CPU 911. The branch destination restoration instruction insertion device 166 adds and writes the input branch destination restoration instruction to the end of the converted program 420 stored in the converted program storage device 180 by using a processing device such as the CPU 911. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the branch destination restoration instruction is added.
Thereafter, the process proceeds to the disassembly step S812.

繰返し工程S839において、分岐命令判定装置132が変換前アセンブリコード640をすべて取得したと判定した場合、分岐先テーブル撹乱工程S843へ進む。
分岐先テーブル撹乱工程S843において、分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630と、認証生成工程S802で認証記憶装置157が記憶した認証情報とを入力する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、入力した認証情報に基づいて、入力した分岐先テーブル630を撹乱して、撹乱分岐先テーブルを生成する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、生成した撹乱分岐先テーブルを出力する。
分岐先記憶装置145は、CPU911などの処理装置を用いて、分岐先撹乱装置149が出力した撹乱分岐先テーブルを入力する。分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、入力した撹乱分岐先テーブルを記憶する。
In the repetition step S839, when the branch instruction determination device 132 determines that all the pre-conversion assembly code 640 has been acquired, the process proceeds to the branch destination table disturbance step S843.
In the branch destination table disturbing step S843, the branch destination disturbing device 149 uses a processing device such as the CPU 911 and the branch destination table 630 stored in the branch destination storing device 145 in the post-change branch destination storing step S842, and the authentication generation step S802. The authentication information stored in the authentication storage device 157 is input. The branch destination disturbing device 149 uses a processing device such as the CPU 911 to disturb the input branch destination table 630 based on the input authentication information to generate a disturbed branch destination table. The branch destination disturbance device 149 outputs the generated disturbance branch destination table using a processing device such as the CPU 911.
The branch destination storage device 145 inputs the disturbance branch destination table output from the branch destination disturbance device 149 using a processing device such as the CPU 911. The branch destination storage device 145 stores the input disturbance branch destination table using a storage device such as the magnetic disk device 920.

分岐先テーブル挿入工程S844において、分岐先挿入装置161は、CPU911などの処理装置を用いて、分岐先テーブル撹乱工程S843で分岐先記憶装置145が記憶した撹乱分岐先テーブルを入力する。分岐先挿入装置161は、CPU911などの処理装置を用いて、入力した撹乱分岐先テーブルを、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、撹乱分岐先テーブルが追加された変換済プログラム420を記憶する。   In the branch destination table insertion step S844, the branch destination insertion device 161 inputs the disturbance branch destination table stored in the branch destination storage device 145 in the branch destination table disturbance step S843 by using a processing device such as the CPU 911. The branch destination insertion device 161 uses the processing device such as the CPU 911 to add and write the input disturbance branch destination table to the end of the converted program 420 stored in the converted program storage device 180. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the disturbance branch destination table is added.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、分岐先テーブル挿入工程S844で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力し、入力した変換済プログラム420を出力する。
その後、プログラム変換処理を終了する。
In the changed program output step S862, the converted program output device 191 uses the processing device such as the CPU 911 to input the converted program 420 stored in the converted program storage device 180 in the branch destination table insertion step S844. The converted program 420 is output.
Thereafter, the program conversion process is terminated.

図25は、この実施の形態における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の処理の詳細な流れの一例を示すフローチャート図である。   FIG. 25 is a flowchart showing an example of a detailed flow of processing in the branch destination table disturbing step S843 in which the branch destination disturbing device 149 disturbs the branch destination table 630 in this embodiment.

シフト算出工程S843aにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630を入力する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、入力した分岐先テーブル630に基づいて、分岐先テーブル630に含まれる変更後分岐先アドレス631の数nを算出する。
分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証生成工程S802で認証記憶装置157が記憶した認証情報を入力する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、入力した認証情報を符号なし整数とみなした数を、数nで割った余りを算出し、整数kとする。
In the shift calculation step S843a, the branch destination disturbing device 149 inputs the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842 using a processing device such as the CPU 911. The branch destination disturbing device 149 calculates the number n of post-change branch destination addresses 631 included in the branch destination table 630 based on the input branch destination table 630 using a processing device such as the CPU 911.
The branch destination disturbance device 149 uses the processing device such as the CPU 911 to input the authentication information stored in the authentication storage device 157 in the authentication generation step S802. The branch destination disturbing device 149 uses a processing device such as the CPU 911 to calculate the remainder obtained by dividing the number of input authentication information regarded as an unsigned integer by the number n, and set it as an integer k.

シフト工程S843bにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、シフト算出工程S843aで算出した整数kに基づいて、シフト算出工程S843aで入力した分岐先テーブル630のうち、1番目〜k番目の変更後分岐先アドレス631と、(k+1)番目〜n番目の変更後分岐先アドレス631とを入れ替えて、撹乱分岐先テーブルを生成する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、生成した撹乱分岐先テーブルを出力する。   In the shift step S843b, the branch destination disturbing device 149 uses the processing device such as the CPU 911, based on the integer k calculated in the shift calculation step S843a, of the branch destination table 630 input in the shift calculation step S843a. The disturbed branch destination table is generated by switching the ˜k-th post-change branch destination address 631 and the (k + 1) -th to n-th post-change branch destination address 631. The branch destination disturbance device 149 outputs the generated disturbance branch destination table using a processing device such as the CPU 911.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、更に、情報を記憶する記憶装置(磁気ディスク装置920)と、認証記憶装置157と、認証取得命令挿入装置159と、分岐先復元命令挿入装置166とを有することを特徴とする。
上記認証記憶装置157は、上記記憶装置(磁気ディスク装置920)を用いて、上記対象プログラムを実行する権限があるか否かを認証するための認証情報を記憶することを特徴とする。
上記分岐先テーブル生成装置140は、上記処理装置(CPU911)を用いて、上記分岐先取得装置133が取得した変更前分岐先情報(変更前分岐先アドレス)に基づいて、分岐先テーブル630を生成し、上記認証記憶装置157が記憶した認証情報に基づいて、生成した分岐先テーブル630を撹乱することを特徴とする。
上記認証取得命令挿入装置159は、上記処理装置(CPU911)を用いて、認証情報を取得することを指示する認証取得命令664を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
上記分岐先復元命令挿入装置166は、上記処理装置(CPU911)を用いて、上記認証取得命令挿入装置159が挿入した認証取得命令664を実行することにより取得される認証情報に基づいて上記分岐先テーブル630を復元することを指示する分岐先復元命令665を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
The program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment further includes a storage device (magnetic disk device 920) for storing information, an authentication storage device 157, an authentication acquisition command insertion device 159, And a branch destination restoration instruction insertion device 166.
The authentication storage device 157 uses the storage device (magnetic disk device 920) to store authentication information for authenticating whether or not there is an authority to execute the target program.
The branch destination table generation device 140 generates the branch destination table 630 based on the pre-change branch destination information (pre-change branch destination address) acquired by the branch destination acquisition device 133 using the processing device (CPU 911). The generated branch destination table 630 is disturbed based on the authentication information stored in the authentication storage device 157.
The authentication acquisition command insertion device 159 uses the processing device (CPU 911) to insert an authentication acquisition command 664 for instructing acquisition of authentication information into the target program 415 input by the target program input device 110. It is characterized by.
The branch destination restoration command insertion device 166 uses the processing device (CPU 911) to execute the branch destination based on the authentication information acquired by executing the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159. A branch destination restoration instruction 665 for instructing restoration of the table 630 is inserted into the target program 415 input by the target program input device 110.

この実施の形態におけるプログラム変換装置100によれば、認証記憶装置157が記憶した認証情報に基づいて、分岐先テーブル生成装置140(分岐先撹乱装置149)が分岐先テーブル630を撹乱するので、撹乱された分岐先テーブル(撹乱分岐先テーブル)を正しく復元するためには、認証記憶装置157が記憶した認証情報と同じ認証情報を取得する必要があり、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion device 100 in this embodiment, the branch destination table generation device 140 (branch destination disturbing device 149) disturbs the branch destination table 630 based on the authentication information stored in the authentication storage device 157. In order to correctly restore the branched branch destination table (disturbed branch destination table), it is necessary to acquire the same authentication information as the authentication information stored in the authentication storage device 157, and the reverse engineering becomes more difficult. .

この実施の形態における認証取得命令挿入装置159は、上記処理装置(CPU911)を用いて、上記認証取得命令664として、パスワードを入力することを指示するパスワード入力命令と、上記パスワード入力命令を実行することにより入力されるパスワードに基づいて認証情報を算出することを指示する認証算出命令とを、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。   The authentication acquisition command insertion device 159 in this embodiment uses the processing device (CPU 911) to execute, as the authentication acquisition command 664, a password input command for inputting a password and the password input command. An authentication calculation command for instructing to calculate authentication information based on the password input by the user is inserted into the target program 415 input by the target program input device 110.

この実施の形態におけるプログラム変換装置100によれば、コンピュータ300が変換済プログラム420を実行する際、パスワード入力命令を実行することにより入力されるパスワードに基づいて、認証算出命令を実行することにより認証情報を算出するので、正しいパスワードを入力しなければ正しい認証情報を算出できず、正しい分岐先テーブル630を復元できないので、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, when the computer 300 executes the converted program 420, the authentication is performed by executing the authentication calculation command based on the password input by executing the password input command. Since the information is calculated, the correct authentication information cannot be calculated unless the correct password is input, and the correct branch destination table 630 cannot be restored, so that the reverse engineering becomes more difficult.

この実施の形態における分岐先テーブル生成装置140(分岐先撹乱装置149)は、
上記処理装置(CPU911)を用いて、生成した分岐先テーブル630に含まれる変更後分岐先情報(変更後分岐先アドレス631)の数nを算出し、
上記処理装置(CPU911)を用いて、認証記憶装置157が記憶した認証情報に基づいて、0以上、算出した数n未満の整数kを算出し、
上記処理装置(CPU911)を用いて、算出した整数kに基づいて、分岐先テーブル630のうち、1番目からk番目までの変更後分岐先情報(変更後分岐先アドレス631)と、(k+1)番目からn番目までの変更後分岐先情報(変更後分岐先アドレス631)とを入れ替えることにより、
上記分岐先テーブル630を撹乱することを特徴とする。
The branch destination table generation device 140 (branch destination disturbance device 149) in this embodiment is
Using the processing device (CPU 911), the number n of post-change branch destination information (post-change branch destination address 631) included in the generated branch destination table 630 is calculated.
Using the processing device (CPU 911), based on the authentication information stored in the authentication storage device 157, an integer k of 0 or more and less than the calculated number n is calculated,
Based on the calculated integer k using the processing device (CPU 911), the first to kth post-change branch destination information (post-change branch destination address 631) in the branch destination table 630, and (k + 1) By replacing post-change branch destination information (post-change branch destination address 631) from the n-th to the n-th,
The branch destination table 630 is disturbed.

この実施の形態におけるプログラム変換装置100によれば、認証情報と変更後分岐先情報の数とから一意に生成される整数kに基づいて、分岐先テーブル630における変更後分岐先情報(変更後分岐先アドレス631)の順序を入れ替えることにより、分岐先テーブル630を撹乱するので、簡単な処理で分岐先テーブル630を復元でき、変換済プログラム420の本来の処理の開始までにかかる時間を短縮できるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the post-change branch destination information (the post-change branch) in the branch destination table 630 based on the integer k uniquely generated from the authentication information and the number of post-change branch destination information. Since the branch destination table 630 is disturbed by changing the order of the destination addresses 631), the branch destination table 630 can be restored by simple processing, and the time required for starting the original processing of the converted program 420 can be shortened. There is an effect.

なお、この実施の形態では、実施の形態3で説明したプログラム変換装置100を元にした変形例を説明したが、実施の形態1、実施の形態2または実施の形態4で説明したプログラム変換装置100を元にして、この実施の形態で説明した変形と同様の変形をしてもよい。   In this embodiment, the modification based on the program conversion apparatus 100 described in the third embodiment has been described. However, the program conversion apparatus described in the first, second, or fourth embodiment. Based on 100, a modification similar to the modification described in this embodiment may be made.

以上説明したプログラム変換装置100(プログラム変換方式)は、
パスワードから一意に生成される値(整数k)をテーブル(分岐先テーブル630)の先頭からのオフセットとして加えた位置から実際の分岐先アドレス(変更後分岐先情報)を格納し、テーブルの最後まで格納した後にはテーブルの先頭から実際の分岐先アドレス(変更後分岐先情報)を格納し、分岐元の命令(変更前分岐命令)をデータ部のテーブル(分岐先テーブル630)から取得する際にパスワードから一意に得られる値(整数k)をテーブル(分岐先テーブル630)の先頭からのオフセットとして加えた位置以降から取得するように命令を置き換えることを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
Stores the actual branch destination address (post-change branch destination information) from the position where a value (integer k) uniquely generated from the password is added as an offset from the head of the table (branch destination table 630) until the end of the table After the storage, the actual branch destination address (post-change branch destination information) is stored from the top of the table, and the branch source instruction (pre-change branch instruction) is obtained from the data section table (branch destination table 630). The instruction is replaced so that the value (integer k) uniquely obtained from the password is acquired from the position after adding the offset from the head of the table (branch destination table 630).

以上説明したプログラム変換装置100(プログラム変換方式)によれば、プログラム(対象プログラム415)内の分岐命令を、分岐命令のオペランドに分岐先のアドレスを直接指定せずに、データ部のアドレス(分岐先テーブル630)を使って分岐するよう書き換えるだけでなく、さらにパスワードから一意に決まる数だけ、分岐アドレステーブル(分岐先テーブル630)のエントリをずらしておき、実行時に正しいエントリになるように移動させることで、パスワードが分らなければ、プログラムを正しく実行させることができないようにすることができる。このことにより、プログラムの不正な利用を防止することができる。   According to the program conversion apparatus 100 (program conversion method) described above, the branch instruction in the program (target program 415) can be used without specifying the branch destination address directly in the operand of the branch instruction, In addition to rewriting to branch using the destination table 630), the entries in the branch address table (branch destination table 630) are further shifted by a number uniquely determined from the password, and moved so as to become a correct entry at the time of execution. Thus, if the password is not known, the program cannot be executed correctly. As a result, unauthorized use of the program can be prevented.

実施の形態6.
実施の形態6について、図26〜図28を用いて説明する。
この実施の形態では、分岐先テーブル630の撹乱方式の別の例について説明する。
Embodiment 6 FIG.
The sixth embodiment will be described with reference to FIGS.
In this embodiment, another example of the disturbance method of the branch destination table 630 will be described.

この実施の形態におけるプログラム変換装置100の機能ブロックの構成は、実施の形態5で説明したものと同様なので、ここでは説明を省略する。   Since the functional block configuration of the program conversion apparatus 100 in this embodiment is the same as that described in the fifth embodiment, description thereof is omitted here.

図26は、この実施の形態におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す図である。
なお、実施の形態5で説明した変換済プログラムと共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 26 is a diagram showing an example of the structure of the converted program 420 generated by the program conversion apparatus 100 according to this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the converted program demonstrated in Embodiment 5, and description is abbreviate | omitted here.

分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証記憶装置157が記憶した認証情報を乱数(擬似乱数)の初期値(シード、種)に設定する。
分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先アドレス631とビット長の等しい乱数を、分岐先テーブル630に含まれる変更後分岐先アドレス631それぞれに対応して、変更後分岐先アドレス631の数nと同じ数、生成する。
分岐先撹乱装置149は、CPU911などの処理装置を用いて、分岐先テーブル630に含まれる変更後分岐先アドレス631と、生成した乱数との排他的論理和を算出し、撹乱分岐先情報633とする。例えば、分岐先撹乱装置149は、分岐先テーブル630に含まれる1番目の変更後分岐先アドレス631と、生成した乱数のうち1番目の乱数との排他的論理和を算出して、1番目の撹乱分岐先情報633とし、分岐先テーブル630に含まれる2番目の変更後分岐先アドレス631と、生成した乱数のうち2番目の乱数との排他的論理和を算出して、2番目の撹乱分岐先情報633とする。分岐先撹乱装置149は、以下同様にして、n番目の撹乱分岐先情報633まで算出して、合計n個の撹乱分岐先情報633を算出する。
分岐先記憶装置145は、磁気ディスク装置920などの記憶装置を用いて、分岐先撹乱装置149が算出したn個の撹乱分岐先情報633を、撹乱分岐先テーブルとして記憶する。
The branch destination disturbing device 149 sets the authentication information stored in the authentication storage device 157 to an initial value (seed, seed) of a random number (pseudorandom number) using a processing device such as the CPU 911.
The branch destination disturbing device 149 uses a processing device such as the CPU 911 to change a random number having the same bit length as the post-change branch destination address 631 corresponding to each post-change branch destination address 631 included in the branch destination table 630. The same number as the number n of the subsequent branch destination addresses 631 is generated.
The branch destination disturbing device 149 calculates the exclusive OR of the changed branch destination address 631 included in the branch destination table 630 and the generated random number using a processing device such as the CPU 911, and the disturbing branch destination information 633. To do. For example, the branch destination disturbing device 149 calculates the exclusive OR of the first changed branch destination address 631 included in the branch destination table 630 and the first random number among the generated random numbers. As the disturbing branch destination information 633, an exclusive OR of the second changed branch destination address 631 included in the branch destination table 630 and the second random number among the generated random numbers is calculated, and the second disturbing branch is calculated. The destination information 633 is used. In the same manner, the branch destination disturbing device 149 calculates up to the n-th disturbing branch destination information 633, and calculates a total of n disturbing branch destination information 633.
The branch destination storage device 145 uses a storage device such as the magnetic disk device 920 to store the n pieces of disturbed branch destination information 633 calculated by the branch destination disturber 149 as a disturbed branch destination table.

分岐先撹乱装置149が生成する一連の乱数(乱数列)は、擬似乱数であるから、初期値が等しければ、分岐先撹乱装置149は同じ乱数列を生成し、初期値が異なれば、分岐先撹乱装置149は異なる乱数列を生成する。乱数の初期値は、認証記憶装置157が記憶した認証情報であるから、分岐先撹乱装置149は、認証記憶装置157が記憶した認証情報に基づいて、分岐先テーブル630を撹乱したことになる。   Since the series of random numbers (random number sequence) generated by the branch destination disturbing device 149 is a pseudo-random number, if the initial values are equal, the branch destination disturbing device 149 generates the same random number sequence, and if the initial values are different, the branch destination The disturbance device 149 generates a different random number sequence. Since the initial value of the random number is the authentication information stored in the authentication storage device 157, the branch destination disturbance device 149 has disturbed the branch destination table 630 based on the authentication information stored in the authentication storage device 157.

図27は、この実施の形態における認証取得命令挿入装置159が挿入する認証取得命令664及び分岐先復元命令挿入装置166が挿入する分岐先復元命令665を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図である。
なお、実施の形態5で説明した認証取得命令664及び分岐先復元命令665と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 27 shows the flow of operations when the computer 300 executes the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159 and the branch destination restoration command 665 inserted by the branch destination restoration command insertion device 166 in this embodiment. It is a flowchart figure which shows an example.
Note that portions common to the authentication acquisition command 664 and the branch destination restoration command 665 described in the fifth embodiment are denoted by the same reference numerals, and description thereof is omitted here.

検証工程S735において、検証に成功した場合、乱数初期値設定工程S751へ進む。
乱数初期値設定工程S751において、コンピュータ300は、分岐先復元命令の指示により、認証生成工程S733で生成した認証情報を乱数の初期値に設定する。
撹乱分岐先情報取得工程S752において、コンピュータ300は、分岐先復元命令の指示により、撹乱分岐先テーブル666の最初から順に、撹乱分岐先情報633を1つずつ取得する。
乱数生成工程S753において、コンピュータ300は、分岐先復元命令の指示により、乱数を生成する。
分岐先復元工程S754において、コンピュータ300は、分岐先復元命令の指示により、撹乱分岐先情報取得工程S752で取得した撹乱分岐先情報と、乱数生成工程S753で生成した乱数との排他的論理和を算出し、算出した排他的論理和を変更後分岐先アドレスとして、分岐先テーブル630を復元する。
繰返し工程S755において、コンピュータ300は、分岐先復元命令の指示により、撹乱分岐先情報取得工程S752で撹乱分岐先テーブル666からすべての撹乱分岐先情報633を取得したか否かを判定する。すべての撹乱分岐先情報633を取得したと判定した場合、次の命令へ進む。まだ取得していない撹乱分岐先情報633があると判定した場合、撹乱分岐先情報取得工程S752からの処理を繰り返す。
If the verification is successful in the verification step S735, the process proceeds to a random number initial value setting step S751.
In the random number initial value setting step S751, the computer 300 sets the authentication information generated in the authentication generation step S733 to the initial value of the random number according to the instruction of the branch destination restoration instruction.
In the disturbance branch destination information acquisition step S752, the computer 300 acquires the disturbance branch destination information 633 one by one in order from the beginning of the disturbance branch destination table 666 according to the instruction of the branch destination restoration instruction.
In the random number generation step S753, the computer 300 generates a random number according to the instruction of the branch destination restoration instruction.
In the branch destination restoration step S754, the computer 300 performs an exclusive OR operation between the disturbed branch destination information acquired in the disturbed branch destination information acquisition step S752 and the random number generated in the random number generation step S753 according to the instruction of the branch destination restoration instruction. The branch destination table 630 is restored using the calculated exclusive OR as the post-change branch destination address.
In the repetition step S755, the computer 300 determines whether or not all the disturbed branch destination information 633 has been acquired from the disturbed branch destination table 666 in the disturbed branch destination information acquisition step S752 according to the instruction of the branch destination restoration instruction. If it is determined that all disturbing branch destination information 633 has been acquired, the process proceeds to the next instruction. If it is determined that there is disturbing branch destination information 633 that has not yet been acquired, the processing from the disturbing branch destination information acquisition step S752 is repeated.

乱数生成工程S753でコンピュータ300が生成する乱数は、分岐先撹乱装置149が生成する乱数と同じ擬似乱数であり、初期値が等しければ、分岐先撹乱装置149が生成する乱数列と同じ乱数列が生成される。したがって、認証生成工程S733で生成する認証情報と、認証記憶装置157が記憶した認証情報とが等しければ、分岐先テーブル630を正しく復元することができる。   The random number generated by the computer 300 in the random number generation step S753 is the same pseudo-random number as the random number generated by the branch destination disturbing device 149. If the initial values are equal, the same random number sequence as the random number sequence generated by the branch destination disturbing device 149 is obtained. Generated. Therefore, if the authentication information generated in the authentication generation step S733 and the authentication information stored in the authentication storage device 157 are equal, the branch destination table 630 can be correctly restored.

図28は、この実施の形態における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の処理の詳細な流れの一例を示すフローチャート図である。   FIG. 28 is a flowchart showing an example of a detailed flow of processing in the branch destination table disturbing step S843 in which the branch destination disturbing device 149 disturbs the branch destination table 630 in this embodiment.

乱数初期値設定工程843dにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証記憶装置157が記憶した認証情報を入力する。分岐先撹乱装置149は、CPU911などの処理装置を用いて、入力した認証情報を、乱数の初期値に設定する。
分岐先取得工程S843eにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630の最初から順に、変更後分岐先アドレス631を1つずつ取得する。
乱数生成工程S843fにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、乱数を生成する。
排他的論理和算出工程S843gにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、分岐先取得工程S843eで取得した変更後分岐先アドレス631と、乱数生成工程S843fで生成した乱数との排他的論理和を算出する。
撹乱分岐先記憶工程S843iにおいて、分岐先記憶装置145は、CPU911などの処理装置を用いて、排他的論理和算出工程S843gで分岐先撹乱装置149が算出した排他的論理和を、撹乱分岐先情報633として、撹乱分岐先テーブルに記憶する。
繰返し工程S843jにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、分岐先取得工程S843eで分岐先テーブル630からすべての変更後分岐先アドレス631を取得したか否かを判定する。すべての変更後分岐先アドレス631を取得したと判定した場合、分岐先テーブル撹乱工程S843を終了する。まだ取得していない変更後分岐先アドレス631があると判定した場合、分岐先取得工程S843eからの処理を繰り返す。
In the random number initial value setting step 843d, the branch destination disturbance device 149 inputs the authentication information stored in the authentication storage device 157 using a processing device such as the CPU 911. The branch destination disturbance device 149 uses the processing device such as the CPU 911 to set the input authentication information as an initial value of a random number.
In the branch destination acquisition step S843e, the branch destination disturbing device 149 uses the processing device such as the CPU 911, after the change in order from the beginning of the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842. One branch destination address 631 is acquired.
In the random number generation step S843f, the branch destination disturbing device 149 generates a random number using a processing device such as the CPU 911.
In the exclusive OR calculation step S843g, the branch destination disturbing device 149 uses the processing device such as the CPU 911 and the changed branch destination address 631 acquired in the branch destination acquisition step S843e and the random number generated in the random number generation step S843f. The exclusive OR of is calculated.
In the disturbed branch destination storage step S843i, the branch destination storage device 145 uses the processing device such as the CPU 911 to output the exclusive OR calculated by the branch destination disturber 149 in the exclusive OR calculation step S843g to the disturbed branch destination information. As 633, it is stored in the disturbance branch destination table.
In the repetition step S843j, the branch destination disturbing device 149 determines whether or not all post-change branch destination addresses 631 have been acquired from the branch destination table 630 in the branch destination acquisition step S843e using a processing device such as the CPU 911. If it is determined that all post-change branch destination addresses 631 have been acquired, the branch destination table disturbing step S843 is terminated. If it is determined that there is a post-change branch destination address 631 that has not yet been acquired, the processing from the branch destination acquisition step S843e is repeated.

実施の形態5で説明した分岐先撹乱装置149は、変更後分岐先アドレス631の順序を入れ替えることにより、分岐先テーブル630を撹乱するので、認証情報を知らない第三者にとって、その分岐先へ分岐する分岐元の命令のアドレスはわからないが、どのアドレスから分岐先の処理が始まるかは知ることができる。したがって、分岐先の処理の内容を解析することにより、分岐元を解明することができる可能性がある。
これに対し、この実施の形態で説明した分岐先撹乱装置149は、変更後分岐先アドレス631と乱数との排他的論理和を算出することにより、分岐先テーブル630を撹乱するので、認証情報を知らなければ、どのアドレスから分岐先の処理が始まるかわからない。したがって、分岐先の処理の内容を解析することができない。
The branch destination disturbing device 149 described in the fifth embodiment disturbs the branch destination table 630 by changing the order of the branch destination address 631 after the change, so that a third party who does not know the authentication information is directed to the branch destination. Although the address of the branch source instruction to be branched is not known, it is possible to know from which address the branch destination process starts. Therefore, there is a possibility that the branch source can be clarified by analyzing the contents of the branch destination process.
On the other hand, the branch destination disturbing device 149 described in this embodiment disturbs the branch destination table 630 by calculating the exclusive OR of the post-change branch destination address 631 and the random number. If you don't know it, you don't know from which address the branch process starts. Therefore, the contents of the branch destination process cannot be analyzed.

この実施の形態における分岐先テーブル生成装置140(分岐先撹乱装置149)は、
上記処理装置(CPU911)を用いて、認証記憶装置157が記憶した認証情報を乱数の初期値に設定し、
上記処理装置(CPU911)を用いて、分岐先テーブル630に含まれる変更後分岐先情報(変更後分岐先アドレス631)それぞれに対応する乱数を生成し、
上記処理装置(CPU911)を用いて、分岐先テーブル630に含まれる変更後分岐先情報(変更後分岐先アドレス631)と、生成した乱数との排他的論理和をそれぞれ算出して、撹乱分岐先情報633とし、
上記処理装置(CPU911)を用いて、算出した撹乱分岐先情報633を分岐先テーブル(撹乱分岐先テーブル)とすることにより、
上記分岐先テーブル630を撹乱することを特徴とする。
The branch destination table generation device 140 (branch destination disturbance device 149) in this embodiment is
Using the processing device (CPU 911), the authentication information stored in the authentication storage device 157 is set to the initial value of the random number,
Using the processing device (CPU 911), generate random numbers corresponding to the post-change branch destination information (post-change branch destination address 631) included in the branch destination table 630,
Using the processing device (CPU 911), an exclusive OR of the post-change branch destination information (post-change branch destination address 631) included in the branch destination table 630 and the generated random number is calculated, respectively, and the disturbance branch destination Information 633,
By using the above processing device (CPU 911) as the calculated disturbance branch destination information 633 as a branch destination table (disturbance branch destination table),
The branch destination table 630 is disturbed.

この実施の形態におけるプログラム変換装置100によれば、分岐先テーブル生成装置140(分岐先撹乱装置149)が、変更後分岐先情報と乱数との排他的論理和を算出することにより、分岐先テーブル630を撹乱するので、認証情報を知らなければ、分岐元と分岐先との対応関係を知ることができないだけでなく、分岐先の処理の開始位置を知ることもできず、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the branch destination table generating apparatus 140 (branch destination disturbing apparatus 149) calculates the exclusive OR of the post-change branch destination information and the random number, so that the branch destination table is calculated. Since 630 is disturbed, if the authentication information is not known, it is not only possible to know the correspondence between the branch source and the branch destination, but it is also impossible to know the start position of the branch destination processing, making reverse engineering even more difficult Has the effect of becoming.

なお、この実施の形態では、実施の形態3で説明したプログラム変換装置100を元にした変形例について説明したが、実施の形態1、実施の形態2または実施の形態4で説明したプログラム変換装置100を元にして、この実施の形態で説明した変形と同様の変形をしてもよい。   In this embodiment, the modification based on the program conversion apparatus 100 described in the third embodiment has been described. However, the program conversion apparatus described in the first, second, or fourth embodiment. Based on 100, a modification similar to the modification described in this embodiment may be made.

以上説明したプログラム変換装置100(プログラム変換方式)は、
パスワードから一意に生成される乱数列と分岐先テーブル630の各変更後分岐先情報との排他的論理和を取った撹乱分岐先情報からなるテーブル(撹乱分岐先テーブル)を格納し、プログラム(変換済プログラム420)の実行開始時にパスワードから一意に生成される乱数列とテーブル(撹乱分岐先テーブル)の各撹乱分岐先情報との排他論理和を取ってデータ部に分岐先テーブル630を作成するコード(分岐先復元命令665)が実行されるように実行プログラム(対象プログラム415)を変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
Stores a table (disturbed branch destination table) consisting of disturbed branch destination information obtained by exclusive ORing a random number sequence uniquely generated from the password and each changed branch destination information of the branch destination table 630, and stores a program (conversion) Code for creating the branch destination table 630 in the data part by taking the exclusive OR of the random number sequence uniquely generated from the password at the start of execution of the completed program 420) and each disturbance branch destination information of the table (disturbance branch destination table) The execution program (target program 415) is changed so that (branch destination restoration instruction 665) is executed.

以上説明したプログラム変換装置100(プログラム変換方式)によれば、プログラム(対象プログラム415)内の分岐命令を、分岐命令のオペランドに分岐先のアドレスを直接指定せずに、データ部のアドレスを使って分岐するよう書き換えるだけでなく、さらにパスワードから一意に生成される乱数列と分岐先テーブル630の各変更後分岐先情報の排他的論理和を取った撹乱分岐先情報からなるテーブル(撹乱分岐先テーブル)を出力プログラム(変換済プログラム420)に格納するようにし、プログラム(変換済プログラム420)の実行開始時にパスワードから一意に生成される乱数列とテーブル(撹乱分岐先テーブル)の各撹乱分岐先情報との排他論理和を取って分岐先テーブル630を作成するコード(分岐先復元命令665)が実行されるように出力プログラム(変換済プログラム420)を変更することで、パスワードが分らなければ、プログラムを正しく実行させることができないようにすることができる。このことによりプログラムの不正な利用を防止することができる。   According to the program conversion apparatus 100 (program conversion method) described above, the branch instruction in the program (target program 415) is used by using the address of the data portion without directly specifying the branch destination address in the operand of the branch instruction. In addition to rewriting to branch, the table is composed of disturbed branch destination information obtained by exclusive ORing a random number sequence uniquely generated from the password and each branch destination information after the change in the branch destination table 630 (disturbed branch destination) Table) is stored in the output program (converted program 420), and a random number sequence uniquely generated from the password at the start of execution of the program (converted program 420) and each disturbance branch destination of the table (disturbance branch destination table) Code for creating the branch destination table 630 by taking the exclusive OR with the information (branch destination restoration instruction 6 5) By changing the output program (converted program 420) as it is executed, if know the password, can be prevented can be programmed correctly. This can prevent unauthorized use of the program.

実施の形態7.
実施の形態7について、図29〜図32を用いて説明する。
この実施の形態では、認証情報の取得方式の別の例及び分岐先テーブル630の撹乱方式の別の例について説明する。
Embodiment 7 FIG.
The seventh embodiment will be described with reference to FIGS.
In this embodiment, another example of the authentication information acquisition method and another example of the disturbance method of the branch destination table 630 will be described.

図29は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態3で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 29 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 3, and description is abbreviate | omitted here.

プログラム変換装置100は、更に、装置情報取得装置155、認証生成装置156、認証記憶装置157、認証取得命令生成装置158、認証取得命令挿入装置159を有する。
なお、認証生成装置156、認証記憶装置157、認証取得命令生成装置158、認証取得命令挿入装置159は、実施の形態5で説明したものと同様である。
The program conversion apparatus 100 further includes a device information acquisition device 155, an authentication generation device 156, an authentication storage device 157, an authentication acquisition command generation device 158, and an authentication acquisition command insertion device 159.
The authentication generation device 156, the authentication storage device 157, the authentication acquisition command generation device 158, and the authentication acquisition command insertion device 159 are the same as those described in the fifth embodiment.

装置情報取得装置155は、CPU911などの処理装置を用いて、変換済プログラム420の実行を許可するコンピュータ300が有する装置情報を取得する。装置情報とは、例えば、コンピュータ300が有するCPUのID情報や、LANカードのMAC(Media Access Control address)アドレス、コンピュータ300が携帯電話である場合には携帯電話番号など、そのコンピュータ300に固有の情報のことである。
例えば、利用者は、変換済プログラム420をコンピュータ300にインストールしようとする場合、最初にインストーラプログラムをダウンロードする。コンピュータ300がインストーラプログラムを実行すると、コンピュータ300は、インストーラプログラムの指示により、コンピュータ300の装置情報を取得し、インターネットなどのネットワークを介して、プログラム変換装置100に対して、取得した装置情報を送信する。装置情報取得装置155は、コンピュータ300が送信した装置情報を受信することにより、コンピュータ300の装置情報を取得する。その後、プログラム変換装置100が生成した変換済プログラム420がコンピュータ300に対して送信され、コンピュータ300は、インストーラプログラムの指示により、プログラム変換装置100が送信した変換済プログラム420を受信して、コンピュータ300にインストールする。
The device information acquisition device 155 acquires device information included in the computer 300 that permits execution of the converted program 420 using a processing device such as the CPU 911. The device information is specific to the computer 300, such as the CPU ID information of the computer 300, the MAC (Media Access Control address) address of the LAN card, and the mobile phone number if the computer 300 is a mobile phone. It is information.
For example, when the user intends to install the converted program 420 on the computer 300, the user first downloads the installer program. When the computer 300 executes the installer program, the computer 300 acquires device information of the computer 300 according to an instruction of the installer program, and transmits the acquired device information to the program conversion device 100 via a network such as the Internet. To do. The device information acquisition device 155 acquires device information of the computer 300 by receiving the device information transmitted by the computer 300. Thereafter, the converted program 420 generated by the program conversion apparatus 100 is transmitted to the computer 300, and the computer 300 receives the converted program 420 transmitted by the program conversion apparatus 100 according to an instruction of the installer program, and receives the computer 300. Install to.

認証生成装置156は、CPU911などの処理装置を用いて、装置情報取得装置155が取得した装置情報に基づいて、認証情報と検証情報とを生成する。   The authentication generation device 156 generates authentication information and verification information based on the device information acquired by the device information acquisition device 155 using a processing device such as the CPU 911.

すなわち、この実施の形態では、実施の形態5や実施の形態6におけるパスワードに代えて、コンピュータ300の装置情報に基づいて、認証情報(及び検証情報)を生成する。これにより、変換済プログラム420の実行を許可されたコンピュータ300だけが変換済プログラム420を実行できるようになる。
なお、プログラム変換装置100は、更に、実施の形態5で説明したパスワード入力装置154を有し、認証生成装置156は、CPU911などの処理装置を用いて、パスワード入力装置154が入力したパスワードと、装置情報取得装置155が取得した装置情報とに基づいて、認証情報(及び検証情報)を生成することとしてもよい。そうすれば、パスワードを知っている利用者だけが、変換済プログラム420の実行を許可されたコンピュータ300だけで、変換済プログラム420を実行できるようになる。
That is, in this embodiment, authentication information (and verification information) is generated based on the device information of the computer 300 instead of the password in the fifth and sixth embodiments. As a result, only the computer 300 that is permitted to execute the converted program 420 can execute the converted program 420.
The program conversion device 100 further includes the password input device 154 described in the fifth embodiment, and the authentication generation device 156 uses the processing device such as the CPU 911 and the password input by the password input device 154, and Authentication information (and verification information) may be generated based on the device information acquired by the device information acquisition device 155. Then, only the user who knows the password can execute the converted program 420 only by the computer 300 permitted to execute the converted program 420.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐先記憶領域決定装置141が算出した分岐先格納アドレスと、認証記憶装置157が記憶した認証情報とに基づいて、変更後分岐命令を生成する。   The changed branch instruction generation device 151 uses a processing device such as the CPU 911 to branch after the change based on the branch destination storage address calculated by the branch destination storage area determination device 141 and the authentication information stored in the authentication storage device 157. Generate instructions.

この実施の形態におけるプログラム変換装置100は、認証情報に基づいて分岐先テーブル630を撹乱する代わりに、分岐先テーブル630を参照する変更分岐命令を撹乱することにより、認証情報を知らなければ、変更分岐命令と、変更後分岐先アドレス631との対応がわからないようにする。   The program conversion apparatus 100 in this embodiment changes the branching table 630 by disturbing the branch instruction referring to the branching table 630 instead of disturbing the branching table 630 based on the authentication information. The correspondence between the branch instruction and the post-change branch destination address 631 is made unknown.

図30は、この実施の形態における認証取得命令挿入装置159が挿入する認証取得命令を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図である。
なお、実施の形態5で説明した認証取得命令664と共通する部分については、同一の符号を付し、ここでは説明を省略する。
認証取得命令は、装置情報取得命令、認証算出命令、検証算出命令、検証命令を含む。
FIG. 30 is a flowchart showing an example of an operation flow when the computer 300 executes the authentication acquisition command inserted by the authentication acquisition command insertion device 159 in this embodiment.
Note that portions common to the authentication acquisition command 664 described in the fifth embodiment are denoted by the same reference numerals, and description thereof is omitted here.
The authentication acquisition command includes a device information acquisition command, an authentication calculation command, a verification calculation command, and a verification command.

装置情報取得工程S732において、コンピュータ300は、装置情報取得命令の指示により、コンピュータ300が有する装置情報を取得する。
認証生成工程S733において、コンピュータ300は、認証算出命令の指示により、装置情報取得工程S732で取得した装置情報に基づいて、認証情報を生成する。
検証生成工程S734において、コンピュータ300は、検証算出命令の指示により、装置情報取得工程S732で取得した装置情報に基づいて、検証情報を生成する。
検証工程S735において、コンピュータ300は、検証命令の指示により、検証生成工程S734で生成した検証情報が、あらかじめ定められた検証情報と一致するか否かを検証する。検証情報が一致した場合、検証成功として、次の命令へ進む。検証情報が不一致の場合、検証失敗として、エラー表示工程S739へ進む。
In the device information acquisition step S732, the computer 300 acquires the device information that the computer 300 has in response to an instruction of the device information acquisition command.
In the authentication generation step S733, the computer 300 generates authentication information based on the device information acquired in the device information acquisition step S732 according to an instruction of the authentication calculation command.
In the verification generation step S734, the computer 300 generates verification information based on the device information acquired in the device information acquisition step S732 according to the instruction of the verification calculation instruction.
In the verification step S735, the computer 300 verifies whether the verification information generated in the verification generation step S734 matches the predetermined verification information according to the instruction of the verification command. If the verification information matches, the verification is successful and the process proceeds to the next command. If the verification information does not match, the process proceeds to error display step S739 as verification failure.

図31は、この実施の形態における変更分岐命令生成装置151が生成する変更後分岐命令520の一例を示す図である。
変更分岐命令生成装置151は、磁気ディスク装置920などの記憶装置を用いて、雛形540を記憶している。
雛形540は、変更分岐命令生成装置151が生成する変更後分岐命令520のうち、変化する部分を空欄としたものである。雛形540は、3つの空欄541,542,543を有する。
空欄541は、変更後オペコードを入れるべき空欄であり、変更分岐命令生成装置151は、変更前分岐命令の種類や分岐条件に基づいて、同じ条件で分岐する分岐命令のオペコード(変更後オペコード)を生成し、空欄541に挿入する。
空欄542は、認証生成工程S733で生成する認証情報を格納するアドレス(以下「認証情報格納アドレス」と呼ぶ。)を入れるべき空欄であり、変更分岐命令生成装置151は、対象プログラム415に基づいて認証情報格納アドレスを決定し、空欄542に挿入する。
空欄543は、撹乱格納アドレスを入れるべき空欄である。撹乱格納アドレスとは、認証情報に基づいて分岐先格納アドレスを撹乱したものである。例えば、撹乱格納アドレスは、認証情報と分岐先格納アドレスとの排他的論理和である。変更分岐命令生成装置151は、認証記憶装置157が記憶した認証情報に基づいて、分岐先記憶領域決定装置141が算出した分岐先格納アドレスを撹乱して、撹乱格納アドレスを算出し、空欄543に挿入する。
変更分岐命令生成装置151は、CPU911などの処理装置を用いて、雛形540の空欄541〜543をすべて埋めることにより、変更後分岐命令520を生成する。
FIG. 31 is a diagram illustrating an example of the post-change branch instruction 520 generated by the change branch instruction generation device 151 according to this embodiment.
The modified branch instruction generation device 151 stores the template 540 using a storage device such as the magnetic disk device 920.
In the template 540, the changed part of the post-change branch instruction 520 generated by the changed branch instruction generation device 151 is left blank. The template 540 has three blanks 541, 542, and 543.
A blank field 541 is a blank field in which the changed operation code is to be entered, and the modified branch instruction generation device 151 selects an operation code (a modified operation code) of a branch instruction that branches under the same condition based on the type of branch instruction before the change and the branch condition. It is generated and inserted into the blank 541.
A blank 542 is a blank in which an address for storing the authentication information generated in the authentication generation step S733 (hereinafter referred to as “authentication information storage address”) is to be entered, and the change branch instruction generation device 151 is based on the target program 415. The authentication information storage address is determined and inserted into the blank field 542.
A blank 543 is a blank in which a disturbance storage address is to be entered. The disturbance storage address is a disturbance of the branch destination storage address based on the authentication information. For example, the disturbance storage address is an exclusive OR of the authentication information and the branch destination storage address. The change branch instruction generation device 151 disturbs the branch destination storage address calculated by the branch destination storage area determination device 141 based on the authentication information stored in the authentication storage device 157, calculates the disturbance storage address, and stores the blank storage address 543. insert.
The changed branch instruction generation device 151 generates a changed branch instruction 520 by filling all the blanks 541 to 543 of the template 540 using a processing device such as the CPU 911.

変更分岐命令生成装置151が生成する変更後分岐命令520を、コンピュータ300が実行する際の動作の流れは、以下の通りである。   The operation flow when the computer 300 executes the post-change branch instruction 520 generated by the change branch instruction generation device 151 is as follows.

分岐工程S711において、コンピュータ300は、変更後分岐命令の指示により、変更前分岐命令の分岐条件と同じ条件にしたがって、分岐するか否かを判定する。分岐すると判定した場合、認証情報取得工程S713へ進む。分岐しないと判定した場合、無条件分岐工程S712へ進む。
無条件分岐工程S712において、コンピュータ300は、変更後分岐命令の指示により、次の命令へ無条件分岐する。
認証情報取得工程S713において、コンピュータ300は、変更後分岐命令の指示により、認証情報格納アドレスから認証情報を取得する。
分岐先格納アドレス算出工程S714において、コンピュータ300は、変更後分岐命令の指示により、変更後分岐命令に埋め込まれた撹乱格納アドレスと、認証情報取得工程S713で取得した認証情報との排他的論理和を算出して、分岐先格納アドレスとする。
分岐先算出工程S718において、コンピュータ300は、変更後分岐命令の指示により、分岐先格納アドレス算出工程S714で算出した分岐先格納アドレスから、分岐先絶対アドレスを取得する。
間接分岐工程S719において、コンピュータ300は、変更後分岐命令の指示により、分岐先算出工程S718で取得した分岐先絶対アドレスへ無条件分岐する。
In the branch step S711, the computer 300 determines whether or not to branch according to the same condition as the branch condition of the branch instruction before the change according to the instruction of the branch instruction after the change. When it determines with branching, it progresses to authentication information acquisition process S713. If it is determined not to branch, the process proceeds to the unconditional branching step S712.
In the unconditional branch step S712, the computer 300 branches unconditionally to the next instruction in accordance with the instruction of the changed branch instruction.
In the authentication information acquisition step S713, the computer 300 acquires the authentication information from the authentication information storage address according to the instruction of the post-change branch instruction.
In the branch destination storage address calculation step S714, the computer 300 performs an exclusive OR operation between the disturbance storage address embedded in the post-change branch instruction and the authentication information acquired in the authentication information acquisition step S713 according to the instruction of the post-change branch instruction. Is calculated as a branch destination storage address.
In the branch destination calculation step S718, the computer 300 acquires the branch destination absolute address from the branch destination storage address calculated in the branch destination storage address calculation step S714 according to the instruction of the post-change branch instruction.
In the indirect branch step S719, the computer 300 branches unconditionally to the branch destination absolute address acquired in the branch destination calculation step S718 according to the instruction of the changed branch instruction.

図32は、この実施の形態における変更分岐命令生成装置151が、変更後分岐命令を生成する変更分岐命令生成工程S834の詳細な処理の流れの一例を示すフローチャート図である。   FIG. 32 is a flowchart showing an example of a detailed processing flow of the modified branch instruction generation step S834 in which the modified branch instruction generation device 151 in this embodiment generates a post-change branch instruction.

雛形取得工程S834aにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、磁気ディスク装置920などの記憶装置が記憶した雛形540を取得する。   In the template acquisition step S834a, the changed branch instruction generation device 151 acquires the template 540 stored in the storage device such as the magnetic disk device 920 using a processing device such as the CPU 911.

変更後オペコード生成工程S834bにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、命令取得工程S831で分岐命令変更装置152が取得したコードを入力する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、入力したコードが表わす分岐命令(変更前分岐命令)と同じ条件で分岐する分岐命令のオペコードを生成して、変更後オペコードとする。
変更後オペコード挿入工程S834cにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更後オペコード生成工程S834bで生成した変更後オペコードを、雛形取得工程S834aで取得した雛形540の空欄541に挿入する。
In the post-change operation code generation step S834b, the changed branch instruction generation device 151 inputs the code acquired by the branch instruction change device 152 in the instruction acquisition step S831 using a processing device such as the CPU 911. The change branch instruction generation device 151 uses a processing device such as the CPU 911 to generate an operation code of a branch instruction that branches under the same condition as the branch instruction (pre-change branch instruction) represented by the input code, and sets it as the post-change operation code. .
In the post-change operation code insertion step S834c, the change branch instruction generation device 151 uses the processing device such as the CPU 911 to store the post-change operation code generated in the post-change operation code generation step S834b in the blank of the template 540 acquired in the template acquisition step S834a. 541 is inserted.

認証情報格納アドレス取得工程S834dにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、認証情報格納アドレスを取得する。
認証情報格納アドレス挿入工程S834eにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、認証情報格納アドレス取得工程S834dで取得した認証情報格納アドレスを、雛形取得工程S834aで取得した雛形540の空欄542に挿入する。
In the authentication information storage address acquisition step S834d, the changed branch instruction generation device 151 acquires the authentication information storage address using a processing device such as the CPU 911.
In the authentication information storage address insertion step S834e, the change branch instruction generation device 151 uses the processing device such as the CPU 911 to acquire the authentication information storage address acquired in the authentication information storage address acquisition step S834d in the template acquisition step S834a. It inserts in the blank 542 of 540.

認証情報取得工程S834fにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、認証生成工程S802で認証記憶装置157が記憶した認証情報を入力する。
分岐先格納アドレス取得工程S834gにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐先記憶領域決定工程S818で分岐先記憶領域決定装置141が出力した分岐先格納アドレスを入力する。
撹乱格納アドレス算出工程S834hにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、認証情報取得工程S834fで入力した認証情報と、分岐先格納アドレス取得工程S834gで入力した分岐先格納アドレスとの排他的論理和を算出して、撹乱格納アドレスとする。
撹乱格納アドレス挿入工程S834iにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、撹乱格納アドレス算出工程S834hで算出した撹乱格納アドレスを、雛形取得工程S834aで取得した雛形540の空欄543に挿入する。
変更後分岐命令出力工程S834lにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、空欄を埋められた雛形540を、変更後分岐命令520として出力する。
In the authentication information acquisition step S834f, the change branch instruction generation device 151 uses the processing device such as the CPU 911 to input the authentication information stored in the authentication storage device 157 in the authentication generation step S802.
In the branch destination storage address acquisition step S834g, the changed branch instruction generation device 151 inputs the branch destination storage address output by the branch destination storage area determination device 141 in the branch destination storage area determination step S818 using a processing device such as the CPU 911. To do.
In the disturbance storage address calculation step S834h, the changed branch instruction generation device 151 uses a processing device such as the CPU 911 to store the authentication information input in the authentication information acquisition step S834f and the branch destination storage input in the branch destination storage address acquisition step S834g. An exclusive OR with the address is calculated and used as the disturbance storage address.
In the disturbed storage address insertion step S834i, the changed branch instruction generation device 151 uses the processing device such as the CPU 911 to replace the disturbed storage address calculated in the disturbed storage address calculation step S834h with the blank of the template 540 acquired in the template acquisition step S834a. 543 is inserted.
In the post-change branch instruction output step S8341, the change branch instruction generation device 151 outputs the template 540 filled with blanks as the post-change branch instruction 520 using a processing device such as the CPU 911.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、更に、情報を記憶する記憶装置(磁気ディスク装置920)と、認証記憶装置157と、認証取得命令挿入装置159とを有することを特徴とする。
上記認証記憶装置157は、上記記憶装置(磁気ディスク装置920)を用いて、上記対象プログラム415を実行する権限があるか否かを認証するための認証情報を記憶することを特徴とする。
上記認証取得命令挿入装置159は、上記処理装置(CPU911)を用いて、認証情報を取得することを指示する認証取得命令664を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
上記変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、上記分岐先算出命令として、上記認証取得命令挿入装置159が挿入した認証取得命令664を実行することにより取得される認証情報と、上記分岐先テーブル630とを参照して分岐先を表わす情報(変更後分岐先アドレス)を算出する命令を、上記認証記憶装置157が記憶した認証情報に基づいて生成することを特徴とする。
The program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment further includes a storage device (magnetic disk device 920) for storing information, an authentication storage device 157, and an authentication acquisition command insertion device 159. It is characterized by having.
The authentication storage device 157 stores authentication information for authenticating whether or not there is an authority to execute the target program 415 using the storage device (magnetic disk device 920).
The authentication acquisition command insertion device 159 uses the processing device (CPU 911) to insert an authentication acquisition command 664 for instructing acquisition of authentication information into the target program 415 input by the target program input device 110. It is characterized by.
The change branch instruction generation device 151 uses the processing device (CPU 911) to obtain authentication information acquired by executing the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159 as the branch destination calculation instruction. And the branch destination table 630 is referred to, and an instruction for calculating information representing the branch destination (post-change branch destination address) is generated based on the authentication information stored in the authentication storage device 157. .

この実施の形態におけるプログラム変換装置100によれば、変更後分岐命令の実行時に、認証情報に基づいて変更後分岐先情報を算出するので、認証情報がわからなければ、分岐先がわからず、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the post-change branch destination information is calculated based on the authentication information when the post-change branch instruction is executed. Therefore, if the authentication information is not known, the branch destination is not known, and reverse The effect is that engineering becomes more difficult.

この実施の形態における変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、上記分岐先算出命令として、上記認証取得命令挿入装置159が挿入した認証取得命令664を実行することにより取得される認証情報に基づいて上記分岐先テーブル630における分岐先を表わす情報の位置(分岐先格納アドレス)を算出することを指示する分岐先格納位置算出命令と、上記分岐先格納位置算出命令を実行することにより算出される位置に基づいて上記分岐先テーブル630を参照して分岐先を表わす情報(変更後分岐先アドレス)を取得することを指示する分岐先取得命令とを、上記認証記憶装置157が記憶した認証情報に基づいて生成することを特徴とする。   The modified branch instruction generation device 151 in this embodiment is obtained by executing the authentication acquisition instruction 664 inserted by the authentication acquisition instruction insertion device 159 as the branch destination calculation instruction using the processing device (CPU 911). A branch destination storage position calculation instruction for instructing calculation of a position (branch destination storage address) of information representing a branch destination in the branch destination table 630 based on the authentication information to be executed, and the branch destination storage position calculation instruction A branch destination acquisition command for instructing to acquire information (a branch destination address after change) representing the branch destination with reference to the branch destination table 630 based on the position calculated by the authentication storage device 157 Is generated based on the authentication information stored.

この実施の形態におけるプログラム変換装置100によれば、認証情報を用いて分岐元と分岐先との対応関係を撹乱し、変更後分岐命令の実行時に、認証情報を用いて撹乱した対応関係を復元するので、変換済プログラム420の実行を途中で中断しても分岐元と分岐先との対応関係を知ることはできず、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, the correspondence relationship between the branch source and the branch destination is disturbed using the authentication information, and the disturbed correspondence relationship is restored using the authentication information when the post-change branch instruction is executed. Therefore, even if the execution of the converted program 420 is interrupted in the middle, the correspondence relationship between the branch source and the branch destination cannot be known, and the reverse engineering becomes more difficult.

この実施の形態における認証取得命令挿入装置159は、上記処理装置(CPU911)を用いて、上記認証取得命令664として、変換済プログラム420を実行するコンピュータ300が有する装置情報を取得することを指示する装置情報取得命令と、上記装置情報取得命令を実行することにより取得される装置情報に基づいて認証情報を算出することを指示する認証算出命令とを、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。   The authentication acquisition command insertion device 159 in this embodiment uses the processing device (CPU 911) to instruct acquisition of device information included in the computer 300 that executes the converted program 420 as the authentication acquisition command 664. A target program in which the target program input device 110 inputs a device information acquisition command and an authentication calculation command that instructs to calculate authentication information based on device information acquired by executing the device information acquisition command It inserts in 415, It is characterized by the above-mentioned.

この実施の形態におけるプログラム変換装置100によれば、装置情報に基づいて認証情報を算出する認証取得命令664を、認証取得命令挿入装置159が対象プログラム415に挿入するので、変換済プログラム420の実行を、特定のコンピュータ300だけに許可することができるという効果を奏する。   According to the program conversion device 100 in this embodiment, the authentication acquisition command insertion device 159 inserts the authentication acquisition command 664 for calculating the authentication information based on the device information into the target program 415, so that the converted program 420 is executed. This is advantageous in that it can be permitted only to a specific computer 300.

なお、この実施の形態における説明した認証情報の取得方式と、分岐先の撹乱方式とは、互いに独立である。例えば、この実施の形態における認証情報の取得方式と、実施の形態5あるいは実施の形態6で説明した分岐先の撹乱方式とを組み合わせてもよいし、実施の形態5で説明した認証情報の取得方式と、この実施の形態における分岐先の撹乱方式とを組み合わせてもよい。   Note that the authentication information acquisition method and the branch destination disturbance method described in this embodiment are independent of each other. For example, the authentication information acquisition method according to this embodiment may be combined with the branch destination disturbance method described in the fifth or sixth embodiment, or the authentication information acquisition described in the fifth embodiment. The method may be combined with the branch destination disturbance method in this embodiment.

例えば、プログラム変換装置100(プログラム変換方式)は、
プログラム(変換済プログラム420)を実行するハードウェア(コンピュータ300)に固有の番号(装置情報)から一意に生成される乱数列と分岐先テーブル630の各変更後分岐先情報との排他的論理和を取った撹乱分岐先情報からなるテーブル(撹乱分岐先テーブル)を格納し、プログラム(変換済プログラム420)の実行開始時にプログラム(変換済プログラム420)を実行するハードウェア(コンピュータ300)に固有の番号から一意に生成される乱数列とテーブル(撹乱分岐先テーブル)の各撹乱分岐先情報との排他論理和を取ってデータ部に分岐先テーブル630を作成するコード(分岐先復元命令665)が実行されるように実行プログラムを変更することを特徴としてもよい。
For example, the program conversion apparatus 100 (program conversion method)
Exclusive OR of a random number sequence uniquely generated from a number (device information) unique to the hardware (computer 300) executing the program (converted program 420) and each changed branch destination information in the branch destination table 630 A table (disturbed branch destination table) made up of disturbed branch destination information taken is stored, and is specific to the hardware (computer 300) that executes the program (converted program 420) at the start of execution of the program (converted program 420). A code (branch destination restoration instruction 665) that creates a branch destination table 630 in the data portion by taking an exclusive OR of a random number sequence uniquely generated from the number and each disturbed branch destination information of the table (disturbed branch destination table) The execution program may be changed so as to be executed.

この実施の形態におけるプログラム変換装置100(プログラム変換方式)によれば、、使用する装置(コンピュータ300)の固有値(装置情報)、例えばCPUのIDや通信ボードの個体アドレス(LANカードのMACアドレスや携帯電話の電話番号)などが予め分っている場合には、出力プログラム(変換済プログラム420)生成時に、パスワードに代えてこれら(装置情報)を入力し、出力プログラムのコード部に追加するコード(認証取得命令664)で実行時に装置(コンピュータ300)から装置の固有値(装置情報)を取得するように追加するので、出力プログラム(変換済プログラム420)を所定の固有値(装置情報)を持つ装置(コンピュータ300)以外で実行することができなくなり、このことによりプログラムの不正な利用を防止することができる。   According to the program conversion apparatus 100 (program conversion method) in this embodiment, the unique value (apparatus information) of the apparatus (computer 300) to be used, for example, the CPU ID, the individual address of the communication board (the MAC address of the LAN card, When the output program (converted program 420) is generated, code (device information) is input in place of the password and added to the code part of the output program when the mobile phone) is known in advance. (Authentication acquisition command 664) is added so that a device's unique value (device information) is acquired from the device (computer 300) at the time of execution, so that the output program (converted program 420) has a predetermined unique value (device information). (Computer 300) can not be executed other than this, the program It is possible to prevent the unauthorized use of the arm.

実施の形態8.
実施の形態8について、図33〜図41を用いて説明する。
Embodiment 8 FIG.
An eighth embodiment will be described with reference to FIGS.

図33は、この実施の形態におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図である。
なお、実施の形態3で説明したプログラム変換装置100と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 33 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 in this embodiment.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion apparatus 100 demonstrated in Embodiment 3, and description is abbreviate | omitted here.

プログラム変換装置100は、更に、パスワード入力装置154、認証生成装置156、認証記憶装置157、認証取得命令生成装置158、認証取得命令挿入装置159、分岐命令仮変更装置167、分岐元記憶装置168を有する。
なお、パスワード入力装置154、認証生成装置156、認証記憶装置157、認証取得命令生成装置158、認証取得命令挿入装置159は、実施の形態5で説明したものと同様である。
The program conversion apparatus 100 further includes a password input device 154, an authentication generation device 156, an authentication storage device 157, an authentication acquisition command generation device 158, an authentication acquisition command insertion device 159, a branch instruction temporary change device 167, and a branch source storage device 168. Have.
The password input device 154, the authentication generation device 156, the authentication storage device 157, the authentication acquisition command generation device 158, and the authentication acquisition command insertion device 159 are the same as those described in the fifth embodiment.

分岐命令仮変更装置167は、CPU911などの処理装置を用いて、分岐命令抽出装置130が抽出した変更前分岐命令を、雛形540で置き換える。
分岐元記憶装置168は、磁気ディスク装置920などの記憶装置を用いて、分岐命令仮変更装置167が置き換えた雛形540の開始アドレスを、変更後分岐元アドレスとして、変更後分岐元テーブルに記憶する。
The branch instruction temporary change device 167 replaces the pre-change branch instruction extracted by the branch instruction extraction device 130 with a template 540 using a processing device such as the CPU 911.
Using the storage device such as the magnetic disk device 920, the branch source storage device 168 stores the start address of the template 540 replaced by the branch instruction temporary change device 167 as the changed branch source address in the changed branch source table. .

分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証記憶装置157が記憶した認証情報に基づいて、分岐先記憶装置145が分岐先テーブル630に記憶した変更後分岐先アドレスを撹乱して、撹乱分岐先情報とすることにより、分岐先テーブル630を撹乱する。   The branch destination disturbing device 149 uses a processing device such as the CPU 911 to disturb the post-change branch destination address stored in the branch destination table 630 by the branch destination storage device 145 based on the authentication information stored in the authentication storage device 157. Thus, the branch destination table 630 is disturbed by using the disturbance branch destination information.

変更分岐命令生成装置151は、CPU911などの処理装置を用いて、変更後分岐命令520を生成する。
分岐命令変更装置152は、CPU911などの処理装置を用いて、分岐元記憶装置168が記憶した変更後分岐元アドレスに基づいて、分岐命令仮変更装置167が置き換えた雛形540を、変更分岐命令生成装置151が生成した変更後分岐命令520で置き換える。
The changed branch instruction generation device 151 generates the changed branch instruction 520 using a processing device such as the CPU 911.
The branch instruction change unit 152 generates a changed branch instruction by using the processing unit such as the CPU 911, based on the post-change branch source address stored in the branch source storage unit 168, and the template 540 replaced by the branch instruction temporary change unit 167. The changed branch instruction 520 generated by the device 151 is replaced.

変更分岐命令生成装置151は、分岐先撹乱装置149が撹乱した撹乱分岐先情報を、変更後分岐命令520に埋め込む。このため、分岐先テーブル630や分岐先読込命令661を対象プログラム415に挿入する必要はない。   The changed branch instruction generation device 151 embeds the disturbed branch destination information disturbed by the branch destination disturber 149 in the changed branch instruction 520. Therefore, it is not necessary to insert the branch destination table 630 or the branch destination read instruction 661 into the target program 415.

図34は、この実施の形態における変更分岐命令生成装置151が生成する変更後分岐命令520の一例を示す図である。   FIG. 34 is a diagram showing an example of the post-change branch instruction 520 generated by the change branch instruction generation device 151 in this embodiment.

分岐命令仮変更装置167は、磁気ディスク装置920などの記憶装置を用いて、雛形540を記憶している。変更分岐命令生成装置151は、分岐命令仮変更装置167が対象プログラム415に挿入した雛形540の空欄541〜544を埋めることにより、変更後分岐命令520を生成する。
空欄541及び542は、実施の形態7で説明したものと同様である。
空欄544は、撹乱分岐先情報を入れるべき空欄であり、変更分岐命令生成装置151は、分岐先撹乱装置149が撹乱した分岐先テーブル630から、撹乱分岐先情報を取得し、空欄544に挿入する。
The branch instruction temporary change device 167 stores the template 540 using a storage device such as the magnetic disk device 920. The changed branch instruction generation device 151 generates the changed branch instruction 520 by filling in the blanks 541 to 544 of the template 540 inserted by the branch instruction temporary change device 167 into the target program 415.
Blanks 541 and 542 are the same as those described in the seventh embodiment.
A blank field 544 is a blank field in which disturbed branch destination information is to be entered, and the changed branch instruction generation device 151 acquires disturbed branch destination information from the branch destination table 630 disturbed by the branch destination disturber 149 and inserts the disturbed branch destination information into the blank field 544. .

変更分岐命令生成装置151が生成した変更後分岐命令520を、コンピュータ300が実行する際の動作の流れは、以下の通りである。   The operation flow when the computer 300 executes the post-change branch instruction 520 generated by the change branch instruction generation device 151 is as follows.

分岐工程S711において、コンピュータ300は、変更後分岐命令の指示により、変更前分岐命令の分岐条件と同じ条件にしたがって、分岐するか否かを判定する。分岐すると判定した場合、認証情報取得工程S713へ進む。分岐しないと判定した場合、無条件分岐工程S712へ進む。
無条件分岐工程S712において、コンピュータ300は、変更後分岐命令の指示により、次の命令へ無条件分岐する。
認証情報取得工程S713において、コンピュータ300は、変更後分岐命令の指示により、認証情報格納アドレスから認証情報を取得する。
分岐先算出工程S717において、コンピュータ300は、変更後分岐命令の指示により、変更後分岐命令に埋め込まれた撹乱分岐先情報と、認証情報取得工程S713で取得した認証情報との排他的論理和を算出して、分岐先絶対アドレスとする。
間接分岐工程S719において、コンピュータ300は、変更後分岐命令の指示により、分岐先算出工程S717で算出した分岐先絶対アドレスへ無条件分岐する。
In the branch step S711, the computer 300 determines whether or not to branch according to the same condition as the branch condition of the branch instruction before the change according to the instruction of the branch instruction after the change. When it determines with branching, it progresses to authentication information acquisition process S713. If it is determined not to branch, the process proceeds to the unconditional branching step S712.
In the unconditional branch step S712, the computer 300 branches unconditionally to the next instruction in accordance with the instruction of the changed branch instruction.
In the authentication information acquisition step S713, the computer 300 acquires the authentication information from the authentication information storage address according to the instruction of the post-change branch instruction.
In the branch destination calculation step S717, the computer 300 performs an exclusive OR operation between the disturbance branch destination information embedded in the post-change branch instruction and the authentication information acquired in the authentication information acquisition step S713 according to the instruction of the post-change branch instruction. Calculate to be the branch destination absolute address.
In the indirect branch step S719, the computer 300 unconditionally branches to the branch destination absolute address calculated in the branch destination calculation step S717 according to the instruction of the changed branch instruction.

図35は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図である。
なお、実施の形態3で説明したプログラム変換処理と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 35 is a flowchart showing an example of the flow of program conversion processing in which the program conversion apparatus 100 in this embodiment converts the target program 415 to generate the converted program 420.
In addition, the same code | symbol is attached | subjected about the part which is common in the program conversion process demonstrated in Embodiment 3, and description is abbreviate | omitted here.

パスワード入力工程S801において、パスワード入力装置154は、キーボード902などの入力装置を用いて、パスワードを入力し、CPU911などの処理装置を用いて、入力したパスワードを出力する。
認証生成工程S802において、認証生成装置156は、CPU911などの処理装置を用いて、パスワード入力工程S801でパスワード入力装置154が出力したパスワードを入力し、入力したパスワードに基づいて、認証情報と検証情報とを生成し、生成した認証情報と検証情報とを出力する。
認証記憶装置157は、CPU911などの処理装置を用いて、認証生成装置156が出力した認証情報と検証情報とを入力し、磁気ディスク装置920などの記憶装置を用いて、入力した認証情報と検証情報とを記憶する。
In the password input step S801, the password input device 154 inputs a password using an input device such as a keyboard 902, and outputs the input password using a processing device such as a CPU 911.
In the authentication generation step S802, the authentication generation device 156 uses the processing device such as the CPU 911 to input the password output by the password input device 154 in the password input step S801, and the authentication information and the verification information based on the input password. And the generated authentication information and verification information are output.
The authentication storage device 157 uses the processing device such as the CPU 911 to input the authentication information and verification information output from the authentication generation device 156, and uses the storage device such as the magnetic disk device 920 to input the authentication information and verification. Memorize information.

認証取得命令生成工程S803において、認証取得命令生成装置158は、CPU911などの処理装置を用いて、認証生成工程S802で認証記憶装置157が記憶した検証情報に基づいて、検証命令を生成し、生成した検証命令を含む認証取得命令を生成し、生成した認証取得命令を出力する。
認証取得命令挿入工程S804において、認証取得命令挿入装置159は、CPU911などの処理装置を用いて、認証取得命令生成工程S803で認証取得命令生成装置158が生成した認証取得命令を入力し、入力した認証取得命令を、変換済プログラム420の先頭に書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、認証取得命令が書き込まれた変換済プログラム420を記憶する。
その後、逆アセンブル工程S812へ進む。
In the authentication acquisition command generation step S803, the authentication acquisition command generation device 158 generates and generates a verification command based on the verification information stored in the authentication storage device 157 in the authentication generation step S802 using a processing device such as the CPU 911. The authentication acquisition command including the verification command is generated, and the generated authentication acquisition command is output.
In the authentication acquisition command insertion step S804, the authentication acquisition command insertion device 159 uses the processing device such as the CPU 911 to input and input the authentication acquisition command generated by the authentication acquisition command generation device 158 in the authentication acquisition command generation step S803. An authentication acquisition command is written at the top of the converted program 420. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 in which the authentication acquisition command is written.
Thereafter, the process proceeds to the disassembly step S812.

分岐元判定工程S833において、変更分岐命令生成装置151が、変更前分岐元記憶工程S821で変更前分岐元記憶装置148が記憶した変更前分岐元テーブルのなかに、命令取得工程S831で分岐命令変更装置152が取得した実行形式のコードのアドレスと同じアドレスが記憶されていると判定した場合、雛形出力工程S836へ進む。
同じアドレスが記憶されていないと判定した場合、命令出力工程S837へ進む。
In the branch source determination step S833, the change branch instruction generation device 151 changes the branch instruction in the instruction acquisition step S831 in the branch source table before change stored in the branch source storage device 148 before change in the branch source storage step S821 before change. If it is determined that the same address as the address of the executable code acquired by the device 152 is stored, the process proceeds to a template output step S836.
If it is determined that the same address is not stored, the process proceeds to the instruction output step S837.

雛形出力工程S836において、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、雛形540を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、雛形540が追加された変換済プログラム420を記憶する。
分岐元記憶装置168は、CPU911などの処理装置を用いて、分岐命令仮変更装置167が追加した雛形540の開始アドレスを算出して、変更後分岐元アドレスとする。分岐元記憶装置168は、磁気ディスク装置920などの記憶装置を用いて、算出した変更後分岐元アドレスを変更後分岐元テーブルに記憶する。
In the template output step S836, the branch instruction temporary change device 167 adds and writes the template 540 to the end of the converted program 420 stored in the converted program storage device 180 by using a processing device such as the CPU 911. The converted program storage device 180 stores the converted program 420 to which the template 540 is added.
The branch source storage device 168 calculates the start address of the template 540 added by the branch instruction temporary change device 167 using a processing device such as the CPU 911 and sets it as the post-change branch source address. The branch source storage device 168 stores the calculated post-change branch source address in the post-change branch source table using a storage device such as the magnetic disk device 920.

命令出力工程S837において、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、命令取得工程S831で取得した実行形式のコードを、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、実行形式のコードが追加された変換済プログラム420を記憶する。   In the instruction output step S837, the branch instruction temporary change device 167 uses the processing device such as the CPU 911 to execute the code of the execution program acquired in the instruction acquisition step S831, and store the converted program 420 stored in the converted program storage device 180. Add and write at the end. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the executable code is added.

繰返し工程S839において、分岐命令変更装置152が、対象プログラム415から実行形式のコードを最後まで取得したと判定した場合、分岐先テーブル撹乱工程S843へ進む。
まだ取得が終わっていないと判定した場合、命令取得工程S831からの処理を繰り返す。
In the repetition step S839, when the branch instruction changing device 152 determines that the execution format code has been acquired from the target program 415 to the end, the process proceeds to the branch destination table disturbance step S843.
If it is determined that the acquisition has not been completed, the processing from the instruction acquisition step S831 is repeated.

分岐先テーブル撹乱工程S843において、分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630と、認証生成工程S802で認証記憶装置157が記憶した認証情報とを入力し、入力した認証情報に基づいて、入力した分岐先テーブル630を撹乱して、撹乱分岐先テーブルを生成し、生成した撹乱分岐先テーブルを出力する。
分岐先記憶装置145は、CPU911などの処理装置を用いて、分岐先撹乱装置149が出力した撹乱分岐先テーブルを入力し、入力した撹乱分岐先テーブルを記憶する。
In the branch destination table disturbing step S843, the branch destination disturbing device 149 uses a processing device such as the CPU 911 and the branch destination table 630 stored in the branch destination storing device 145 in the post-change branch destination storing step S842, and the authentication generation step S802. And the authentication information stored in the authentication storage device 157 is input, the input branch destination table 630 is disturbed based on the input authentication information, a disturbance branch destination table is generated, and the generated disturbance branch destination table is output. To do.
The branch destination storage device 145 inputs the disturbance branch destination table output from the branch destination disturbance device 149 using a processing device such as the CPU 911 and stores the input disturbance branch destination table.

撹乱分岐先取得工程S851において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、分岐先テーブル撹乱工程S843で分岐先記憶装置145が記憶した撹乱分岐先テーブルの最初から順に、撹乱分岐先情報を1つずつ取得する。
変更分岐命令生成工程S852において、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、撹乱分岐先取得工程S851で取得した撹乱分岐先情報に基づいて、変更後分岐命令520を生成する。変更分岐命令生成装置151は、CPU911などの処理装置を用いて、生成した変更後分岐命令520を出力する。
分岐命令変更工程S853において、分岐命令変更装置152は、CPU911などの処理装置を用いて、分岐元記憶装置168が記憶した変更後分岐元テーブルから、変更後分岐元アドレスを取得する。分岐命令変更装置152は、CPU911などの処理装置を用いて、変更分岐命令生成工程S852で変更分岐命令生成装置151が出力した変更後分岐命令520を入力する。分岐命令変更装置152は、CPU911などの処理装置を用いて、取得した変更後分岐元アドレスに基づいて、雛形出力工程S836で分岐命令仮変更装置167が変換済プログラム420に書き込んだ雛形540を、入力した変更後分岐命令520で置き換える。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、置き換えられた変換済プログラム420を記憶する。
繰返し工程S854において、変更分岐命令生成装置151は、撹乱分岐先取得工程S851で撹乱分岐先テーブルから撹乱分岐先情報を最後まで取得したか否かを判定する。
最後まで取得したと判定した場合、変更済プログラム出力工程S862へ進む。
まだ取得が終わっていないと判定した場合、撹乱分岐先取得工程S851からの処理を繰り返す。
In the disturbed branch destination acquisition step S851, the changed branch instruction generation device 151 uses the processing device such as the CPU 911 to disturb in order from the beginning of the disturbed branch destination table stored in the branch destination storage device 145 in the branch destination table disturbing step S843. Get branch destination information one by one.
In the modified branch instruction generation step S852, the modified branch instruction generation device 151 uses the processing device such as the CPU 911 to generate the post-change branch instruction 520 based on the disturbed branch destination information acquired in the disturbed branch destination acquisition step S851. . The changed branch instruction generation device 151 outputs the generated changed branch instruction 520 using a processing device such as the CPU 911.
In the branch instruction change step S853, the branch instruction change device 152 acquires the post-change branch source address from the post-change branch source table stored in the branch source storage device 168 using a processing device such as the CPU 911. The branch instruction change device 152 inputs the post-change branch instruction 520 output from the change branch instruction generation device 151 in the change branch instruction generation step S852 using a processing device such as the CPU 911. The branch instruction changing device 152 uses the processing device such as the CPU 911 to store the template 540 that the branch instruction temporary changing device 167 wrote in the converted program 420 in the template output step S836 based on the acquired post-change branch source address. Replace with the changed branch instruction 520 entered. The converted program storage device 180 stores the replaced converted program 420 using a storage device such as the magnetic disk device 920.
In the repetition step S854, the changed branch instruction generation device 151 determines whether or not the disturbance branch destination information has been acquired from the disturbance branch destination table to the end in the disturbance branch destination acquisition step S851.
When it determines with having acquired to the last, it progresses to changed program output process S862.
When it is determined that the acquisition has not been completed yet, the processing from the disturbance branch destination acquisition step S851 is repeated.

変更済プログラム出力工程S862において、変換済プログラム出力装置191は、CPU911などの処理装置を用いて、分岐命令変更工程S853で変換済プログラム記憶装置180が記憶した変換済プログラム420を入力し、入力した変換済プログラム420を出力する。
その後、プログラム変換処理を終了する。
In the changed program output step S862, the converted program output device 191 uses the processing device such as the CPU 911 to input and input the converted program 420 stored in the converted program storage device 180 in the branch instruction changing step S853. The converted program 420 is output.
Thereafter, the program conversion process is terminated.

図36は、この実施の形態における分岐命令仮変更装置167が雛形540を出力する雛形出力工程S836の詳細な処理の流れの一例を示すフローチャート図である。
雛形取得工程S836aにおいて、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、磁気ディスク装置920などの記憶装置に記憶した雛形540を取得する。
仮出力工程S836bにおいて、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、雛形取得工程S836aで取得した雛形540を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、雛形540が追加された変換済プログラム420を記憶する。
分岐元記憶工程836cにおいて、分岐元記憶装置168は、CPU911などの処理装置を用いて、仮出力工程S836bで分岐命令仮変更装置167が追加した雛形540の開始アドレスを算出し、変更後分岐元アドレスとする。分岐元記憶装置168は、例えば、あらかじめ、分岐命令仮変更装置167が書き込んだコードのバイト数を数えておくことにより、変更後分岐元アドレスを算出する。
分岐元記憶装置168は、磁気ディスク装置920などの記憶装置を用いて、算出した変更後分岐元アドレスを変更後分岐元テーブルに記憶する。
FIG. 36 is a flowchart showing an example of detailed processing flow of the template output step S836 in which the branch instruction temporary change device 167 outputs the template 540 in this embodiment.
In the template acquisition step S836a, the branch instruction temporary change device 167 acquires the template 540 stored in the storage device such as the magnetic disk device 920 using a processing device such as the CPU 911.
In the temporary output step S836b, the branch instruction temporary change device 167 uses the processing device such as the CPU 911 to add the template 540 acquired in the template acquisition step S836a to the end of the converted program 420 stored in the converted program storage device 180. Add and write. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the template 540 is added.
In the branch source storage step 836c, the branch source storage device 168 calculates the start address of the template 540 added by the branch instruction temporary change device 167 in the temporary output step S836b using a processing device such as the CPU 911, and the post-change branch source Address. The branch source storage device 168 calculates the post-change branch source address by, for example, counting the number of bytes of the code written by the branch instruction temporary change device 167 in advance.
The branch source storage device 168 stores the calculated post-change branch source address in the post-change branch source table using a storage device such as the magnetic disk device 920.

図37は、この実施の形態における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の詳細な処理の流れの一例を示すフローチャート図である。   FIG. 37 is a flowchart showing an example of detailed processing flow of the branch destination table disturbing step S843 in which the branch destination disturbing device 149 disturbs the branch destination table 630 in this embodiment.

認証情報取得工程S843cにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証生成工程S802で認証記憶装置157が記憶した認証情報を取得する。
分岐先取得工程S843eにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、変更後分岐先記憶工程S842で分岐先記憶装置145が記憶した分岐先テーブル630の最初から順に、変更後分岐先アドレスを1つずつ取得する。
排他的論理和算出工程S843hにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、認証情報取得工程S843cで取得した認証情報と、分岐先取得工程S843eで取得した変更後分岐先アドレスとの排他的論理和を算出して、撹乱分岐先情報とする。
撹乱分岐記憶工程S843iにおいて、分岐先記憶装置145は、分岐先撹乱装置149が算出した撹乱分岐先情報を、撹乱分岐先テーブルに記憶する。
繰返し工程S843jにおいて、分岐先撹乱装置149は、CPU911などの処理装置を用いて、分岐先取得工程S843eで分岐先テーブル630から変更後分岐先アドレスを最後まで取得したか否かを判定する。
最後まで取得したと判定した場合、分岐先テーブル撹乱工程S843を終了する。
まだ取得が終わっていないと判定した場合、分岐先取得工程S843eからの処理を繰り返す。
In the authentication information acquisition step S843c, the branch destination disturbance device 149 acquires the authentication information stored in the authentication storage device 157 in the authentication generation step S802 using a processing device such as the CPU 911.
In the branch destination acquisition step S843e, the branch destination disturbing device 149 uses the processing device such as the CPU 911, after the change in order from the beginning of the branch destination table 630 stored in the branch destination storage device 145 in the post-change branch destination storage step S842. Get branch destination addresses one by one.
In the exclusive OR calculation step S843h, the branch destination disturbing device 149 uses the processing device such as the CPU 911, the authentication information acquired in the authentication information acquisition step S843c, and the changed branch destination address acquired in the branch destination acquisition step S843e. Is obtained as disturbance branch destination information.
In the disturbance branch storage step S843i, the branch destination storage device 145 stores the disturbance branch destination information calculated by the branch destination disturbance device 149 in the disturbance branch destination table.
In the repetition step S843j, the branch destination disturbing device 149 determines whether or not the post-change branch destination address has been acquired from the branch destination table 630 in the branch destination acquisition step S843e by using a processing device such as the CPU 911.
When it determines with having acquired to the last, branch destination table disturbance process S843 is complete | finished.
If it is determined that the acquisition has not been completed yet, the processing from the branch destination acquisition step S843e is repeated.

図38は、この実施の形態における変更分岐命令生成装置151が変更後分岐命令520を生成する変更分岐命令生成工程S852の詳細な処理の流れの一例を示すフローチャート図である。
なお、実施の形態7で説明した変更分岐命令生成工程S834と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 38 is a flowchart showing an example of a detailed process flow of the modified branch instruction generation step S852 in which the modified branch instruction generation device 151 generates the post-change branch instruction 520 in this embodiment.
Note that portions common to the modified branch instruction generation step S834 described in the seventh embodiment are denoted by the same reference numerals, and description thereof is omitted here.

撹乱分岐先取得工程S834jにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、撹乱分岐記憶工程S843iで分岐先記憶装置145が記憶した撹乱分岐先テーブルから撹乱分岐先情報を取得する。
撹乱分岐先挿入工程S834kにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、撹乱分岐先取得工程S834jで取得した撹乱分岐先情報を、雛形540の空欄544に挿入する。
変更後分岐命令出力工程S834lにおいて、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、空欄を埋められた雛形540を、変更後分岐命令520として出力する。
In the disturbed branch destination acquisition step S834j, the modified branch instruction generation device 151 uses the processing device such as the CPU 911 to acquire disturbed branch destination information from the disturbed branch destination table stored in the branch destination storage device 145 in the disturbed branch storage step S843i. To do.
In the disturbed branch destination insertion step S834k, the changed branch instruction generation device 151 uses the processing device such as the CPU 911 to insert the disturbed branch destination information acquired in the disturbed branch destination acquisition step S834j into the blank 544 of the template 540.
In the post-change branch instruction output step S8341, the change branch instruction generation device 151 outputs the template 540 filled with blanks as the post-change branch instruction 520 using a processing device such as the CPU 911.

図39は、この実施の形態における変更分岐命令生成装置151が生成する変更後分岐命令520の別の例を示す図である。
雛形540は、更に、空欄545,546を有する。
空欄545及び空欄546は、分岐先絶対アドレスを一時的に記憶しておく一時領域のアドレスを入れるべき空欄であり、変更分岐命令生成装置151は、CPU911などの処理装置を用いて、一時領域のアドレスを、空欄545及び空欄546に挿入する。
FIG. 39 is a diagram showing another example of the post-change branch instruction 520 generated by the changed branch instruction generation device 151 in this embodiment.
The template 540 further has blanks 545 and 546.
A blank 545 and a blank 546 are blanks in which addresses of temporary areas in which the branch destination absolute addresses are temporarily stored are to be entered. The address is inserted into the blank field 545 and the blank field 546.

変更分岐命令生成装置151が生成した変更後分岐命令520を、コンピュータ300が実行する際の動作は、図34の例と比較して、以下の点が異なる。
間接分岐工程S719において、コンピュータ300は、変更後分岐命令の指示により、分岐先算出工程S717で算出した分岐先絶対アドレスを、一時領域に記憶する。
コンピュータ300は、変更後分岐命令の指示により、一時領域に記憶した分岐先絶対アドレスへ無条件分岐する。
The operation when the computer 300 executes the post-change branch instruction 520 generated by the change branch instruction generation device 151 is different from the example of FIG. 34 in the following points.
In the indirect branch step S719, the computer 300 stores the branch destination absolute address calculated in the branch destination calculation step S717 in the temporary area according to the instruction of the post-change branch instruction.
The computer 300 unconditionally branches to the branch destination absolute address stored in the temporary area according to the instruction of the post-change branch instruction.

図40は、この実施の形態における変更分岐命令生成装置151が生成する変更後分岐命令520の更に別の例を示す図である。
この例は、コンピュータ300が変更後分岐命令の指示により分岐した後、退避したレジスタを復帰するなどの後処理が必要な場合の例である。
分岐後処理が必要な場合、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、後処理命令550を、分岐先に挿入する。
FIG. 40 is a diagram showing still another example of the post-change branch instruction 520 generated by the changed branch instruction generation device 151 in this embodiment.
This example is an example in which post-processing such as restoring the saved register after the computer 300 branches according to the instruction of the branch instruction after the change is necessary.
When branch post-processing is necessary, the branch instruction temporary change device 167 inserts the post-processing instruction 550 into the branch destination using a processing device such as the CPU 911.

分岐命令仮変更装置167が挿入した後処理命令550を、コンピュータ300が実行する際の動作の流れは、以下の通りである。
変更後分岐命令により分岐してきたのではなく、前の命令から順に実行してきた場合、コンピュータ300は、無条件分岐工程S761を実行する。無条件分岐工程S761において、コンピュータ300は、後処理命令550の指示により、次の命令へ無条件分岐する。
変更後分岐命令により分岐してきた場合、コンピュータ300は、分岐後処理工程S762を実行する。分岐後処理工程S762において、コンピュータ300は、後処理命令550の指示により、所定の分岐後処理をする。
The operation flow when the computer 300 executes the post-processing instruction 550 inserted by the branch instruction temporary change device 167 is as follows.
When the branch is not performed by the post-change branch instruction but is executed sequentially from the previous instruction, the computer 300 executes the unconditional branch step S761. In the unconditional branch step S761, the computer 300 branches unconditionally to the next instruction according to the instruction of the post-processing instruction 550.
When the branch is made by the post-change branch instruction, the computer 300 executes a post-branch processing step S762. In the branch post-processing step S762, the computer 300 performs a predetermined post-branch process in accordance with an instruction of the post-processing instruction 550.

図41は、この実施の形態におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの別の例を示すフローチャート図である。
なお、図35で説明したプログラム変換処理と共通する部分については、同一の符号を付し、ここでは説明を省略する。
FIG. 41 is a flowchart showing another example of the flow of program conversion processing in which the program conversion apparatus 100 in this embodiment converts the target program 415 to generate the converted program 420.
Note that portions common to the program conversion processing described in FIG. 35 are denoted by the same reference numerals, and description thereof is omitted here.

分岐先判定工程S832において、分岐先決定装置144が、変更前分岐先テーブル610のなかに、命令取得工程S831で分岐命令変更装置152が取得した実行形式のコードのアドレスと同じアドレスが記憶されていると判定した場合、後処理命令出力工程S840へ進む。
後処理命令出力工程S840において、分岐命令仮変更装置167は、CPU911などの処理装置を用いて、磁気ディスク装置920などの記憶装置に記憶した後処理命令550を取得する。分岐命令仮変更装置167は、CPU911などの処理装置を用いて、取得した後処理命令550を、変換済プログラム記憶装置180が記憶した変換済プログラム420の最後に追加して書き込む。変換済プログラム記憶装置180は、磁気ディスク装置920などの記憶装置を用いて、後処理命令550が追加された変換済プログラム420を記憶する。
その後、変更後分岐先決定工程S841へ進む。
In the branch destination determination step S832, the branch destination determination device 144 stores the same address as the code of the execution format acquired by the branch instruction change device 152 in the instruction acquisition step S831 in the pre-change branch destination table 610. If it is determined that there is, the process proceeds to a post-processing command output step S840.
In the post-processing instruction output step S840, the branch instruction temporary change device 167 acquires the post-processing instruction 550 stored in the storage device such as the magnetic disk device 920 using a processing device such as the CPU 911. The branch instruction temporary change device 167 uses the processing device such as the CPU 911 to add and write the acquired post-processing instruction 550 to the end of the converted program 420 stored in the converted program storage device 180. The converted program storage device 180 uses a storage device such as the magnetic disk device 920 to store the converted program 420 to which the post-processing instruction 550 is added.
Thereafter, the process proceeds to the post-change branch destination determination step S841.

このように、分岐後に後処理が必要な場合は、分岐命令仮変更装置167が分岐先に後処理命令550を挿入する。後処理命令550には、分岐によってではなく、前の命令からそのまま処理が移行してくる場合があるので、後処理命令550の先頭には、次の命令への無条件分岐を指示する無条件分岐命令を設け、その次に、必要な後処理をすることを指示する分岐後処理命令を設けておく。分岐先記憶領域決定装置141は、変更後分岐命令が分岐後処理命令へ分岐するよう、変更後分岐先アドレスを算出して、分岐先記憶装置145が分岐先テーブル630に記憶する。   As described above, when post-processing is necessary after branching, the branch instruction temporary change device 167 inserts the post-processing instruction 550 at the branch destination. Since the post-processing instruction 550 may shift from the previous instruction as it is rather than by branching, the post-processing instruction 550 is preceded by an unconditional instruction that instructs an unconditional branch to the next instruction. A branch instruction is provided, and then a branch post-processing instruction for instructing necessary post-processing is provided. The branch destination storage area determination device 141 calculates a post-change branch destination address so that the post-change branch instruction branches to the post-branch processing instruction, and the branch destination storage device 145 stores the branch destination storage device 145 in the branch destination table 630.

この実施の形態におけるプログラム変換装置100(プログラム変換システム、プログラム変換方式)は、更に、情報を記憶する記憶装置(磁気ディスク装置920)と、認証記憶装置157と、認証取得命令挿入装置159とを有することを特徴とする。
上記認証記憶装置157は、上記記憶装置(磁気ディスク装置920)を用いて、上記対象プログラム415を実行する権限があるか否かを認証するための認証情報を記憶することを特徴とする。
上記分岐先テーブル生成装置140は、上記処理装置(CPU911)を用いて、上記分岐先取得装置133が取得した変更前分岐先情報(変更前分岐先アドレス)に基づいて、上記変換済プログラム420における分岐の分岐先を表わす情報を算出して、変更後分岐先情報(変更後分岐先アドレス)とし、上記認証記憶装置157が記憶した認証情報に基づいて、算出した変更後分岐先情報を撹乱して、撹乱分岐先情報を生成し、生成した撹乱分岐先情報に基づいて、分岐先テーブル(撹乱分岐先テーブル)を生成することを特徴とする。
上記認証取得命令挿入装置159は、上記処理装置(CPU911)を用いて、認証情報を取得することを指示する認証取得命令を、上記対象プログラム入力装置110が入力した対象プログラム415に挿入することを特徴とする。
上記変更分岐命令生成装置151は、上記処理装置(CPU911)を用いて、上記分岐先テーブル生成装置140が生成した分岐先テーブル(撹乱分岐先テーブル)を参照して撹乱分岐先情報を取得し、上記分岐先算出命令として、取得した撹乱分岐先情報を含み、上記認証取得命令を実行することにより取得される認証情報と、上記撹乱分岐先情報とに基づいて、分岐先を表わす情報(分岐先絶対アドレス)を算出する命令を生成することを特徴とする。
The program conversion apparatus 100 (program conversion system, program conversion method) in this embodiment further includes a storage device (magnetic disk device 920) for storing information, an authentication storage device 157, and an authentication acquisition command insertion device 159. It is characterized by having.
The authentication storage device 157 stores authentication information for authenticating whether or not there is an authority to execute the target program 415 using the storage device (magnetic disk device 920).
The branch destination table generation device 140 uses the processing device (CPU 911), based on the pre-change branch destination information (pre-change branch destination address) acquired by the branch destination acquisition device 133, in the converted program 420. The information representing the branch destination of the branch is calculated and used as the post-change branch destination information (the post-change branch destination address), and the calculated post-change branch destination information is disturbed based on the authentication information stored in the authentication storage device 157. Then, disturbed branch destination information is generated, and a branch destination table (disturbed branch destination table) is generated based on the generated disturbed branch destination information.
The authentication acquisition command insertion device 159 uses the processing device (CPU 911) to insert an authentication acquisition command instructing acquisition of authentication information into the target program 415 input by the target program input device 110. Features.
The modified branch instruction generation device 151 uses the processing device (CPU 911) to obtain the disturbed branch destination information with reference to the branch destination table (disturbed branch destination table) generated by the branch destination table generation device 140, The branch destination calculation instruction includes the acquired disturbed branch destination information, and information representing the branch destination based on the authentication information acquired by executing the authentication acquisition instruction and the disturbed branch destination information (branch destination) An instruction for calculating (absolute address) is generated.

この実施の形態におけるプログラム変換装置100によれば、変更分岐命令生成装置151が生成した変更後分岐命令520が撹乱分岐先情報を含むので、変換済プログラム420実行時には、分岐先テーブル630を参照する必要がなく、認証情報を知らなければ、撹乱分岐先情報から分岐先絶対アドレスを復元できないので、リバースエンジニアリングが更に困難になるという効果を奏する。   According to the program conversion apparatus 100 in this embodiment, since the post-change branch instruction 520 generated by the change branch instruction generation apparatus 151 includes disturbed branch destination information, the branch destination table 630 is referred to when the converted program 420 is executed. If it is not necessary and the authentication information is not known, the branch destination absolute address cannot be restored from the disturbing branch destination information, so that the reverse engineering becomes more difficult.

以上説明したプログラム変換装置100(プログラム変換方式)は、
実行プログラム(対象プログラム415)内の分岐命令を検索し、各分岐命令について、プログラムのコード部内にアドレス(変更後分岐先情報)を格納する領域を確保して、この領域に新たに計算した分岐先アドレス(変更後分岐先情報)を格納し、分岐元の命令(変更前分岐命令)をコード部内の領域から取得したアドレス(変更後分岐先情報)に分岐するように命令を置き換え、変更後の実行プログラム(変換済プログラム420)の動作が変更前の実行プログラム(対象プログラム415)と同じ動作になるように変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
A branch instruction in the execution program (target program 415) is searched, and for each branch instruction, an area for storing an address (changed branch destination information) is secured in the code part of the program, and a newly calculated branch is stored in this area. Store the destination address (branch destination information after change), replace the instruction so that the branch source instruction (branch instruction before change) branches to the address (branch destination information after change) obtained from the area in the code part, and after the change The execution program (converted program 420) is changed so as to have the same operation as the execution program (target program 415) before the change.

以上説明したプログラム変換装置100(プログラム変換方式)は、
新たに計算した分岐先アドレス(変更後分岐先情報)とパスワードから一意に生成される値(認証情報)との論理的排他和(排他的論理和)を取った値(撹乱分岐先情報)をプログラム(変換済プログラム420)のコード部内に格納し、プログラム(変換済プログラム420)の実行開始時にパスワードから一意に生成される値(認証情報)を生成し、コード部内に格納した値(撹乱分岐先情報)とパスワードから一意に生成される値(認証情報)との論理的排他和(排他的論理和)を分岐先アドレスとして分岐命令が実行されるように実行プログラム(対象プログラム415)を変更することを特徴とする。
The program conversion apparatus 100 (program conversion method) described above is
A value (disturbed branch destination information) obtained by taking a logical exclusive sum (exclusive OR) of a newly calculated branch destination address (post-change branch destination information) and a value uniquely generated from the password (authentication information) A value (authentication information) that is stored in the code part of the program (converted program 420), uniquely generated from the password at the start of execution of the program (converted program 420), and stored in the code part (disturbed branch) The execution program (target program 415) is changed so that the branch instruction is executed using the logical exclusive sum (exclusive OR) of the value (authentication information) uniquely generated from the destination information and the password as the branch destination address. It is characterized by doing.

以上説明したプログラム変換装置100(プログラム変換方式)によれば、プログラム(対象プログラム415)内の分岐命令を、分岐命令のオペランドに分岐先のアドレスを直接指定せずに、コード部に格納したアドレス(変更後分岐先情報)を使って分岐するよう書き換えることにより、解析の負荷が増大する。さらに、分岐先のアドレス(変更後分岐先情報)をパスワードのハッシュ値(認証情報)と論理的排他和(排他的論理和)を取った状態(撹乱分岐先情報)でコード部に格納し、実行時にパスワードを使って本来の分岐先を計算しながらプログラムの実行を行うため、パスワードが分らなければ、プログラムを正しく実行させることができないようにすることができる。このことによりプログラムの不正な利用を防止することができる。   According to the program conversion apparatus 100 (program conversion method) described above, the branch instruction in the program (target program 415) is stored in the code part without directly specifying the branch destination address in the operand of the branch instruction. Rewriting to branch using (changed branch destination information) increases the analysis load. Furthermore, the branch destination address (the post-change branch destination information) is stored in the code part in a state (disturbed branch destination information) obtained by taking a password hash value (authentication information) and a logical exclusive OR (exclusive OR), Since the program is executed while calculating the original branch destination using the password at the time of execution, the program cannot be executed correctly unless the password is known. This can prevent unauthorized use of the program.

なお、この実施の形態では、実施の形態5で説明したプログラム変換装置100と同様、入力したパスワードに基づいて認証情報を生成する場合について説明したが、実施の形態7で説明したプログラム変換装置100と同様、コンピュータ300が有する装置情報に基づいて認証情報を生成してもよい。   In this embodiment, as in the case of the program conversion apparatus 100 described in the fifth embodiment, the case where the authentication information is generated based on the input password has been described. However, the program conversion apparatus 100 described in the seventh embodiment. Similarly to the above, the authentication information may be generated based on the device information that the computer 300 has.

すなわち、プログラム変換装置100(プログラム変換方式)は、
新たに計算した分岐先アドレス(変更後分岐先情報)とプログラム(変換済プログラム420)を実行するハードウェア(コンピュータ300)に固有の番号(装置情報)から一意に生成される値(認証情報)との論理的排他和(排他的論理和)を取った値(撹乱分岐先情報)をプログラム(変換済プログラム420)のコード部内に格納し、プログラム(変換済プログラム420)の実行開始時にプログラム(変換済プログラム420)を実行するハードウェア(コンピュータ300)に固有の番号(装置情報)から一意に生成される値(認証情報)を生成し、コード部内に格納した値(撹乱分岐先情報)とパスワードから一意に生成される値(撹乱分岐先情報)との論理的排他和(排他的論理和)を分岐先アドレスとして分岐命令が実行されるように実行プログラム(対象プログラム415)を変更することを特徴としてもよい。
That is, the program conversion apparatus 100 (program conversion method)
A value (authentication information) uniquely generated from a newly calculated branch destination address (post-change branch destination information) and a number (device information) unique to the hardware (computer 300) that executes the program (converted program 420) Is stored in the code part of the program (converted program 420), and the program (converted program 420) is started at the start of execution of the program (converted program 420). A value (authentication information) uniquely generated from a number (device information) unique to the hardware (computer 300) executing the converted program 420), and the value (disturbance branch destination information) stored in the code part A branch instruction is executed using a logical exclusive sum (exclusive OR) with a value uniquely generated from the password (disturbed branch destination information) as the branch destination address. It may be characterized in that changing the executable program (object program 415) as.

その場合、使用する装置(コンピュータ300)の固有値(装置情報)、例えばCPUのIDや通信ボードの個体アドレス(LANカードのMACアドレスや携帯電話の電話番号)などが予め分っている場合には、出力プログラム(変換済プログラム420)生成時に、パスワードに代えてこれら(装置情報)を入力し、出力プログラム(変換済プログラム420)のコード部に追加するコード(認証取得命令664)で実行時に装置(コンピュータ300)から装置の固有値(装置情報)を取得するように追加するので、出力プログラム(変換済プログラム420)を所定の固有値(装置情報)を持つ装置(コンピュータ300)以外で実行することができなくなり、このことによりプログラムの不正な利用を防止することができる。   In this case, when a specific value (device information) of a device (computer 300) to be used, for example, an ID of a CPU or an individual address of a communication board (a MAC address of a LAN card or a telephone number of a mobile phone) is known in advance. When the output program (converted program 420) is generated, these (device information) are input instead of the password, and the code (authentication acquisition command 664) added to the code part of the output program (converted program 420) is executed at the time of execution. Since it adds so that the eigenvalue (apparatus information) of an apparatus may be acquired from (computer 300), it is possible to execute the output program (converted program 420) other than an apparatus (computer 300) having a predetermined eigenvalue (apparatus information). As a result, unauthorized use of the program can be prevented.

実施の形態1におけるプログラム変換装置100を用いたプログラム配布システムの全体構成の一例を示すシステム構成図。1 is a system configuration diagram illustrating an example of an overall configuration of a program distribution system using a program conversion device 100 according to Embodiment 1. FIG. 実施の形態1におけるプログラム変換装置100の外観の一例を示す図。FIG. 3 is a diagram illustrating an example of an appearance of a program conversion apparatus 100 according to the first embodiment. 実施の形態1におけるプログラム変換装置100のハードウェア資源の一例を示す図。FIG. 3 is a diagram illustrating an example of hardware resources of the program conversion apparatus 100 according to the first embodiment. 実施の形態1におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 3 is a block configuration diagram showing an example of a functional block configuration of the program conversion apparatus 100 according to the first embodiment. 実施の形態1における変更分岐命令生成装置151が生成する変更後分岐命令の一例を示す図。FIG. 6 is a diagram illustrating an example of a post-change branch instruction generated by the changed branch instruction generation device 151 according to the first embodiment. 実施の形態1における分岐先テーブル生成装置140が分岐先テーブルを生成する様子の一例を示す図。The figure which shows an example of a mode that the branch destination table production | generation apparatus 140 in Embodiment 1 produces | generates a branch destination table. 実施の形態1におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 1 converts the object program 415, and produces | generates the converted program 420. 実施の形態2におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 6 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to a second embodiment. 実施の形態2における分岐命令変更装置152が分岐命令を変更する処理を説明するための図。The figure for demonstrating the process in which the branch instruction change apparatus 152 in Embodiment 2 changes a branch instruction. 実施の形態2におけるプログラム変換装置100が対象プログラム416を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 2 converts the object program 416, and produces | generates the converted program 420. 実施の形態3におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 10 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to a third embodiment. 実施の形態3におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図(前半)。The flowchart figure which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 3 converts the object program 415 and produces | generates the converted program 420 (the first half). 実施の形態3におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図(後半)。The flowchart figure (latter half) which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 3 converts the object program 415 and produces | generates the converted program 420. 実施の形態3における変更前分岐先記憶装置142が記憶する変更前分岐先テーブル610と、変更前分岐元記憶装置148が記憶する変更前分岐元テーブル670と、分岐先記憶装置145が記憶する分岐先テーブル630との一例を示す図。The branch destination table 610 before change stored in the branch destination storage device 142 before change in Embodiment 3, the branch source table 670 before change stored in the branch source storage device 148 before change, and the branch stored in the branch destination storage device 145 The figure which shows an example with the destination table 630. FIG. 実施の形態3における変更前分岐先記憶装置142が記憶する変更前分岐先テーブル610と、変更前分岐元記憶装置148が記憶する変更前分岐元テーブル670と、分岐先記憶装置145が記憶する分岐先テーブル630との別の例を示す図。The branch destination table 610 before change stored in the branch destination storage device 142 before change in Embodiment 3, the branch source table 670 before change stored in the branch source storage device 148 before change, and the branch stored in the branch destination storage device 145 The figure which shows another example with the destination table 630. FIG. 実施の形態4におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 10 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to a fourth embodiment. 実施の形態4における分岐先読込命令挿入装置163が挿入した分岐先読込命令を、コンピュータ300が実行した場合の動作の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the flow of operation | movement when the computer 300 executes the branch destination read instruction inserted by the branch destination read instruction insertion device 163 in the fourth embodiment. 実施の形態4における分岐先読込命令挿入装置163が挿入した分岐先読込命令を、コンピュータ300が実行した場合の動作の流れの別の例を示すフローチャート図。FIG. 15 is a flowchart showing another example of the operation flow when the computer 300 executes a branch destination read instruction inserted by the branch destination read instruction insertion device 163 according to the fourth embodiment. 実施の形態4におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す模式図。The schematic diagram which shows an example of the structure of the converted program 420 which the program conversion apparatus 100 in Embodiment 4 produces | generates. 実施の形態4におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 4 converts the object program 415, and produces | generates the converted program 420. 実施の形態5におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 10 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to a fifth embodiment. 実施の形態5におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す図。The figure which shows an example of the structure of the converted program 420 which the program conversion apparatus 100 in Embodiment 5 produces | generates. 実施の形態5における認証取得命令挿入装置159が挿入する認証取得命令664及び分岐先復元命令挿入装置166が挿入する分岐先復元命令665を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図。An example of an operation flow when the computer 300 executes the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159 and the branch destination restoration command 665 inserted by the branch destination restoration command insertion device 166 according to the fifth embodiment is shown. FIG. 実施の形態5におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the flow of the program conversion process in which the program conversion apparatus 100 in Embodiment 5 converts the object program 415, and produces | generates the converted program 420. 実施の形態5における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の処理の詳細な流れの一例を示すフローチャート図。The flowchart figure which shows an example of the detailed flow of the process of branch destination table disturbance process S843 in which the branch destination disturbance apparatus 149 in Embodiment 5 disturbs the branch destination table 630. 実施の形態6におけるプログラム変換装置100が生成する変換済プログラム420の構造の一例を示す図。The figure which shows an example of the structure of the converted program 420 which the program conversion apparatus 100 in Embodiment 6 produces | generates. 実施の形態6における認証取得命令挿入装置159が挿入する認証取得命令664及び分岐先復元命令挿入装置166が挿入する分岐先復元命令665を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図。An example of the flow of operations when the computer 300 executes the authentication acquisition command 664 inserted by the authentication acquisition command insertion device 159 and the branch destination restoration command 665 inserted by the branch destination restoration command insertion device 166 according to the sixth embodiment is shown. FIG. 実施の形態6における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の処理の詳細な流れの一例を示すフローチャート図。The flowchart figure which shows an example of the detailed flow of the process of branch destination table disturbance process S843 in which the branch destination disturbance apparatus 149 in Embodiment 6 disturbs the branch destination table 630. 実施の形態7におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 18 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to a seventh embodiment. 実施の形態7における認証取得命令挿入装置159が挿入する認証取得命令を、コンピュータ300が実行する際の動作の流れの一例を示すフローチャート図。FIG. 20 is a flowchart showing an example of an operation flow when the computer 300 executes an authentication acquisition command inserted by the authentication acquisition command insertion device 159 according to the seventh embodiment. 実施の形態7における変更分岐命令生成装置151が生成する変更後分岐命令520の一例を示す図。FIG. 20 is a diagram illustrating an example of a post-change branch instruction 520 generated by the changed branch instruction generation device 151 according to the seventh embodiment. 実施の形態7における変更分岐命令生成装置151が、変更後分岐命令を生成する変更分岐命令生成工程S834の詳細な処理の流れの一例を示すフローチャート図。FIG. 18 is a flowchart showing an example of a detailed processing flow of a modified branch instruction generation step S834 in which the modified branch instruction generation device 151 in Embodiment 7 generates a modified branch instruction. 実施の形態8におけるプログラム変換装置100の機能ブロックの構成の一例を示すブロック構成図。FIG. 20 is a block configuration diagram illustrating an example of a functional block configuration of a program conversion apparatus 100 according to an eighth embodiment. 実施の形態8における変更分岐命令生成装置151が生成する変更後分岐命令520の一例を示す図。FIG. 20 is a diagram illustrating an example of a post-change branch instruction 520 generated by the changed branch instruction generation device 151 according to the eighth embodiment. 実施の形態8におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの一例を示すフローチャート図。FIG. 19 is a flowchart showing an example of the flow of a program conversion process in which the program conversion apparatus 100 in the eighth embodiment converts a target program 415 to generate a converted program 420. 実施の形態8における分岐命令仮変更装置167が雛形540を出力する雛形出力工程S836の詳細な処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the detailed process flow of template output process S836 in which the branch instruction temporary change apparatus 167 in Embodiment 8 outputs the template 540. 実施の形態8における分岐先撹乱装置149が分岐先テーブル630を撹乱する分岐先テーブル撹乱工程S843の詳細な処理の流れの一例を示すフローチャート図。The flowchart figure which shows an example of the detailed process flow of branch destination table disturbance process S843 in which the branch destination disturbance apparatus 149 in Embodiment 8 disturbs the branch destination table 630. 実施の形態8における変更分岐命令生成装置151が変更後分岐命令520を生成する変更分岐命令生成工程S852の詳細な処理の流れの一例を示すフローチャート図。FIG. 20 is a flowchart showing an example of a detailed processing flow of a modified branch instruction generation step S852 in which the modified branch instruction generation device 151 in Embodiment 8 generates a modified branch instruction 520. 実施の形態8における変更分岐命令生成装置151が生成する変更後分岐命令520の別の例を示す図。FIG. 25 shows another example of a post-change branch instruction 520 generated by the changed branch instruction generation device 151 according to the eighth embodiment. 実施の形態8における変更分岐命令生成装置151が生成する変更後分岐命令520の更に別の例を示す図。FIG. 25 shows still another example of the post-change branch instruction 520 generated by the changed branch instruction generation device 151 according to the eighth embodiment. 実施の形態8におけるプログラム変換装置100が対象プログラム415を変換して変換済プログラム420を生成するプログラム変換処理の流れの別の例を示すフローチャート図。FIG. 20 is a flowchart showing another example of the flow of program conversion processing in which the program conversion apparatus 100 in the eighth embodiment converts the target program 415 to generate a converted program 420.

符号の説明Explanation of symbols

100 プログラム変換装置、110 対象プログラム入力装置、111 プログラム名入力装置、112 プログラム取得装置、113 種別判定装置、114 コンパイル装置、115,171 アセンブル装置、116 逆アセンブル装置、120 対象プログラム記憶装置、130 分岐命令抽出装置、131 逆アセンブル装置、132 分岐命令判定装置、133 分岐先取得装置、140 分岐先テーブル生成装置、141 分岐先記憶領域決定装置、142 変更前分岐先記憶装置、143 アドレス対応記憶装置、144 分岐先決定装置、145 分岐先記憶装置、146 分岐元取得装置、148 変更前分岐元記憶装置、149 分岐先撹乱装置、151 変更分岐命令生成装置、152 分岐命令変更装置、154 パスワード入力装置、155 装置情報取得装置、156 認証生成装置、157 認証記憶装置、158 認証取得命令生成装置、159 認証取得命令挿入装置、161 分岐先挿入装置、162 分岐先読込命令記憶装置、163 分岐先読込命令挿入装置、164 分岐先読込領域挿入装置、165 分岐先復元命令記憶装置、166 分岐先復元命令挿入装置、167 分岐命令仮変更装置、168 分岐元記憶装置、180 変換済プログラム記憶装置、191 変換済プログラム出力装置、192 分岐先書出装置、300 コンピュータ、410,415,416 対象プログラム、420 変換済プログラム、501 オペコード、502 オペランド、511〜516 分岐命令、520 変更後分岐命令、521〜523 命令、531 次の命令、540 雛形、541〜546 空欄、550 後処理命令、610 変更前分岐先テーブル、611 変更前分岐先アドレス、612 アドレスタイプ、613 分岐方向、614 分岐番号、620 アドレス対応テーブル、621 変更前アドレス、622 オフセット、630 分岐先テーブル、631 変更後分岐先アドレス、632 分岐先ラベル、633 撹乱分岐先情報、640 変換前アセンブリコード、650 変換済アセンブリコード、651 変更部分、652 追加部分、661 分岐先読込命令、662 変更後対象プログラム、663 分岐先読込領域、664 認証取得命令、665 分岐先復元命令、666 撹乱分岐先テーブル、670 変更前分岐元テーブル、671 変更前分岐元アドレス、901 表示装置、902 キーボード、903 マウス、904 FDD、905 CDD、906 プリンタ装置、907 スキャナ装置、910 システムユニット、911 CPU、912 バス、913 ROM、914 RAM、915 通信装置、920 磁気ディスク装置、921 OS、922 ウィンドウシステム、923 プログラム群、924 ファイル群、931 電話器、932 ファクシミリ機、940 インターネット、941 ゲートウェイ、942 LAN。   100 program conversion device, 110 target program input device, 111 program name input device, 112 program acquisition device, 113 type determination device, 114 compilation device, 115,171 assembly device, 116 disassembly device, 120 target program storage device, 130 branch Instruction extraction device 131 Disassembly device 132 Branch instruction determination device 133 Branch destination acquisition device 140 Branch destination table generation device 141 Branch destination storage area determination device 142 Pre-change branch destination storage device 143 Address correspondence storage device 144 Branch destination determination device, 145 Branch destination storage device, 146 Branch source acquisition device, 148 Branch source storage device before change, 149 Branch destination disturbance device, 151 Change branch instruction generation device, 152 Branch instruction change device, 154 Password input Device, 155 device information acquisition device, 156 authentication generation device, 157 authentication storage device, 158 authentication acquisition command generation device, 159 authentication acquisition command insertion device, 161 branch destination insertion device, 162 branch destination read command storage device, 163 branch destination read Instruction insertion device, 164 Branch destination read area insertion device, 165 Branch destination restoration instruction storage device, 166 Branch destination restoration instruction insertion device, 167 Branch instruction temporary change device, 168 Branch source storage device, 180 Converted program storage device, 191 conversion Completed program output device, 192 branch destination writing device, 300 computer, 410, 415, 416 target program, 420 converted program, 501 opcode, 502 operand, 511-516 branch instruction, 520 post-change branch instruction, 521-523 instruction 531 Next instruction, 40 template, 541 to 546 blank, 550 post-processing instruction, 610 pre-change branch destination table, 611 pre-change branch destination address, 612 address type, 613 branch direction, 614 branch number, 620 address correspondence table, 621 pre-change address, 622 Offset, 630 Branch destination table, 631 Changed branch destination address, 632 Branch destination label, 633 Disturbed branch destination information, 640 Assembly code before conversion, 650 Converted assembly code, 651 Changed part, 652 Added part, 661 Branch destination read instruction , 662 Target program after change, 663 Branch destination read area, 664 Authentication acquisition instruction, 665 Branch destination restore instruction, 666 Disturbed branch destination table, 670 Branch source table before change, 671 Branch source address before change, 901 Display device, 902 Keyboard, 903 mouse, 904 FDD, 905 CDD, 906 printer device, 907 scanner device, 910 system unit, 911 CPU, 912 bus, 913 ROM, 914 RAM, 915 communication device, 920 magnetic disk device, 921 OS, 922 window system 923 program group, 924 file group, 931 telephone, 932 facsimile machine, 940 Internet, 941 gateway, 942 LAN.

Claims (11)

情報を処理する処理装置と、対象プログラム入力装置と、分岐命令抽出装置と、分岐先取得装置と、分岐先テーブル生成装置と、変更分岐命令生成装置と、分岐命令変更装置と、変換済プログラム出力装置とを有し、
上記対象プログラム入力装置は、上記処理装置を用いて、変換の対象となるプログラムを入力して、対象プログラムとし、
上記分岐命令抽出装置は、上記処理装置を用いて、上記対象プログラム入力装置が入力した対象プログラムを解析し、分岐を指示する分岐命令を抽出して、変更前分岐命令とし、
上記分岐先取得装置は、上記処理装置を用いて、上記分岐命令抽出装置が抽出した変更前分岐命令が指示する分岐の分岐先を表わす情報を取得して、変更前分岐先情報とし、
上記分岐先テーブル生成装置は、上記処理装置を用いて、上記分岐先取得装置が取得した変更前分岐先情報に基づいて、分岐先テーブルを生成し、
上記変更分岐命令生成装置は、上記処理装置を用いて、分岐先を表わす情報を算出することを指示する分岐先算出命令と、上記分岐先算出命令を実行することにより算出される情報が表わす分岐先への分岐を指示する分岐命令とを含む変更後分岐命令を、上記分岐先テーブル生成装置が生成した分岐先テーブルに基づいて生成し、
上記分岐命令変更装置は、上記処理装置を用いて、上記対象プログラム入力装置が入力した対象プログラムのうち、上記分岐命令抽出装置が抽出した変更前分岐命令を、上記変更分岐命令生成装置が生成した変更後分岐命令に置き換え、
上記変換済プログラム出力装置は、上記処理装置を用いて、上記分岐命令変更装置が分岐命令を置き換えた対象プログラムを、変換済プログラムとして出力する
ことを特徴とするプログラム変換装置。
Processing device for processing information, target program input device, branch instruction extraction device, branch destination acquisition device, branch destination table generation device, modified branch instruction generation device, branch instruction change device, converted program output Having a device,
The target program input device uses the processing device to input a program to be converted into a target program,
The branch instruction extraction device analyzes the target program input by the target program input device using the processing device, extracts a branch instruction instructing a branch, and sets it as a branch instruction before change.
The branch destination acquisition device acquires information indicating the branch destination of the branch indicated by the branch instruction before change extracted by the branch instruction extraction device using the processing device, and sets the branch destination information before change as
The branch destination table generation device generates a branch destination table using the processing device based on the pre-change branch destination information acquired by the branch destination acquisition device,
The changed branch instruction generation device uses the processing device to branch a branch destination calculation instruction for instructing to calculate information representing a branch destination, and a branch represented by information calculated by executing the branch destination calculation instruction. A branch instruction after change including a branch instruction for instructing a branch to a destination is generated based on the branch destination table generated by the branch destination table generation device;
In the branch instruction change device, the change branch instruction generation device generates the pre-change branch instruction extracted by the branch instruction extraction device from the target program input by the target program input device using the processing device. Replace with branch instruction after change
The converted program output device outputs a target program in which the branch instruction change device has replaced a branch instruction as a converted program, using the processing device.
上記プログラム変換装置は、更に、分岐先挿入装置を有し、
上記分岐先挿入装置は、上記処理装置を用いて、上記分岐先テーブル生成装置が生成した分岐先テーブルを、上記対象プログラム入力装置が入力した対象プログラムに挿入し、
上記変更分岐命令生成装置は、上記処理装置を用いて、上記分岐先算出命令として、上記分岐先挿入装置が挿入した分岐先テーブルを参照して分岐先を表わす情報を算出する命令を生成する
ことを特徴とする請求項1に記載のプログラム変換装置。
The program conversion device further includes a branch destination insertion device,
The branch destination insertion device uses the processing device to insert the branch destination table generated by the branch destination table generation device into the target program input by the target program input device,
The modified branch instruction generation device generates an instruction for calculating information representing a branch destination by referring to the branch destination table inserted by the branch destination insertion device as the branch destination calculation instruction using the processing device. The program conversion apparatus according to claim 1.
上記プログラム変換装置は、更に、分岐先書出装置と、分岐先読込命令挿入装置とを有し、
上記分岐先書出装置は、上記処理装置を用いて、上記分岐先テーブル生成装置が生成した分岐先テーブルを書き出して、分岐先ファイルを生成し、
上記分岐先読込命令挿入装置は、上記処理装置を用いて、上記分岐先書出装置が生成した分岐先ファイルを読み込んで上記分岐先テーブルを取得することを指示する分岐先読込命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入し、
上記変更分岐命令生成装置は、上記処理装置を用いて、上記分岐先算出命令として、上記分岐先読込命令挿入装置が挿入した分岐先読込命令を実行することにより取得される分岐先テーブルを参照して分岐先を表わす情報を算出する命令を生成する
ことを特徴とする請求項1に記載のプログラム変換装置。
The program conversion device further includes a branch destination writing device and a branch destination read instruction insertion device,
The branch destination writing device uses the processing device to write the branch destination table generated by the branch destination table generation device to generate a branch destination file.
The branch destination read instruction insertion device uses the processing device to read a branch destination read instruction that instructs to read the branch destination file generated by the branch destination writing device and acquire the branch destination table. Insert it into the target program entered by the program input device,
The modified branch instruction generation device refers to a branch destination table obtained by executing the branch destination read instruction inserted by the branch destination read instruction insertion device as the branch destination calculation instruction using the processing device. The program conversion apparatus according to claim 1, wherein an instruction for calculating information indicating a branch destination is generated.
上記分岐先読込命令挿入装置は、上記処理装置を用いて、上記分岐先読込命令として、上記分岐先書出装置が生成した分岐先ファイルを、インターネットを介してダウンロードすることを指示する命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入する
ことを特徴とする請求項3に記載のプログラム変換装置。
The branch destination read instruction insertion device uses the processing device to instruct the branch destination file generated by the branch destination writing device as an instruction to download via the Internet as the branch destination read instruction. 4. The program conversion apparatus according to claim 3, wherein the program conversion apparatus is inserted into the target program input by the target program input apparatus.
上記プログラム変換装置は、更に、情報を記憶する記憶装置と、認証記憶装置と、認証取得命令挿入装置とを有し、
上記認証記憶装置は、上記記憶装置を用いて、上記対象プログラムを実行する権限があるか否かを認証するための認証情報を記憶し、
上記認証取得命令挿入装置は、上記処理装置を用いて、認証情報を取得することを指示する認証取得命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入し、
上記変更分岐命令生成装置は、上記処理装置を用いて、上記分岐先算出命令として、上記認証取得命令挿入装置が挿入した認証取得命令を実行することにより取得される認証情報と、上記分岐先テーブルとを参照して分岐先を表わす情報を算出する命令を、上記認証記憶装置が記憶した認証情報に基づいて生成する
ことを特徴とする請求項1乃至請求項4のいずれかに記載のプログラム変換装置。
The program conversion device further includes a storage device for storing information, an authentication storage device, and an authentication acquisition command insertion device,
The authentication storage device uses the storage device to store authentication information for authenticating whether or not there is an authority to execute the target program,
The authentication acquisition command insertion device uses the processing device to insert an authentication acquisition command instructing to acquire authentication information into the target program input by the target program input device,
The modified branch instruction generation device uses the processing device to obtain authentication information acquired by executing the authentication acquisition instruction inserted by the authentication acquisition instruction insertion device as the branch destination calculation instruction, and the branch destination table. 5. The program conversion according to claim 1, wherein an instruction for calculating information representing a branch destination with reference to is generated based on authentication information stored in the authentication storage device. apparatus.
上記プログラム変換装置は、更に、情報を記憶する記憶装置と、認証記憶装置と、認証取得命令挿入装置と、分岐先復元命令挿入装置とを有し、
上記認証記憶装置は、上記記憶装置を用いて、上記対象プログラムを実行する権限があるか否かを認証するための認証情報を記憶し、
上記分岐先テーブル生成装置は、上記処理装置を用いて、上記分岐先取得装置が取得した変更前分岐先情報に基づいて、分岐先テーブルを生成し、上記認証記憶装置が記憶した認証情報に基づいて、生成した分岐先テーブルを撹乱し、
上記認証取得命令挿入装置は、上記処理装置を用いて、認証情報を取得することを指示する認証取得命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入し、
上記分岐先復元命令挿入装置は、上記処理装置を用いて、上記認証取得命令挿入装置が挿入した認証取得命令を実行することにより取得される認証情報に基づいて上記分岐先テーブルを復元することを指示する分岐先復元命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入する
ことを特徴とする請求項1乃至請求項4のいずれかに記載のプログラム変換装置。
The program conversion device further includes a storage device for storing information, an authentication storage device, an authentication acquisition command insertion device, and a branch destination restoration command insertion device,
The authentication storage device uses the storage device to store authentication information for authenticating whether or not there is an authority to execute the target program,
The branch destination table generation device generates a branch destination table based on the pre-change branch destination information acquired by the branch destination acquisition device using the processing device, and based on the authentication information stored in the authentication storage device. Disturb the generated branch destination table,
The authentication acquisition command insertion device uses the processing device to insert an authentication acquisition command instructing to acquire authentication information into the target program input by the target program input device,
The branch destination restoration command insertion device restores the branch destination table based on authentication information acquired by executing the authentication acquisition command inserted by the authentication acquisition command insertion device using the processing device. 5. The program conversion apparatus according to claim 1, wherein a branch destination restoration instruction to be instructed is inserted into a target program input by the target program input apparatus.
上記認証取得命令挿入装置は、上記処理装置を用いて、上記認証取得命令として、パスワードを入力することを指示するパスワード入力命令と、上記パスワード入力命令を実行することにより入力されるパスワードに基づいて認証情報を算出することを指示する認証算出命令とを、上記対象プログラム入力装置が入力した対象プログラムに挿入する
ことを特徴とする請求項5または請求項6に記載のプログラム変換装置。
The authentication acquisition command insertion device uses the processing device as the authentication acquisition command based on a password input command for inputting a password and a password input by executing the password input command. 7. The program conversion apparatus according to claim 5, wherein an authentication calculation command for instructing to calculate authentication information is inserted into a target program input by the target program input apparatus.
上記認証取得命令挿入装置は、上記処理装置を用いて、上記認証取得命令として、変換済プログラムを実行するコンピュータが有する装置情報を取得することを指示する装置情報取得命令と、上記装置情報取得命令を実行することにより取得される装置情報に基づいて認証情報を算出することを指示する認証算出命令とを、上記対象プログラム入力装置が入力した対象プログラムに挿入する
ことを特徴とする請求項5または請求項6に記載のプログラム変換装置。
The authentication acquisition command insertion device uses, as the authentication acquisition command, the device information acquisition command for instructing acquisition of device information included in a computer that executes the converted program, and the device information acquisition command. 6. An authentication calculation command for instructing calculation of authentication information based on device information acquired by executing the command is inserted into the target program input by the target program input device. The program conversion apparatus according to claim 6.
上記プログラム変換装置は、更に、情報を記憶する記憶装置と、認証記憶装置と、認証取得命令挿入装置とを有し、
上記認証記憶装置は、上記記憶装置を用いて、上記対象プログラムを実行する権限があるか否かを認証するための認証情報を記憶し、
上記分岐先テーブル生成装置は、上記処理装置を用いて、上記分岐先取得装置が取得した変更前分岐先情報に基づいて、上記変換済プログラムにおける分岐の分岐先を表わす情報を算出して、変更後分岐先情報とし、上記認証記憶装置が記憶した認証情報に基づいて、算出した変更後分岐先情報を撹乱して、撹乱分岐先情報を生成し、生成した撹乱分岐先情報に基づいて、分岐先テーブルを生成し、
上記認証取得命令挿入装置は、上記処理装置を用いて、認証情報を取得することを指示する認証取得命令を、上記対象プログラム入力装置が入力した対象プログラムに挿入し、
上記変更分岐命令生成装置は、上記処理装置を用いて、上記分岐先テーブル生成装置が生成した分岐先テーブルを参照して撹乱分岐先情報を取得し、上記分岐先算出命令として、取得した撹乱分岐先情報を含み、上記認証取得命令を実行することにより取得される認証情報と、上記撹乱分岐先情報とに基づいて、分岐先を表わす情報を算出する命令を生成する
ことを特徴とする請求項1に記載のプログラム変換装置。
The program conversion device further includes a storage device for storing information, an authentication storage device, and an authentication acquisition command insertion device,
The authentication storage device uses the storage device to store authentication information for authenticating whether or not there is an authority to execute the target program,
The branch destination table generation device uses the processing device to calculate information representing the branch destination of the branch in the converted program based on the pre-change branch destination information acquired by the branch destination acquisition device, and Based on the authentication information stored in the authentication storage device as post-branch destination information, the calculated post-change branch destination information is disturbed to generate disturbed branch destination information, and the branch is made based on the generated disturbed branch destination information. Generate the destination table,
The authentication acquisition command insertion device uses the processing device to insert an authentication acquisition command instructing to acquire authentication information into the target program input by the target program input device,
The modified branch instruction generation device acquires disturbed branch destination information with reference to the branch destination table generated by the branch destination table generation device using the processing device, and acquires the disturbed branch acquired as the branch destination calculation instruction. A command for calculating information representing a branch destination is generated based on the authentication information including the destination information and acquired by executing the authentication acquisition command and the disturbance branch destination information. The program conversion apparatus according to 1.
請求項1乃至請求項9のいずれかに記載のプログラム変換装置として、コンピュータを機能させることを特徴とするプログラム。   A program that causes a computer to function as the program conversion device according to any one of claims 1 to 9. 情報を処理する処理装置を有するコンピュータが、対象プログラムを変換するプログラム変換方法において、
上記処理装置が、変換の対象となるプログラムを入力して、対象プログラムとし、
上記処理装置が、入力した対象プログラムを解析し、分岐を指示する分岐命令を抽出して、変更前分岐命令とし、
上記処理装置が、抽出した変更前分岐命令が指示する分岐の分岐先を表わす情報を取得して、変更前分岐先情報とし、
上記処理装置が、取得した変更前分岐先情報に基づいて、分岐先テーブルを生成し、
上記処理装置が、分岐先を表わす情報を算出することを指示する分岐先算出命令と、上記分岐先算出命令を実行することにより算出される情報が表わす分岐先への分岐を指示する分岐命令とを含む変更後分岐命令を、生成した分岐先テーブルに基づいて生成し、
上記処理装置が、入力した対象プログラムのうち、抽出した変更前分岐命令を、生成した変更後分岐命令に置き換え、
上記処理装置が、分岐命令を置き換えた対象プログラムを、変換済プログラムとして出力する
ことを特徴とするプログラム変換方法。
In a program conversion method in which a computer having a processing device for processing information converts a target program,
The processing device inputs a program to be converted into a target program,
The above processing device analyzes the input target program, extracts a branch instruction instructing a branch, and sets it as a branch instruction before change,
The processing device acquires information indicating the branch destination of the branch indicated by the extracted pre-change branch instruction, and sets it as pre-change branch destination information,
The processing device generates a branch destination table based on the acquired pre-change branch destination information,
A branch destination calculation instruction for instructing the processor to calculate information representing the branch destination; a branch instruction for instructing a branch to the branch destination represented by the information calculated by executing the branch destination calculation instruction; Generate a post-change branch instruction that includes, based on the generated branch destination table,
The above processing device replaces the extracted pre-change branch instruction in the input target program with the generated post-change branch instruction,
A program conversion method, wherein the processing device outputs a target program in which a branch instruction is replaced as a converted program.
JP2007279443A 2007-10-26 2007-10-26 Program conversion apparatus, program, and program conversion method Expired - Fee Related JP4989418B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007279443A JP4989418B2 (en) 2007-10-26 2007-10-26 Program conversion apparatus, program, and program conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007279443A JP4989418B2 (en) 2007-10-26 2007-10-26 Program conversion apparatus, program, and program conversion method

Publications (2)

Publication Number Publication Date
JP2009110113A true JP2009110113A (en) 2009-05-21
JP4989418B2 JP4989418B2 (en) 2012-08-01

Family

ID=40778570

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007279443A Expired - Fee Related JP4989418B2 (en) 2007-10-26 2007-10-26 Program conversion apparatus, program, and program conversion method

Country Status (1)

Country Link
JP (1) JP4989418B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011113435A (en) * 2009-11-30 2011-06-09 Fujitsu Ltd Data distribution device, data distribution method, and information processor
JP2012530447A (en) * 2009-06-16 2012-11-29 ケーティー コーポレーション General-purpose subscriber identification module authentication method and system
WO2014125639A1 (en) * 2013-02-18 2014-08-21 三菱電機株式会社 Control program management apparatus, controller apparatus, and control system
JP7031070B1 (en) * 2021-02-19 2022-03-07 三菱電機株式会社 Program processing device, program processing method, and program
JP7436848B2 (en) 2020-09-23 2024-02-22 東芝情報システム株式会社 FFU inspection device and FFU inspection program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09288581A (en) * 1996-04-19 1997-11-04 Toshiba Corp Device and method for generating object
JP2004185064A (en) * 2002-11-29 2004-07-02 Matsushita Electric Ind Co Ltd Device and method for making program difficult to read
JP2005085188A (en) * 2003-09-11 2005-03-31 Fujitsu Ltd Program protection method, program protection program, and program protection device
WO2006115219A1 (en) * 2005-04-21 2006-11-02 Matsushita Electric Industrial Co., Ltd. Program illegiblizing device and method
JP2009104589A (en) * 2007-10-05 2009-05-14 Canon Inc Information processor and its method, program, and recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09288581A (en) * 1996-04-19 1997-11-04 Toshiba Corp Device and method for generating object
JP2004185064A (en) * 2002-11-29 2004-07-02 Matsushita Electric Ind Co Ltd Device and method for making program difficult to read
JP2005085188A (en) * 2003-09-11 2005-03-31 Fujitsu Ltd Program protection method, program protection program, and program protection device
WO2006115219A1 (en) * 2005-04-21 2006-11-02 Matsushita Electric Industrial Co., Ltd. Program illegiblizing device and method
JP2009104589A (en) * 2007-10-05 2009-05-14 Canon Inc Information processor and its method, program, and recording medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012530447A (en) * 2009-06-16 2012-11-29 ケーティー コーポレーション General-purpose subscriber identification module authentication method and system
JP2011113435A (en) * 2009-11-30 2011-06-09 Fujitsu Ltd Data distribution device, data distribution method, and information processor
WO2014125639A1 (en) * 2013-02-18 2014-08-21 三菱電機株式会社 Control program management apparatus, controller apparatus, and control system
JP7436848B2 (en) 2020-09-23 2024-02-22 東芝情報システム株式会社 FFU inspection device and FFU inspection program
JP7031070B1 (en) * 2021-02-19 2022-03-07 三菱電機株式会社 Program processing device, program processing method, and program
WO2022176164A1 (en) * 2021-02-19 2022-08-25 三菱電機株式会社 Program processing device, program processing method, and program

Also Published As

Publication number Publication date
JP4989418B2 (en) 2012-08-01

Similar Documents

Publication Publication Date Title
JP4806402B2 (en) Program obfuscation apparatus and obfuscation method
JP4989418B2 (en) Program conversion apparatus, program, and program conversion method
Crowley-Milling et al. The NODAL System for the SPS
JP6003699B2 (en) Test data generation program, method and apparatus
CN101853357A (en) Software protection method
JP2015204065A (en) Test case generation device and test case generation method
JP5440287B2 (en) Symbolic execution support program, method and apparatus
KR20180129623A (en) Apparatus for statically analyzing assembly code including assoxiated multi files
WO2017204139A1 (en) Data processing apparatus, data processing method, and program recording medium
JP2008197897A (en) Test pattern generation apparatus and generation method
CN113076548A (en) Robot automation process account information processing method and device
JP5550578B2 (en) Entry rewriting device and entry rewriting program
CN112543104A (en) Application program packaging method and device, electronic equipment and storage medium
JP2021103354A (en) Program testing method
CN109460640A (en) A kind of java applet guard method, device, equipment and readable storage medium storing program for executing
JP6748357B2 (en) Analysis device, analysis program, and analysis method
JP6752347B1 (en) Information processing equipment, computer programs and information processing methods
CN112363708B (en) Context protection method and system under Eclipse supporting tool
JP5508933B2 (en) Software specification proof support apparatus and proof support method
US9965621B2 (en) Program protection device
CN111475152B (en) Code processing method and device
CN112541188B (en) Method and device for preventing application program code from being statically analyzed
KR100958784B1 (en) Device and method of applying polymorphism application program
JP2007041777A (en) Language processing method
JP2004326237A (en) Test case creation device, test case creation method, test case, and test method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100908

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120314

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: 20120403

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120427

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees