KR102203200B1 - Apparatus for deobfuscation and method for the same - Google Patents

Apparatus for deobfuscation and method for the same Download PDF

Info

Publication number
KR102203200B1
KR102203200B1 KR1020190055689A KR20190055689A KR102203200B1 KR 102203200 B1 KR102203200 B1 KR 102203200B1 KR 1020190055689 A KR1020190055689 A KR 1020190055689A KR 20190055689 A KR20190055689 A KR 20190055689A KR 102203200 B1 KR102203200 B1 KR 102203200B1
Authority
KR
South Korea
Prior art keywords
program
obfuscation
original
obfuscated
unit
Prior art date
Application number
KR1020190055689A
Other languages
Korean (ko)
Other versions
KR20200131383A (en
Inventor
이동훈
석재혁
Original Assignee
고려대학교 산학협력단
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 고려대학교 산학협력단 filed Critical 고려대학교 산학협력단
Priority to KR1020190055689A priority Critical patent/KR102203200B1/en
Publication of KR20200131383A publication Critical patent/KR20200131383A/en
Application granted granted Critical
Publication of KR102203200B1 publication Critical patent/KR102203200B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Storage Device Security (AREA)

Abstract

역난독화 장치 및 방법에 관한 것으로, 역난독화 장치는 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 분석부 및 상기 분석부가 획득한 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 복원부를 포함할 수 있다.It relates to an apparatus and method for de-obfuscation, wherein the de-obfuscation apparatus analyzes the obfuscated program obtained by obfuscation of the original program and obtains information on the original program, and the analysis unit is based on the information obtained by the analysis unit. As a result, it may include a restoration unit for obtaining a result program corresponding to the original program.

Description

역난독화 장치 및 방법{APPARATUS FOR DEOBFUSCATION AND METHOD FOR THE SAME}DEOBFUSCATION AND METHOD FOR THE SAME {APPARATUS FOR DEOBFUSCATION AND METHOD FOR THE SAME}

본 발명은 역난독화 장치 및 방법에 관한 것이다.The present invention relates to a de-obfuscation apparatus and method.

위조 및 변조 방지 소프트웨어(anti-tamper software, tamper-resistant software)란 프로그램(이하 원 프로그램)의 분석 및 변조를 어렵게 하기 위하여 프로그램을 소정의 방법에 의해 변형하는 소프트웨어(프로그램 등을 포함할 수 있다. 이하 프로그램은 앱이나 애플리케이션 등으로도 지칭 가능하다)를 의미한다. 위조 및 변조 방지 소프트웨어는 원 프로그램을 무단으로 분석하여 취약점을 발견하거나, 프로그램에 불법적인 코드(예를 들어, 크래킹용 코드)를 삽입하거나 또는 프로그램의 복제 방지 수단(예를 들어, 디지털 권리 관리(DRM, Digital Right Management))을 무력화하는 등과 같은 행위를 방지하기 위해 이용된다.Forgery and tamper-resistant software (anti-tamper software, tamper-resistant software) may include software (program, etc.) that transforms a program by a predetermined method in order to make it difficult to analyze and alter the program (hereinafter, the original program). Hereinafter, a program may also be referred to as an app or an application). Anti-counterfeiting and tampering software detects vulnerabilities by analyzing the original program without permission, inserts illegal code (for example, cracking code) into the program, or prevents copying of the program (for example, digital rights management ( It is used to prevent actions such as neutralizing DRM, Digital Right Management)).

통상적인 위조 및 변조 방지 소프트웨어는 능동적인 방법 또는 수동적인 방법을 이용하여 위조 및 변조를 방지하도록 하는데, 여기서 능동적인 방법은 원 프로그램이 변조된 경우 실행이 불가능하게 만드는 것이고, 수동적인 방법은 원 프로그램을 난독화(obfuscation)하여 원 프로그램 자체의 분석을 어렵게 하는 것이다.Conventional anti-counterfeiting and tampering software uses an active or passive method to prevent forgery and tampering, where the active method is to make it impossible to execute when the original program is altered, and the passive method is to This makes it difficult to analyze the original program itself by obfuscation.

난독화 기법이란 프로그램의 기능을 유지하면서 자료 구조나 제어 흐름을 변형함으로써 프로그램 분석자가 원 프로그램을 분석하기 어렵게 하는 방법을 의미한다. 따라서, 이러한 난독화 기법을 이용하면 프로그램의 무단 변조나 복제 방지 수단의 무력화를 어느 정도는 차단할 수 있게 된다. The obfuscation technique refers to a method that makes it difficult for a program analyst to analyze the original program by modifying the data structure or control flow while maintaining the function of the program. Therefore, by using such an obfuscation technique, it is possible to block unauthorized alteration of a program or incapacitation of the copy prevention means to some extent.

그러나, 최근에는 난독화 기법을 악의적인 목적으로 사용하는 경우가 점점 증가하고 있다. 예를 들어, 악성 코드에 난독화 기법을 적용시켜 안티 바이러스 소프트웨어(antivirus software)나 악성 코드 분석자가 악성 코드를 용이하게 검출하지 못하도록 하는 것이다. 이러한 경우, 난독화된 악성 코드의 검출에 성공하였다고 하더라도, 악성 코드에 대한 역난독화를 수행해야 하기 때문에 악성 코드 분석의 난도가 증가하여 악성 코드에 대해 효과적으로 대체하는 것이 어렵게 된다. 더구나, 상용 난독화 툴은 쉽게 획득할 수 있을 뿐만 아니라 자동적 난독화를 제공하여 보다 편리하게 원 프로그램(악성 코드 등)을 난독화시킬 수 있게 되었다. 이러한 이유로, 난독화된 악성 코드의 수는 증가하고 있으며, 이는 악성 코드 분석자의 업무를 더욱 어렵게 하고 있다.However, in recent years, the obfuscation technique is increasingly used for malicious purposes. For example, by applying obfuscation techniques to malicious codes, antivirus software or malicious code analysts cannot easily detect malicious codes. In this case, even if the obfuscated malicious code is successfully detected, it is difficult to effectively replace the malicious code because the difficulty of analyzing the malicious code increases because the malicious code must be de-obfuscated. Moreover, commercial obfuscation tools are not only easy to obtain, but also provide automatic obfuscation, making it possible to obfuscate the original program (malware, etc.) more conveniently. For this reason, the number of obfuscated malicious codes is increasing, which makes the work of malicious code analysts more difficult.

대한민국 등록특허 제1861341호 (2018.05.18.)Korean Patent Registration No. 1861341 (2018.05.18.) 대한민국 등록특허 제1920597호 (2018.11.14.)Korean Patent Registration No. 1920597 (2018.11.14.)

본 발명은 난독화된 프로그램 등을 용이하고 효과적으로 역난독화할 수 있는 역난독화 장치 및 방법을 제공하는 것을 해결하고자 하는 과제로 한다.An object of the present invention is to provide an apparatus and method for de-obfuscation that can easily and effectively de-obfuscate obfuscated programs.

상술한 과제를 해결하기 위하여 역난독화 장치 및 방법이 제공된다.In order to solve the above-described problems, an apparatus and method for de-obfuscation are provided.

역난독화 장치는 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 분석부 및 상기 분석부가 획득한 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 복원부를 포함할 수 있다.The de-obfuscation apparatus analyzes the obfuscated program obtained by obfuscation of the original program and obtains information on the original program, and a result program corresponding to the original program based on the information obtained by the analysis unit. It may include a restoration unit to obtain.

상기 분석부는 상기 난독화된 프로그램으로부터 임포트 주소 테이블을 탐지하여 상기 임포트 주소 테이블의 위치를 결정하고, 상기 복원부는 상기 임포트 주소 테이블의 위치를 이용하여 임포트 주소 테이블을 획득할 수 있다.The analysis unit may detect the import address table from the obfuscated program to determine the location of the import address table, and the restoration unit may obtain the import address table using the location of the import address table.

상기 복원부는 상기 임포트 주소 테이블을 기반으로 임포트 디렉터리 테이블을 구축할 수 있다.The restoration unit may build an import directory table based on the import address table.

상기 분석부는 적어도 하나의 프로그램을 수신하고, 상기 프로그램이 난독화된 프로그램인지 여부를 원 프로그램의 난독화에 이용된 난독화 툴의 내제적 특징을 기반으로 판단할 수 있다.The analysis unit may receive at least one program and determine whether the program is an obfuscated program based on an inherent characteristic of an obfuscation tool used to obfuscate the original program.

상기 분석부는 원시 코드 및 원시 데이터 중 적어도 하나를 추출하고, 상기 복원부는 상기 원시 코드 및 상기 원시 데이터 중 적어도 하나를 패치할 수 있다.The analysis unit may extract at least one of the original code and the original data, and the restoration unit may patch at least one of the original code and the original data.

상기 분석부는 난독화된 프로그램의 실행 시 멀티 스레드 기반 분석 방지 코드의 구동을 감지하여 분석 방지 옵션의 적용 여부를 판단하거나, 상기 난독화된 프로그램의 난독화에 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부를 판단하고, 만약 응용 프로그래밍 인터페이스 래핑 옵션이 적용되었다면, 원래의 응용 프로그래밍 인터페이스 주소를 획득하거나, 직접 호출/점프 명령문의 간접 주소를 확인하거나, 또는 원시 엔트리 포인트를 확인함으로써, 상기 원 프로그램에 대한 정보를 획득할 수 있다.The analysis unit determines whether to apply the analysis prevention option by detecting the operation of the multi-thread-based analysis prevention code when the obfuscated program is executed, or determines whether the application programming interface wrapping option is applied to the obfuscation of the obfuscated program. And, if the application programming interface wrapping option is applied, information on the original program is obtained by obtaining the original application programming interface address, checking the indirect address of a direct call/jump statement, or checking the original entry point. can do.

상기 복원부는 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 여부를 판단하고, 판단 결과에 따라서 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압출 해제를 수행하거나, 상기 직접 호출/점프 명령문의 간접 주소를 기반으로 상기 직접 호출/점프 명령문을 수정하여 간접 호출/점프 명령문을 획득하거나, 또는 상기 원시 엔트리 포인트를 패치할 수 있다.The restoration unit determines whether to compress at least one of the code section and the data section, and performs extrusion decompression for at least one of the code section and the data section according to the determination result, or based on the indirect address of the direct call/jump command. As a result, the direct call/jump statement may be modified to obtain the indirect call/jump statement, or the original entry point may be patched.

역난독화 방법은 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계 및 획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계를 포함할 수 있다.The de-obfuscation method includes analyzing the obfuscated program obtained by obfuscation of the original program to obtain information on the original program, and obtaining a result program corresponding to the original program based on the obtained information. It may include.

상기 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계는 상기 난독화된 프로그램으로부터 임포트 주소 테이블을 탐지하여 상기 임포트 주소 테이블의 위치를 결정하는 단계를 포함하고, 상기 획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계는 상기 임포트 주소 테이블의 위치를 이용하여 임포트 주소 테이블을 획득하는 단계를 포함할 수 있다.The step of obtaining information on the original program by analyzing the obfuscated program obtained by obfuscation of the original program includes determining the location of the import address table by detecting an import address table from the obfuscated program. And obtaining a result program corresponding to the original program based on the obtained information may include obtaining an import address table using a position of the import address table.

상기 획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계는 상기 임포트 주소 테이블을 기반으로 임포트 디렉터리 테이블을 구축하는 단계를 더 포함할 수 있다.Obtaining a result program corresponding to the original program based on the obtained information may further include building an import directory table based on the import address table.

상기 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계는 적어도 하나의 프로그램을 수신하는 단계 및 상기 프로그램이 난독화된 프로그램인지 여부를 원 프로그램의 난독화에 이용된 난독화 툴의 내제적 특징을 기반으로 판단하는 단계를 포함할 수 있다.The step of obtaining information on the original program by analyzing the obfuscated program obtained by obfuscation of the original program includes receiving at least one program and determining whether the program is an obfuscated program. It may include the step of determining based on the inherent characteristics of the obfuscation tool used for the speech.

상기 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계는 원시 코드 및 원시 데이터 중 적어도 하나를 추출하는 단계를 포함하고, 상기 획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계는 상기 원시 코드 및 상기 원시 데이터 중 적어도 하나를 패치하는 단계를 포함할 수 있다.The step of obtaining information on the original program by analyzing the obfuscated program obtained by obfuscation of the original program includes extracting at least one of the original code and the original data, and based on the obtained information Obtaining a result program corresponding to the original program may include patching at least one of the original code and the original data.

상기 원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계는 난독화된 프로그램의 실행 시 멀티 스레드 기반 분석 방지 코드의 구동을 감지하여 분석 방지 옵션의 적용 여부를 판단하는 단계, 상기 난독화된 프로그램의 난독화에 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부를 판단하고, 만약 응용 프로그래밍 인터페이스 래핑 옵션이 적용되었다면, 원래의 응용 프로그래밍 인터페이스 주소를 획득하는 단계, 직접 호출/점프 명령문의 간접 주소를 확인하는 단계 및 원시 엔트리 포인트를 확인함으로써, 상기 원 프로그램에 대한 정보를 획득하는 단계 중 적어도 하나를 포함할 수 있다.The step of obtaining information on the original program by analyzing the obfuscated program obtained by obfuscation of the original program is to apply the analysis prevention option by detecting the operation of the multi-thread-based analysis prevention code when the obfuscated program is executed. Determining whether the application programming interface wrapping option is applied to the obfuscation of the obfuscated program, and if the application programming interface wrapping option is applied, obtaining the original application programming interface address, direct call It may include at least one of confirming the indirect address of the /jump instruction and obtaining information on the original program by confirming the original entry point.

상기 획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계는 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 여부를 판단하고, 판단 결과에 따라서 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압출 해제를 수행하는 단계, 상기 직접 호출/점프 명령문의 간접 주소를 기반으로 상기 직접 호출/점프 명령문을 수정하여 간접 호출/점프 명령문을 획득하는 단계 및 상기 원시 엔트리 포인트를 패치하는 단계 중 적어도 하나를 포함할 수 있다.In the step of obtaining a result program corresponding to the original program based on the obtained information, it is determined whether at least one of the code section and the data section is compressed, and according to the determination result, at least one of the code section and the data section is At least one of: performing an extrusion release for the direct call/jump command, obtaining an indirect call/jump statement by modifying the direct call/jump statement based on the indirect address of the direct call/jump statement, and patching the original entry point It may include.

상술한 역난독화 장치 및 방법에 의하면, 난독화된 프로그램 등을 효율적이면서 용이하고 효과적으로 역난독화할 수 있고, 이에 따라 난독화된 프로그램의 분석 용이성을 증가시킬 수 있는 효과를 얻을 수 있다.According to the above-described de-obfuscation apparatus and method, it is possible to efficiently, easily and effectively de-obfuscate obfuscated programs, and thus, it is possible to obtain an effect of increasing the ease of analysis of obfuscated programs.

또한, 난독화된 프로그램 등의 역난독화 성공 가능성을 높일 수 있을 뿐만 아니라, 난독화 툴 등의 역난독화 또는 분석 소요 시간을 효과적으로 단축할 수 있게 되는 효과를 얻을 수도 있다.In addition, it is possible to increase the likelihood of success in de-obfuscation of obfuscated programs and the like, and to effectively shorten the time required for de-obfuscation or analysis of obfuscation tools.

또한, 보다 용이하게 난독화된 코드 등의 역난독화를 수행할 수 있게 되어 전문가 또는 비전문가의 역난독화 편의성이 개선되는 효과도 얻을 수 있게 되고, 악성 코드 등의 검출 및 분석을 보다 용이하게 수행할 수 있게 되는 효과도 얻을 수 있다.In addition, it is possible to perform de-obfuscation of obfuscated codes more easily, so that the convenience of de-obfuscation of experts or non-experts can be improved, and malicious code can be detected and analyzed more easily. You can also get the effect of being able to do it.

본 발명의 상세한 설명에서 인용되는 도면을 보다 충분히 이해하기 위하여 각 도면의 상세한 설명이 제공된다.
도 1은 역난독화 장치를 설명하기 위한 전체 블록도이다.
도 2는 난독화된 프로그램의 실행 시의 제어 흐름을 설명하기 위한 도면이다.
도 3a 및 도 3b는 난독화 툴의 일례로 더미다의 규칙의 일부를 설명하기 위한 제1 도 및 제2 도이다.
도 4는 분석부의 일 실시예에 대한 블록도이다.
도 5는 복원부의 일 실시예에 대한 블록도이다.
도 6은 역난독화 방법의 일 실시예에 대한 흐름도이다.
도 7은 난독화된 프로그램의 분석 방법의 일 실시예에 대한 흐름도이다.
도 8은 결과 프로그램의 복원 방법의 일 실시예에 대한 흐름도이다.
Detailed description of each drawing is provided in order to more fully understand the drawings cited in the detailed description of the present invention.
1 is an overall block diagram for explaining an apparatus for de-obfuscation.
2 is a diagram for explaining a control flow when an obfuscated program is executed.
3A and 3B are FIGS. 1 and 2 for explaining a part of rules of a dummy as an example of an obfuscation tool.
4 is a block diagram of an embodiment of an analysis unit.
5 is a block diagram of an embodiment of a restoration unit.
6 is a flowchart of an embodiment of a de-obfuscation method.
7 is a flowchart of an example of a method for analyzing an obfuscated program.
8 is a flowchart of an embodiment of a method for restoring a result program.

이하 명세서 전체에서 동일 참조 부호는 특별한 사정이 없는 한 동일 구성요소를 지칭한다. 이하에서 사용되는 '부'가 부가된 용어는, 소프트웨어 또는 하드웨어로 구현될 수 있으며, 실시예에 따라 하나의 '부'가 하나의 물리적 또는 논리적 부품으로 구현되거나, 복수의 '부'가 하나의 물리적 또는 논리적 부품으로 구현되거나, 하나의 '부'가 복수의 물리적 또는 논리적 부품들로 구현되는 것도 가능하다.In the following specification, the same reference numerals refer to the same elements unless otherwise specified. The term "unit" used below may be implemented in software or hardware, and according to an embodiment, one "unit" is implemented as one physical or logical part, or a plurality of "units" It may be implemented as a physical or logical part, or one'unit' may be implemented as a plurality of physical or logical parts.

명세서 전체에서 어떤 부분이 다른 부분과 연결되어 있다고 할 때, 이는 어떤 부분과 다른 부분에 따라서 물리적 연결을 의미할 수도 있고, 또는 전기적으로 연결된 것을 의미할 수도 있다. 또한, 어떤 부분이 다른 부분을 포함한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 부분 이외의 또 다른 부분을 제외하는 것이 아니며, 설계자의 선택에 따라서 또 다른 부분을 더 포함할 수 있음을 의미한다. 한편, 단수의 표현은 문맥상 명백하게 예외가 있지 않는 한, 복수의 표현을 포함할 수 있다.When a part is said to be connected to another part throughout the specification, it may mean a physical connection depending on the part and another part, or may mean electrically connected. In addition, when a part includes another part, this does not exclude another part other than the other part unless otherwise stated, and it means that another part may be included further according to the designer's choice. do. On the other hand, expressions in the singular number may include plural expressions unless there is clearly an exception in the context.

이하, 도 1 내지 도 5를 참조하여 역난독화 장치의 일 실시예에 대해 설명한다.Hereinafter, an embodiment of the de-obfuscation apparatus will be described with reference to FIGS. 1 to 5.

도 1은 역난독화 장치를 설명하기 위한 전체 블록도이다.1 is an overall block diagram for explaining an apparatus for de-obfuscation.

도 1을 참조하면, 역난독화 장치(70)는 원래의 프로그램(1, 이하 원 프로그램)을 난독화하여 획득된 난독화된 프로그램(2)을 역난독화 할 수 있는 장치를 의미한다. 여기서, 원 프로그램(1) 및/또는 난독화된 프로그램(2)은 프로그램 코드를 포함할 수 있으며, 필요에 따라 데이터 등도 포함할 수 있다. 원 프로그램(1) 및/또는 난독화된 프로그램(2)은 적어도 하나의 컴퓨터 파일 형태로 구현될 수 있으며, 컴퓨터 파일은 소정의 형식(포맷)으로 저장된 것일 수 있다. 여기서 포맷은 포터블 실행(PE, Portable Executable) 포맷을 포함할 수 있으나, 이에 한정되는 것은 아니다.Referring to FIG. 1, the de-obfuscation device 70 refers to a device capable of de-obfuscation of the obfuscated program 2 obtained by obfuscating an original program (1, hereinafter, the original program). Here, the original program (1) and/or the obfuscated program (2) may include a program code, and may include data or the like as necessary. The original program 1 and/or the obfuscated program 2 may be implemented in the form of at least one computer file, and the computer file may be stored in a predetermined format (format). Here, the format may include a portable executable (PE) format, but is not limited thereto.

역난독화 장치(70)는 프로세서(80) 및 메모리 장치(90)를 포함하는 정보 처리 장치일 수 있다. 정보 처리 장치는 각종 연산 및/또는 제어 등을 수행할 수 있는 전자 장치 등을 포함할 수 있다. 예를 들어, 정보 처리 장치는 데스크톱 컴퓨터, 랩톱 컴퓨터, 서버용 컴퓨터, 스마트 폰, 태블릿 피씨, 스마트 시계, 휴대용 게임기, 인공지능 음향 재생 장치, 내비게이션 장치, 두부 장착형 디스플레이(HMD, Head Mounted Display) 장치, 디지털 텔레비전, 셋톱 박스, 차량, 가전 기기 또는 개인용 디지털 보조기(PDA, Personal Digital Assistant) 등과 같이 정보 처리가 가능한 장치 중 적어도 하나를 포함할 수 있다.The de-obfuscation device 70 may be an information processing device including a processor 80 and a memory device 90. The information processing device may include an electronic device capable of performing various operations and/or controls. For example, the information processing device includes a desktop computer, a laptop computer, a server computer, a smart phone, a tablet PC, a smart watch, a portable game machine, an artificial intelligence sound reproducing device, a navigation device, a head mounted display (HMD) device, It may include at least one of devices capable of processing information, such as a digital television, a set-top box, a vehicle, a home appliance, or a personal digital assistant (PDA).

프로세서(80)는 역난독화 장치(70)의 전반적인 또는 일부의 동작에 필요한 연산, 처리, 제어 및/또는 프로그램의 해석 동작 등을 수행할 수 있다. 예를 들어, 프로세서(80)는 난독화된 프로그램(2)을 분석하고, 필요에 따라 분석 결과를 기반으로 원 프로그램(1)에 대응되는 역난독화된 프로그램(이하, 결과 프로그램)을 획득할 수도 있다. 여기서, 결과 프로그램은 원 프로그램(1)과 동일하거나 또는 극히 유사한 프로그램을 포함할 수 있다.The processor 80 may perform an operation, processing, control, and/or analysis of a program necessary for the overall or partial operation of the de-obfuscation apparatus 70. For example, the processor 80 analyzes the obfuscated program 2 and, if necessary, obtains a deobfuscated program corresponding to the original program 1 (hereinafter, the result program) based on the analysis result. May be. Here, the resulting program may include a program identical to or very similar to the original program (1).

프로세서(80)는 미리 임베디드된 프로그램을 구동시키거나 및/또는 메모리 장치(90)에 저장된 프로그램을 구동시켜 소정의 동작을 수행할 수 있다. 여기서, 메모리 장치(90)에 저장된 프로그램은 설계자로부터 직접 저장된 것일 수도 있고, 또는 유무선 통신 네트워크를 통해 접속 가능한 전자 소프트웨어 유통망을 통하여 획득된 것일 수도 있다. The processor 80 may execute a pre-embedded program and/or a program stored in the memory device 90 to perform a predetermined operation. Here, the program stored in the memory device 90 may be stored directly from a designer, or may be acquired through an electronic software distribution network accessible through a wired or wireless communication network.

프로세서(80)는 중앙 처리 장치(CPU, Central Processing Unit), 마이크로 컨트롤러 유닛(MCU, Micro Controller Unit), 마이컴(Micom, Micro Processor), 애플리케이션 프로세서(AP, Application Processor), 전자 제어 유닛(ECU, Electronic Controlling Unit) 및/또는 각종 연산 처리 및 제어 신호의 생성이 가능한 다른 전자 장치 등을 이용하여 구현 가능하다. 실시예에 따라, 프로세서(80)는 하나의 물리적 장치를 이용하여 구현될 수도 있고, 또는 둘 이상의 물리적 장치를 이용하여 구현될 수도 있다.The processor 80 is a central processing unit (CPU), a microcontroller unit (MCU), a microprocessor (Micom), an application processor (AP), an electronic control unit (ECU), Electronic Controlling Unit) and/or other electronic devices capable of processing various operations and generating control signals. Depending on the embodiment, the processor 80 may be implemented using one physical device, or may be implemented using two or more physical devices.

일 실시예에 의하면, 프로세서(80)는 역난독화부(100)를 포함할 수 있다. 역난독화부(100)는 난독화된 프로그램(2)을 분석하고, 필요에 따라 분석 결과에 따른 결과 프로그램을 생성함으로써 난독화된 프로그램(2)에 대한 역난독화를 수행한다. 역난독화부(100)는 사용자의 조작에 따라 수동으로 및/또는 미리 정의된 설정에 따라 자동으로 난독화된 프로그램(2)에 대한 역난독화 동작의 수행을 개시할 수 있다. 실시예에 따라서, 역난독화부(100)는 소프트웨어적으로 구현된 것일 수도 있고 또는 하드웨어적으로 구현된 것일 수도 있다. 또한, 상술한 역난독화부(100), 분석부(110), 복원부(160) 등은 역난독화 장치(70)의 소정 기능, 예컨대 프로세서(80)의 동작을 수행하는 기능 블럭으로 이해될 수 있으므로, 역난독화 장치(70)는 분석부(110)와 복원부(160)을 포함하는 역난독화부(100)를 포함하는 것으로 이해될 수도 있다.According to an embodiment, the processor 80 may include a de-obfuscation unit 100. The de-obfuscation unit 100 analyzes the obfuscated program 2 and, if necessary, generates a result program according to the analysis result to perform de-obfuscation on the obfuscated program 2. The de-obfuscation unit 100 may start performing the de-obfuscation operation for the obfuscated program 2 manually and/or automatically according to a predefined setting according to a user's manipulation. Depending on the embodiment, the deobfuscation unit 100 may be implemented in software or in hardware. In addition, the above-described de-obfuscation unit 100, analysis unit 110, restoration unit 160, etc. will be understood as a function block that performs a predetermined function of the de-obfuscation device 70, for example, an operation of the processor 80. Therefore, the de-obfuscation apparatus 70 may be understood as including the de-obfuscation unit 100 including the analysis unit 110 and the restoration unit 160.

일 실시예에 의하면, 역난독화부(100)는 적어도 하나의 프로그램의 형태로 구현될 수 있다. 이 경우, 역난독화부(100)는 동적 이진 계측 툴(DBI tool, Dynamic Binary Instrumentation tool)을 기반으로 제작 및 구현된 것일 수도 있다. 동적 이진 계측 툴은 핀 툴(Pin Tool)이나 또는 밸그라인드(Valgrind) 등을 포함할 수 있다. 핀 툴은 윈도우나 리눅스에서 런타임 이진 계측(Runtime Binary Instrumentation)을 수행할 수 있는 다수의 응용 프로그래밍 인터페이스(API, Application Programming Interface)(들)로 구성된 소프트웨어 툴을 의미한다. 핀 툴은 사용자가 원하는 추가 코드(예를 들어, 계수, 메모리 기록 또는 지시 수집 등)를 프로그램에 삽입함으로써, 역난독화 장치(70)가 프로그램(예를 들어, 난독화된 프로그램(2))의 동작을 분석할 수 있도록 한다. 핀 툴은 저스트 인 타임 컴파일(JIT compilation, Just-In-Time compilation)을 제공할 수 있어 다른 툴에 비해 상대적으로 효율적으로 동작하는 특징을 가지고 있다.According to an embodiment, the deobfuscation unit 100 may be implemented in the form of at least one program. In this case, the deobfuscation unit 100 may be manufactured and implemented based on a dynamic binary instrumentation tool (DBI tool). The dynamic binary measurement tool may include a Pin Tool or Valgrind. The pin tool refers to a software tool composed of a number of application programming interface (API)(s) capable of performing runtime binary instrumentation in Windows or Linux. The pin tool inserts additional code desired by the user (e.g., counts, memory recording or instruction collection, etc.) into the program, so that the de-obfuscation device 70 is programmed (e.g., obfuscated program 2). To analyze the behavior of Pin tools can provide just-in-time compilation (JIT compilation), so they operate more efficiently than other tools.

일 실시예에 의하면, 역난독화부(100)는 분석부(110) 및/또는 복원부(160)를 포함할 수 있다. 분석부(110)는 난독화된 프로그램(2)의 분석을 수행할 수 있다. 복원부(160)는 난독화된 프로그램(2)에 대응하는 결과 프로그램을 생성하여 원 프로그램(1)을 복원할 수 있다. 이 경우, 복원부(160)는 분석부(110)의 분석 결과를 기반으로 결과 프로그램을 생성할 수도 있다. 분석부(110) 및 복원부(160)는 소프트웨어적으로 구분된 것일 수도 있고 또는 하드웨어적으로 구분된 것일 수도 있다. 후자의 경우, 분석부(110) 및 복원부(160) 각각은 서로 상이한 물리적 장치(소정의 반도체 칩 등)을 이용하여 구현된 것일 수 있다. 실시예에 따라서 분석부(110) 및 복원부(160) 중 어느 하나는 생략되는 것도 가능하다. 분석부(110) 및 복원부(160)에 대한 상세한 설명은 후술한다.According to an embodiment, the deobfuscation unit 100 may include an analysis unit 110 and/or a restoration unit 160. The analysis unit 110 may analyze the obfuscated program 2. The restoration unit 160 may restore the original program 1 by generating a result program corresponding to the obfuscated program 2. In this case, the restoration unit 160 may generate a result program based on the analysis result of the analysis unit 110. The analysis unit 110 and the restoration unit 160 may be classified by software or by hardware. In the latter case, each of the analysis unit 110 and the restoration unit 160 may be implemented using different physical devices (such as a predetermined semiconductor chip). Depending on the embodiment, any one of the analysis unit 110 and the restoration unit 160 may be omitted. A detailed description of the analysis unit 110 and the restoration unit 160 will be described later.

메모리 장치(90)는 프로세서(80)의 동작에 필요한 각종 데이터를 일시적 또는 비일시적으로 저장할 수 있다. 예를 들어, 메모리 장치(90)는 역난독화를 위해 설계된 프로그램을 저장할 수도 있고, 역난독화 대상이 되는 프로그램(즉, 난독화된 프로그램(2))을 저장할 수도 있으며, 또한 역난독화 결과 획득된 프로그램을 저장할 수도 있다. 메모리 장치(90)는 주기억장치 및 보조기억장치 중 적어도 하나를 포함할 수 있다. 주기억장치는 롬(ROM) 및/또는 램(RAM)과 같은 반도체 저장 매체를 이용하여 구현된 것일 수 있다. 보조기억장치는 솔리드 스테이트 드라이브(SSD, Solid State Drive), 플래시 메모리 장치, 하드 디스크(HDD, Hard Disc), SD(Secure Digital) 카드, 자기 드럼, 자기 테이프, 컴팩트 디스크(CD), 디브이디(DVD), 레이저 디스크, 광자기 디스크 및/또는 플로피 디스크 등과 같이 데이터를 영구적 또는 반영구적으로 저장 가능한 적어도 하나의 저장 매체를 이용하여 구현될 수 있다.The memory device 90 may temporarily or non-temporarily store various types of data necessary for the operation of the processor 80. For example, the memory device 90 may store a program designed for de-obfuscation, a program to be de-obfuscated (ie, obfuscated program (2)), and may also store a de-obfuscation result. You can also save the acquired program. The memory device 90 may include at least one of a main memory device and an auxiliary memory device. The main memory device may be implemented using a semiconductor storage medium such as ROM and/or RAM. Auxiliary storage devices include solid state drives (SSDs), flash memory devices, hard disks (HDDs, Hard Discs), SD (Secure Digital) cards, magnetic drums, magnetic tapes, compact disks (CDs), and DVDs. ), a laser disk, a magneto-optical disk, and/or a floppy disk, or the like, and may be implemented using at least one storage medium capable of permanently or semi-permanently storing data.

프로세서(80)에 의해 역난독화 되거나 및/또는 메모리 장치(90)에 저장되는 난독화된 프로그램(2)은 역난독화 장치(70)와는 상이한 다른 장치(10, 이하 난독화 장치)의 난독화 동작에 의해 획득된 것일 수 있다. 물론, 상황에 따라 역난독화 장치(70)가 난독화를 수행하여 난독화된 프로그램(2)을 생성하는 것도 가능하다. 난독화 장치(10)는 역난독화 장치(70)와 동일하거나 또는 상이한 정보 처리 장치를 포함할 수 있으며, 예컨대 데스크톱 컴퓨터, 랩톱 컴퓨터, 서버용 컴퓨터 또는 스마트폰 등의 장치 등을 포함할 수 있다.The obfuscated program 2 that is deobfuscated by the processor 80 and/or stored in the memory device 90 is obfuscated by another device (10, hereinafter referred to as the obfuscation device) different from the deobfuscation device 70. It may be obtained by a speech operation. Of course, it is possible for the de-obfuscation device 70 to perform obfuscation to generate the obfuscated program 2 depending on the situation. The obfuscation apparatus 10 may include an information processing apparatus identical to or different from the de-obfuscation apparatus 70, and may include a device such as a desktop computer, a laptop computer, a server computer, or a smartphone.

난독화 장치(10)는 원 프로그램(1)으로부터 난독화된 프로그램(2)을 생성하여 획득하는 난독화부(11)를 포함할 수 있다. 난독화부(11)는 하나 또는 둘 이상의 난독화 툴(난독화 애플리케이션이나 난독화 프로그램 등으로 지칭 가능함)을 이용하여 원 프로그램(1)을 난독화하여, 최종적으로 난독화된 프로그램(2)을 획득(또는 생성)할 수 있다. 난독화 툴은 원 프로그램(1)의 전부 또는 일부에 대한 난독화를 수행할 수 있는 프로그램으로, 오직 난독화만을 위해 제작된 프로그램일 수도 있고 또는 난독화 기능을 부분적으로 포함하여 제작된 프로그램일 수도 있다. 난독화 툴은, 더미다(Themida) 툴(이하 더미다)이나, 윈 라이선스(WinLicense) 툴(이하 윈 라이선스)이나, 브이엠프로텍트(VMProtect) 툴(이하 브이엠프로텍트) 등과 같이 상용 난독화 툴을 포함할 수 있다. 난독화부(11)는 프로세서 등을 이용하여 구현 가능하다.The obfuscation apparatus 10 may include an obfuscation unit 11 that generates and obtains the obfuscated program 2 from the original program 1. The obfuscation unit 11 obfuscates the original program (1) using one or more obfuscation tools (can be referred to as obfuscation applications or obfuscation programs), and finally obtains the obfuscated program (2). You can (or create). The obfuscation tool is a program that can perform obfuscation of all or part of the original program (1), and may be a program designed only for obfuscation, or a program that is partially included in the obfuscation function. have. The obfuscation tool is a commercial obfuscation tool such as Themida tool (hereinafter referred to as Dummy), WinLicense tool (hereinafter referred to as Win License), or VMProtect tool (hereinafter referred to as VM Protect). It may include. The obfuscation unit 11 can be implemented using a processor or the like.

난독화부(11)는 난독화를 수행함에 있어서 적어도 하나의 난독화 옵션(12: 12-1 내지 12-N)을 적용하여 난독화를 수행할 수 있다. 예를 들어, 난독화 툴 중 하나인 더미다는 난독화를 위해 대략 21개의 옵션(12: 12-1 내지 12-N)을 사용자에게 제공한다. 보다 상세하게 예를 들어, 더미다는 안티 디버거(anti debugger), 안티 덤퍼(anti dumper), 안티 패칭(anti patching), 애플리케이션 또는 자원에 대한 압축화, 시큐어 엔진(secure engine) 코드 또는 자원의 압축화, 개선된 응용 프로그램 인터페이스 래핑(Advanced API wrapping) 또는 엔트리 포인트(Entry Point) 난독화 등 이진 코드 수준에서 분석 방지(anti-analysis) 등을 위한 다양한 옵션(12)을 제공한다. 이와 같이 다양한 난독화 옵션(12: 12-1 내지 12-N)의 존재는 난독화 과정에서 적용된 옵션(12: 12-1 내지 12-N)이 무엇인지 여부에 대한 판단을 어렵게 하여, 난독화된 프로그램(2)의 역난독화의 난도를 증가시키고 있다.The obfuscation unit 11 may perform obfuscation by applying at least one obfuscation option (12: 12-1 to 12-N) in performing obfuscation. For example, dummy, one of the obfuscation tools, provides users with approximately 21 options (12: 12-1 to 12-N) for obfuscation. In more detail, for example, dummy is anti debugger, anti dumper, anti patching, compression for applications or resources, secure engine code or compression of resources , Improved application program interface wrapping (Advanced API wrapping) or entry point obfuscation, etc. Various options (12) for anti-analysis at the binary code level are provided. As such, the existence of various obfuscation options (12: 12-1 to 12-N) makes it difficult to determine what options (12: 12-1 to 12-N) applied in the obfuscation process are, and thus obfuscate. The difficulty of de-obfuscation of the old program (2) is increasing.

역난독화 장치(70)는 난독화 장치(10)에 의해 난독화된 프로그램(2)을 다양한 경로를 통해 획득할 수 있다. 예를 들어, 역난독화 장치(70)는 외장 하드 디스크 장치나 범용 직렬 버스 메모리(USB memory) 장치 등과 같은 적어도 하나의 메모리 매체를 이용하여 난독화된 프로그램(2)을 획득할 수도 있고, 및/또는 유무선 통신 네트워크에 접속하고 외부의 서버 장치(예를 들어, 메일 서버나 전자 소프트웨어 유통망 서버 등)를 경유하거나 또는 난독화 장치(10)로부터 직접 난독화된 프로그램(2)을 수신하여 획득할 수도 있다. 이외에도 역난독화 장치(70)는 프로그램의 전달을 위해 통상 알려진 방법을 통해 난독화된 프로그램(2)을 획득할 수 있다.The de-obfuscation apparatus 70 may acquire the program 2 obfuscated by the obfuscation apparatus 10 through various paths. For example, the deobfuscation device 70 may acquire the obfuscated program 2 using at least one memory medium such as an external hard disk device or a universal serial bus memory (USB memory) device, and / Or access to a wired/wireless communication network, and via an external server device (for example, a mail server or an electronic software distribution network server, etc.), or by receiving the obfuscated program (2) directly from the obfuscation device (10). May be. In addition, the de-obfuscation device 70 may obtain the obfuscated program 2 through a commonly known method for delivering the program.

이하 난독화된 프로그램(2)에 대해 보다 상세히 설명하도록 하되, 더미다를 난독화 툴로 이용하여 난독화된 프로그램(2)을 예로 들어 설명하도록 한다. 그러나, 후술하는 난독화된 프로그램(2)의 구체적인 내용은 오직 더미다를 이용하여 난독화한 경우에만 한정되는 것은 아니다. 후술하는 내용의 전부 또는 일부는 다른 난독화 툴(예를 들어, 윈 라이선스 및/또는 브이엠프로텍트 애플리케이션 등)을 이용하여 난독화한 프로그램에도 해당될 수도 있다.Hereinafter, the obfuscated program 2 will be described in more detail, but the obfuscated program 2 will be described as an example using dummy da as an obfuscation tool. However, the specific content of the obfuscated program (2) to be described later is not limited only to the case of obfuscation using a dummy. All or part of the contents to be described later may also correspond to programs obfuscated using other obfuscation tools (eg, Win license and/or VM Protect application).

난독화 툴(예를 들어, 더미다)은 다수의 옵션을 기반으로 다양한 난독화 및 분석 방지 기법을 제공할 수 있으나, 이들 옵션들은 원칙적으로 원시 코드와 원시 데이터를 훼손하지는 않는다. 또한, 더미다는 본질적으로 패커(packer)이다. 패커는 코드나 데이터를 특정한 키와 배타적 논리합(XOR)을 수행하여 은닉하고, 런타임 시점에서 해당 키와 다시 배타적 논리합을 수행하여 원시 코드 및 원시 데이터를 복원하는 툴 또는 기법을 의미한다. 그러므로, 더미다를 이용하여 난독화된 프로그램(2)이라고 하더라도 런타임에서 원시 코드와 원시 데이터가 그대로 노출되는 시점이 존재할 수밖에 없다. 이를 고려하여 더미다를 기반으로 난독화된 프로그램(2)에 대해 정적 분석(static analysis) 및 동적 분석(dynamic analysis)을 수행하면, 난독화 툴 특유의 내제적 특징이 존재함을 알 수 있다.Obfuscation tools (eg, dummy) can provide various obfuscation and analysis prevention techniques based on a number of options, but these options do not in principle damage the source code and the raw data. Also, dummy is essentially a packer. A packer refers to a tool or technique for concealing code or data by performing an exclusive OR (XOR) with a specific key, and restoring the original code and data by performing an exclusive OR again with the key at runtime. Therefore, even in the case of the program (2) obfuscated using a dummy, there is inevitably a point in time when the source code and the source data are exposed as they are in the runtime. Taking this into account, when static analysis and dynamic analysis are performed on the obfuscated program 2 based on the dummy, it can be seen that there are inherent characteristics peculiar to the obfuscation tool.

예를 들어, 난독화 툴에 의해 프로그램이 난독화될 때 원 프로그램(1) 또는 이에 포함된 코드나 데이터 등은 패킹되고, 실행 시간(런타임) 동안 소정의 루틴(언패킹 루틴)에 따라서 언패킹된다. 이와 같은 원 프로그램(1) 등에 대한 언패킹 루틴은 난독화 툴에 사전에 마련된 것일 수 있다. 통상 난독화 툴은 다섯 또는 여섯 개의 언패킹 루틴을 제공하는데, 이들 언패킹 루틴은 특정 옵션(12:12-1 내지 12-N)의 선택에 따라 추가되기도 하고 또는 제거되기도 한다. 따라서, 언패킹 루틴은 특정 난독화 툴의 내제적 특징이 될 수 있다.For example, when a program is obfuscated by an obfuscation tool, the original program (1) or the code or data contained therein is packed, and unpacked according to a predetermined routine (unpacking routine) during execution time (runtime). do. Such an unpacking routine for the original program 1 may be provided in advance in the obfuscation tool. Typically, obfuscation tools provide five or six unpacking routines, which can be added or removed depending on the selection of specific options (12:12-1 to 12-N). Thus, the unpacking routine can be an inherent feature of a particular obfuscation tool.

언패킹 루틴 중에서 일부의 루틴은 적용된 옵션(12:12-1 내지 12-N)에 무관하게 동일하거나 유사한 바이트 패턴(byte pattern)을 갖는다. 이와 같은 언패킹 루틴에서 이용되는 바이트 패턴은 난독화 툴 특유의 내제적 특징이 될 수 있으며, 이를 기반으로 난독화 툴의 사용 여부를 판단할 수 있게 된다. 여기서, 바이트 패턴은 정적 분석으로 확인 가능한 것일 수 있다.Some of the unpacking routines have the same or similar byte pattern regardless of the options applied (12:12-1 to 12-N). The byte pattern used in such an unpacking routine may be an inherent characteristic peculiar to the obfuscation tool, and based on this, it is possible to determine whether to use the obfuscation tool. Here, the byte pattern may be identified by static analysis.

또한, 난독화 툴의 내제적 특징은, 후술하는 섹션에 대한 정보(예컨대, 섹션의 개수나 명칭 등)를 포함할 수도 있다. 이는 일부의 섹션은 옵션(12:12-1 내지 12-N)의 선택에 따라서 추가되거나 제거되기도 하기 때문이다.In addition, the intrinsic feature of the obfuscation tool may include information (eg, the number or name of sections) on sections to be described later. This is because some sections are added or removed depending on the selection of options (12:12-1 to 12-N).

도 2는 난독화된 프로그램의 실행 시의 제어 흐름을 설명하기 위한 도면이다.2 is a diagram for explaining a control flow when an obfuscated program is executed.

상술한 난독화 툴을 기반으로 난독화된 프로그램(2)에 대해 행동 분석(behavior analysis)을 수행하면, 제어 흐름은 도 2에 도시된 바와 같이 다수의 섹션(21 내지 25)을 기반으로 수행됨을 알 수 있다.When a behavior analysis is performed on the obfuscated program 2 based on the above-described obfuscation tool, the control flow is performed based on a plurality of sections 21 to 25 as shown in FIG. 2. Able to know.

다수의 섹션(21 내지 25)은, 예를 들어, 더미다2 섹션(21), 더미다1 섹션(22), 임포트 주소 테이블(IAT, Import Address Table) 제거 섹션(23), 압축/암호화 데이터 섹션(24) 및 패킹된 코드 섹션(25)을 포함할 수 있다. 도 2에는 5개의 섹션(21 내지 25)이 도시되어 있으나, 상황에 따라서 섹션(21 내지 25)의 개수는 더 많을 수도 있고 또는 더 적을 수도 있다. 예를 들어, 선택된 옵션(12: 12-1 내지 12-N)에 따라서 새로운 섹션이 더 추가되거나 또는 일부의 섹션이 생략될 수도 있다. 보다 구체적으로 예를 들어, 시큐어 엔진 압축화 옵션을 추가적으로 반영하여 난독화가 수행된 경우에는 이에 대응하는 섹션이 더 추가될 수도 있다. 제어 흐름은 더미다2 섹션(21), 더미다1 섹션(22), 임포트 주소 테이블 제거 섹션(23), 압축/암호화 데이터 섹션(24) 및 패킹된 코드 섹션(25) 순으로 진행되며, 기 실행된 섹션(21 내지 25)은 복수 회수로 실행되지는 않는다(도 3b의 규칙 4-1 및 규칙 4-2 참조).The plurality of sections 21 to 25 are, for example, a dummy 2 section 21, a dummy 1 section 22, an import address table (IAT) removal section 23, and compressed/encrypted data. It may include a section 24 and a packed code section 25. Although five sections 21 to 25 are shown in Fig. 2, the number of sections 21 to 25 may be larger or smaller depending on the situation. For example, depending on the selected option (12: 12-1 to 12-N), a new section may be added or some of the sections may be omitted. More specifically, for example, when obfuscation is performed by additionally reflecting the secure engine compression option, a corresponding section may be further added. The control flow proceeds in the order of dummy2 section (21), dummy1 section (22), import address table removal section (23), compressed/encrypted data section (24), and packed code section (25). The executed sections 21 to 25 are not executed multiple times (see Rule 4-1 and Rule 4-2 in Fig. 3B).

더미다2 섹션(21)은 엔트리 포인트로 동작하며, 더미다1 섹션(22)을 언패킹(unpacking)한다. 더미다2 섹션(21)에서는, 안티 분석 코드가 실행되지 않으므로, 예외 코드가 분석을 지연시키도록 한다.The dummy 2 section 21 operates as an entry point, and unpacks the dummy 1 section 22. In the dummy2 section 21, the anti-analysis code is not executed, so the exception code delays the analysis.

더미다1 섹션(22)은 패킹된 코드(25) 및 데이터(24)의 언패킹을 수행하며, 또한 분석 방지 코드(26, anti-analysis code)를 실행시킨다. 여기서 분석 방지 코드(26)는 멀티 스레드(multi-thread)를 기반으로 하는 분석 방지 코드일 수 있다. 또한, 더미다1 섹션(22)에 의해 동적 링크 라이브러리(DLL, Dynamic Link Library)도 동적으로 로딩된다. 만약 상술한 자원 압축화 옵션이나 자원 압축화 옵션이 선택된 경우라면, 더미다1 섹션(22)은 데이터 섹션(24)의 압축을 해제하고 복호화를 더 수행한다. 더미다2 섹션(21) 및 더미다1 섹션(22)은 코드 섹션(25)의 언패킹이 완료되면 더이상 이용되지 않는다(도 3b의 규칙 4-2 참조).The dummy 1 section 22 performs unpacking of the packed code 25 and data 24, and also executes an anti-analysis code 26. Here, the analysis prevention code 26 may be an analysis prevention code based on a multi-thread. In addition, a dynamic link library (DLL, Dynamic Link Library) is also dynamically loaded by the dummy 1 section 22. If the above-described resource compression option or resource compression option is selected, the dummy 1 section 22 decompresses the data section 24 and further performs decoding. The dummy 2 section 21 and the dummy 1 section 22 are no longer used when the unpacking of the code section 25 is completed (refer to Rule 4-2 in FIG. 3B).

데이터 섹션(24)은 원 프로그램(1)에 포함되어 있던 데이터 등을 포함하며, 이때 데이터는 압축 및/또는 암호화되어 데이터 섹션(24)에 마련되어 있을 수 있다. 데이터 섹션(24)은 상술한 더미다1 섹션(22)의 동작에 의해 원 프로그램(1)과 같이 복원된다.The data section 24 includes data and the like included in the original program 1, and in this case, the data may be compressed and/or encrypted to be provided in the data section 24. The data section 24 is restored like the original program 1 by the operation of the dummy 1 section 22 described above.

코드 섹션(25)은 원 프로그램(1)의 코드를 포함하는 부분으로, 이 경우 원 프로그램(1)은 패킹되어 코드 섹션(25)에 포함될 수 있다. 코드 섹션(25)은 상술한 더미다1 섹션(22)에 의해 언패킹되어 복원될 수 있다. 이 경우, 복원 결과는 원 프로그램(1)과 동일할 수도 있고 또는 일부 상이할 수도 있다. 패킹된 코드 섹션(25)이 복원되는 경우, 원 프로그램(1)이 예정하고 있는 원래의 기능 또는 동작의 수행이 가능해진다.The code section 25 is a part containing the code of the original program 1, in which case the original program 1 may be packed and included in the code section 25. The code section 25 may be unpacked and restored by the dummy 1 section 22 described above. In this case, the restoration result may be the same as the original program 1 or may be partially different. When the packed code section 25 is restored, it becomes possible to perform the original function or operation intended by the original program 1.

임포트 주소 테이블 제거 섹션(23)은 임포트 주소 테이블을 제거하여 난독화된 프로그램(2)의 분석을 어렵게 하도록 설계되어 있다. 그러나, 실질적으로는 동적 링크 라이브러리나 프로그램 내의 함수(예를 들어, 임포트 주소 테이블)는 IAT 제거 섹션(23)에서 완전히 삭제되는 것은 아니며, 정보(예를 들어, 임포트 디렉터리 테이블(IDT, Import Directory Table))만이 삭제된다. 이에 따라 난독화에 의해서도 함수의 실제 주소는 제거되지 않으며, 단지 정보의 부재로 인해 왜곡되어 보일 수는 있다. 따라서, 전체적인 임포트 주소 테이블은 이와 같은 삭제된 정보를 회복시켜 복원될 수 있다.The import address table removal section 23 is designed to remove the import address table to make it difficult to analyze the obfuscated program 2. However, in practice, functions in the dynamic link library or program (for example, the import address table) are not completely deleted in the IAT removal section 23, and information (for example, the import directory table (IDT) )) only is deleted. Accordingly, the actual address of the function is not removed even by obfuscation, and it may appear distorted only due to the absence of information. Accordingly, the entire import address table can be restored by recovering such deleted information.

이와 같이 난독화된 프로그램(2)을 실행하는 경우, 더미다2 섹션(21) 및 더미다1 섹션(22)의 동작에 따라 패킹된 코드 또는 압축/암호화된 데이터는 언패킹되고, 이에 따라 원 프로그램(1)과 동일 또는 유사한 프로그램이 실행될 수 있게 된다.In the case of executing the obfuscated program (2) as described above, the packed code or compressed/encrypted data according to the operation of the dummy 2 section 21 and the dummy 1 section 22 is unpacked. The same or similar program as the program 1 can be executed.

도 3a 및 도 3b는 난독화 툴의 일례로 더미다의 규칙의 일부를 설명하기 위한 도면으로, 포터블 실행 파일에 대해 더미다를 적용한 경우에서의 발견된 규칙을 도표의 형태로 도시한 것이다.3A and 3B are diagrams for explaining some of the rules of a dummy da as an example of an obfuscation tool, and are diagrams illustrating rules found when dummy da is applied to a portable executable file.

상술한 분석에 의하면, 난독화 툴의 하나인 더미다는 도 3a 및 도 3b에 도시된 바와 같은 다수의 규칙에 따라서 원 프로그램(1)을 난독화할 수 있다.According to the above analysis, the dummy, which is one of the obfuscation tools, can obfuscate the original program 1 according to a plurality of rules as shown in FIGS. 3A and 3B.

예를 들어, 더미다는 원 프로그램(1) 내의 다수의 섹션들을 병합하여 특정한 개수의 섹션으로 재구축하되(규칙 1), 텍스트 섹션(.text), 데이터 섹션(.data) 및 임포트 주소 테이블 섹션을 최상단 섹션에 병합시킨다(규칙 1-1). 한편, 자원 섹션(.rsrc)을 원 위치에 위치시키되, 더미다1 섹션(22)에 일부 자원 값을 이동시킨다(규칙 1-2). 원시 코드, 데이터 및 임포트 주소 테이블의 위치는 변경되지 않는다(규칙 1-3).For example, Dummy Dummy merges a number of sections in the original program (1) and rebuilds it into a specific number of sections (Rule 1), but adds a text section (.text), a data section (.data), and an import address table section. Merge into the top section (Rule 1-1). On the other hand, the resource section (.rsrc) is placed in the original position, but some resource values are moved to the dummy 1 section 22 (Rule 1-2). The location of the source code, data and import address tables remains unchanged (Rule 1-3).

또한, 더미다는 압축된 코드, 데이터 및 제거된 임포트 주소 테이블을 특별한 규칙을 갖는 난독화된 프로그램에서 다시 작성하는데(규칙 2), 적용된 옵션에 따라 애플리케이션 및/또는 자원이 암호화되거나 압축되는 경우에는 임포트 주소 테이블의 복원 전에 복호화 또는 압축 해제를 수행하고(규칙 2-1), 애플리케이션 및/또는 자원이 암호화되거나 압축되지 않으면, 오직 임포트 주소 테이블의 복원만을 수행하도록 한다(규칙 2-2). 또한, 만약 복원된 임포트 주소 테이블의 주소가 호출/점프에 의해 참조되면, 모든 참조된 간접 호출/점프(ICJ, Indirect Call & Jump) 명령문을 직접 호출/점프(DCJ, Direct Call & Jump) 명령문으로 변환시킨다(규칙 2-3). 난독화된 프로그램이 언패킹된 코드 섹션으로 점프하게 되면 전체적인 프로세스는 종료되며, 패킹되거나, 암호화되거나, 압축되거나 또는 제거된 모든 대상들은 복원되게 된다(규칙 2-4).In addition, dummy rewrites the compressed code, data, and the removed import address table in an obfuscated program with special rules (rule 2).If the application and/or resource is encrypted or compressed according to the applied option, the import Decryption or decompression is performed prior to restoration of the address table (Rule 2-1), and if applications and/or resources are not encrypted or compressed, only the restoration of the import address table is performed (Rule 2-2). Also, if the address of the restored import address table is referenced by call/jump, all referenced indirect call/jump (ICJ) statements are converted to direct call/jump (DCJ) statements. Convert (Rule 2-3). When the obfuscated program jumps to an unpacked section of code, the entire process is terminated and all objects that have been packed, encrypted, compressed or removed are restored (Rule 2-4).

더미다는 응용 프로그램 인터페이스 래핑 옵션이 선택되어 적용되면, 임포트 주소 테이블의 값을 변경시켜 임포트 주소 테이블을 추가적으로 변형하여 훼손시킬 수 있다. 또한, 더미다는 선택된 임의의 회수로 임포트 주소 테이블을 훼손하는 것도 가능하다(규칙 3, 규칙 3-1). 이와 같이 응용 프로그램 인터페이스 래핑 옵션이 적용된 경우, 원래의 응용 프로그램 인터페이스 코드는 난독화되고 동적 할당 메모리 영역에 복제되며(규칙 3-2), 임포트 주소 테이블 값은 복제된 응용 프로그램 인터페이스 코드의 주소로 변경된다(규칙 3-3). 더미다는 이에 대응하는 과정을 런타임 중에 재구성하여 임포트 주소 테이블을 재작성하게 된다.If the dummy application program interface wrapping option is selected and applied, the import address table can be further modified and damaged by changing the value of the import address table. In addition, it is also possible to damage the import address table at a selected arbitrary number of times (Rule 3, Rule 3-1). When the application program interface wrapping option is applied in this way, the original application program interface code is obfuscated and duplicated in the dynamically allocated memory area (Rule 3-2), and the import address table value is changed to the address of the cloned application program interface code. Becomes (Rule 3-3). Dummy Dummy rebuilds the corresponding process during runtime to rebuild the import address table.

한편, 도 2를 참조하여 설명한 바와 같이, 더미다에 의해 난독화된 프로그램은 옵션에 무관하게 공통된 제어 흐름 규칙을 갖는다(규칙 4, 규칙 4-1 내지 규칙 4-3).Meanwhile, as described with reference to FIG. 2, a program obfuscated by a dummy has a common control flow rule regardless of options (Rule 4, Rule 4-1 to Rule 4-3).

일 실시예에 의하면, 프로세서(80)의 역난독화부(100)는 난독화된 프로그램(2)에 대한 역난독화를 수행하기 위해, 상술한 난독화 툴(예를 들어, 더미다)에 대한 정적 분석, 동적 분석 및 행동 분석으로부터 도출된 결과를 이용하여 제작 및 구현된 것일 수 있다. 구체적으로, 역난독화부(100)의 분석부(110) 및 복원부(160)는 이들 분석 결과에 따라서 난독화된 프로그램(2)을 분석하고 및/또는 원 프로그램(1)과 동일 또는 유사한 결과 프로그램을 복원하도록 마련된 것일 수 있다.According to an embodiment, in order to perform de-obfuscation on the obfuscated program 2, the de-obfuscation unit 100 of the processor 80 provides the above-described obfuscation tool (for example, a dummy). It may be produced and implemented using results derived from static analysis, dynamic analysis, and behavior analysis. Specifically, the analysis unit 110 and the restoration unit 160 of the de-obfuscation unit 100 analyze the obfuscated program 2 according to these analysis results and/or the same or similar results as the original program 1 It may be designed to restore a program.

이하, 역난독화부(100)의 분석부(110) 및 복원부(160)에 대해 보다 상세히 설명하도록 한다.Hereinafter, the analysis unit 110 and the restoration unit 160 of the de-obfuscation unit 100 will be described in more detail.

도 4는 분석부의 일 실시예에 대한 블록도이다.4 is a block diagram of an embodiment of an analysis unit.

분석부(110)는 난독화된 프로그램(2)을 분석하여 분석 결과에 따라 원 프로그램(1)에 대한 정보를 추출 및 획득할 수 있으며, 필요에 따라 획득한 적어도 하나의 데이터를 복원부(160)로 전달할 수 있다. 일 실시예에 의하면, 분석부(110)는 난독화된 프로그램(2)을 구동시킨 후 난독화된 프로그램(2)의 구동 과정에서 적어도 하나의 정보를 추출함으로써, 난독화된 프로그램(2)을 분석할 수 있다.The analysis unit 110 may analyze the obfuscated program 2 to extract and obtain information on the original program 1 according to the analysis result, and the restoration unit 160 recovers at least one data acquired as necessary. ). According to one embodiment, the analysis unit 110 drives the obfuscated program 2 and then extracts at least one piece of information in the driving process of the obfuscated program 2, thereby executing the obfuscated program 2 Can be analyzed.

도 4에 도시된 바를 참조하면, 분석부(110)는 난독화 판단부(111), 분석 방지 탐지부(113), 응용 프로그래밍 인터페이스 래핑 처리부(115), 임포트 주소 테이블 탐지부(117), 직접 호출/점프 탐지부(119), 원시 엔트리 포인트 확인부(121) 및 원시 코드 추출부(123)를 포함할 수 있으며, 입력부(131) 및 출력부(132)를 더 포함할 수도 있다. 실시예에 따라서, 이들 요소(111 내지 123, 131, 132) 중 적어도 하나는 생략 가능하며, 및/또는 이들 요소(111 내지 123, 131, 132) 외에 다른 요소가 더 추가되는 것도 가능하다.4, the analysis unit 110 includes an obfuscation determination unit 111, an analysis prevention detection unit 113, an application programming interface wrapping processing unit 115, an import address table detection unit 117, and direct A call/jump detection unit 119, a source entry point verification unit 121 and a source code extraction unit 123 may be included, and an input unit 131 and an output unit 132 may be further included. Depending on the embodiment, at least one of these elements 111 to 123, 131, 132 may be omitted, and/or other elements other than these elements 111 to 123, 131, 132 may be further added.

입력부(131)는 분석부(110)에 의해 분석될 프로그램을 수신할 수 있다. 여기서 수신되는 프로그램은 난독화된 프로그램(2)을 포함할 수 있다. 입력부(131)는 수신한 프로그램을 난독화 판단부(111)로 전달할 수 있으며, 또한 실시예에 따라 분석 방지 탐지부(113)로 더 전송할 수도 있다.The input unit 131 may receive a program to be analyzed by the analysis unit 110. The program received here may include an obfuscated program 2. The input unit 131 may transmit the received program to the obfuscation determination unit 111 and may further transmit the received program to the analysis prevention detection unit 113 according to an embodiment.

난독화 판단부(111)는 입력부(131)로부터 전달된 프로그램이 난독화된 프로그램(2)인지 여부를 판단할 수 있다. 또한, 난독화 판단부(111)는 어느 난독화 툴을 이용하여 난독화가 수행되었는지 여부를 판단할 수도 있다. 다시 말해서, 난독화 판단부(111)는 난독화 툴을 식별할 수도 있다. 일 실시예에 의하면, 난독화 판단부(111)는 난독화 툴 특유의 내제적 특징을 이용하여 난독화된 프로그램(2)인지 여부를 판단할 수 있다. 여기서, 난독화 툴 특유의 내제적 특징은, 상술한 바와 같이 언패킹 루틴 또는 이에 포함된 바이트 패턴 등을 포함할 수 있다. 만약 프로그램으로부터 난독화 툴 특유의 내제적 특징이 확인 또는 검출되면, 난독화 판단부(111)는 입력된 프로그램이 난독화된 프로그램(2)이라고 판단할 수 있다. 판단 결과는 분석 방지 탐지부(113)로 전달될 수 있으며, 필요에 따라서 응용 프로그래밍 인터페이스 래핑 처리부(115)로 더 전달될 수도 있다. 반대로 프로그램으로부터 난독화 툴 특유의 내제적 특징이 확인 또는 검출되지 않으면, 난독화 판단부(111)는 입력된 프로그램이 난독화된 프로그램(2)은 아니라고 판단할 수 있다. 이 경우, 역난독화 과정은 종료되며, 필요에 따라 역난독화가 종료되었다는 정보가 메시지 등의 형태로 역난독화 장치(70)의 출력부(미도시)를 통해 사용자에게 제공될 수 있다.The obfuscation determination unit 111 may determine whether the program transmitted from the input unit 131 is the obfuscated program 2. In addition, the obfuscation determination unit 111 may determine whether or not obfuscation has been performed using which obfuscation tool. In other words, the obfuscation determination unit 111 may identify the obfuscation tool. According to an embodiment, the obfuscation determination unit 111 may determine whether or not the obfuscated program 2 is based on an inherent characteristic peculiar to the obfuscation tool. Here, the inherent characteristics peculiar to the obfuscation tool may include an unpacking routine or a byte pattern included therein, as described above. If an intrinsic characteristic peculiar to the obfuscation tool is identified or detected from the program, the obfuscation determination unit 111 may determine that the input program is the obfuscated program 2. The determination result may be transmitted to the analysis prevention detection unit 113, and may be further transmitted to the application programming interface wrapping processing unit 115 if necessary. On the contrary, if the inherent characteristic peculiar to the obfuscation tool is not confirmed or detected from the program, the obfuscation determination unit 111 may determine that the input program is not the obfuscated program 2. In this case, the de-obfuscation process is terminated, and, if necessary, information indicating that de-obfuscation has ended may be provided to the user through an output unit (not shown) of the de-obfuscation device 70 in the form of a message.

분석 방지 탐지부(113)는 난독화부(11)에 의해 제공되는 분석 방지 옵션을 적용하여 프로그램(2)이 난독화되었는지 여부를 판단할 수 있다. 분석 방지 탐지부(113)는, 예를 들어, 핀 툴을 이용하여 분석 방지 옵션의 적용 여부를 판단할 수 있다. 구체적으로, 핀 툴은 멀티 스레드 프로그램을 추적할 수 있다. 따라서, 도 2에 도시된 바와 같이 더미다1 섹션(22)에 의해 멀티 스레드 기반 분석 방지 코드(26)의 구동이 개시되면, 핀 툴은 이를 감지하고 감지 결과를 획득할 수 있게 된다. 이에 따라, 분석 방지 탐지부(113)는 분석 방지 옵션의 적용 여부를 판단할 수 있게 되고 또한 난독화 여부도 함께 판단할 수 있게 된다.The analysis prevention detection unit 113 may determine whether the program 2 is obfuscated by applying the analysis prevention option provided by the obfuscation unit 11. The analysis prevention detection unit 113 may determine whether or not the analysis prevention option is applied using, for example, a pin tool. Specifically, the pin tool can track multi-threaded programs. Accordingly, as shown in FIG. 2, when the driving of the multi-thread-based analysis prevention code 26 is started by the dummy 1 section 22, the pin tool can detect this and obtain a detection result. Accordingly, the analysis prevention detection unit 113 may determine whether or not the analysis prevention option is applied, and also determine whether the analysis prevention option is obfuscated.

응용 프로그래밍 인터페이스 래핑 처리부(115)는 응용 프로그래밍 인터페이스 래핑 옵션(API wrapping option)에 관한 처리를 수행할 수 있다. 상술한 바와 같이, 응용 프로그래밍 인터페이스 래핑 옵션이 적용된 경우에는 임포트 주소 테이블이 추가적으로 변형되게 되므로, 응용 프로그래밍 인터페이스 래핑 처리부(115)는 임포트 주소 테이블의 보다 적절한 복원을 위해 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부를 판단할 수 있다.The application programming interface wrapping processing unit 115 may process an application programming interface wrapping option. As described above, when the application programming interface wrapping option is applied, the import address table is additionally deformed. Therefore, the application programming interface wrapping processing unit 115 determines whether to apply the application programming interface wrapping option for more appropriate restoration of the import address table. I can judge.

일 실시예에 의하면, 인터페이스 래핑 처리부(115)는 식별부(115-1) 및 원주소 획득부(115-2)를 포함할 수 있다.According to an embodiment, the interface wrapping processing unit 115 may include an identification unit 115-1 and an original address acquisition unit 115-2.

식별부(115-1)는 난독화된 프로그램(2)이 응용 프로그래밍 인터페이스 래핑 옵션을 이용하여 난독화되었는지 여부를 판단할 수 있다. 예를 들어, 더미다와 같은 난독화 툴의 경우, 원 프로그램(1)이 응용 프로그래밍 인터페이스 래핑 옵션을 적용하여 난독화되면 임포트 주소 테이블 값을 변경하게 된다(규칙 3 참조). 이 때, 응용 프로그래밍 인터페이스 래핑 옵션은 원래의 응용 프로그래밍 인터페이스 코드를 난독화하고, 이를 읽기/쓰기/실행 권한을 이용하여 동적으로 할당된 메모리 공간에 복제한다(규칙 3-2 참조). 응용 프로그래밍 인터페이스 래핑 처리부(115)는 이를 이용하여 인터페이스 래핑 옵션이 적용되었는지 여부를 판단 및 결정할 수 있다. 구체적으로 예를 들어, 응용 프로그래밍 인터페이스 래핑 처리부(115)는 읽기/쓰기/실행 권한을 갖는 소정의 함수(예를 들어, NtAllocateVirtualMemory API)를 감시(모니터링)함으로써 인터페이스 래핑 옵션의 적용 여부를 결정할 수 있다.The identification unit 115-1 may determine whether the obfuscated program 2 has been obfuscated using an application programming interface wrapping option. For example, in the case of an obfuscation tool such as Dummy, when the original program 1 is obfuscated by applying an application programming interface wrapping option, the import address table value is changed (refer to Rule 3). At this time, the application programming interface wrapping option obfuscates the original application programming interface code, and copies it to the dynamically allocated memory space using read/write/execute rights (refer to Rule 3-2). The application programming interface wrapping processing unit 115 may use this to determine and determine whether an interface wrapping option is applied. Specifically, for example, the application programming interface wrapping processor 115 may determine whether to apply the interface wrapping option by monitoring (monitoring) a predetermined function (eg, NtAllocateVirtualMemory API) having read/write/execution rights. .

만약 식별부(115-1)가 난독화된 프로그램(2)이 응용 프로그래밍 인터페이스 래핑 옵션을 적용하여 난독화되었다고 판단되면, 원주소 획득부(115-2)는 원래의 응용 프로그래밍 인터페이스 주소를 획득할 수 있다. 이 경우, 원주소 획득부(115-2)는 응용 프로그래밍 인터페이스 복제 지시에 포함된 원 주소 및 목적지 주소를 감시함으로써 원래의 응용 프로그래밍 인터페이스 주소를 획득할 수도 있다. 획득된 원래의 응용 프로그래밍 인터페이스 주소는 소정의 로그, 일례로 언래핑 로그(unwrapping log)에 기록될 수 있다. 이와 같이 획득된 응용 프로그래밍 인터페이스 주소는 임포트 주소 테이블 로그(IAT log)의 보완을 위해 이용될 수 있다.If the identification unit 115-1 determines that the obfuscated program 2 is obfuscated by applying the application programming interface wrapping option, the original address acquisition unit 115-2 may obtain the original application programming interface address. I can. In this case, the original address acquisition unit 115-2 may acquire the original application programming interface address by monitoring the original address and the destination address included in the application programming interface copy instruction. The obtained original application programming interface address may be recorded in a predetermined log, for example an unwrapping log. The thus-obtained application programming interface address may be used to supplement the import address table log (IAT log).

임포트 주소 테이블 탐지부(117)는 임포트 주소 테이블을 탐지하고, 탐지 결과를 기반으로 어디에 임포트 주소 테이블이 존재하는지 결정할 수 있다. 예를 들어, 더미다는 텍스트 섹션(.text), 데이터 섹션(.data) 및 임포트 주소 테이블 섹션을 최상단 섹션에 병합시킨다(규칙 1-1 참조). 따라서, 임포트 주소 테이블 탐지부(117)는 최상단 섹션에 대한 메모리 쓰기를 감시하여 임포트 주소 테이블의 위치를 결정할 수 있다. 결정 결과는 임포트 주소 테이블 로그에 기록될 수 있다. 실시예에 따라서, 임포트 주소 테이블 탐지부(117)는, 식별부(115-1)가 응용 프로그래밍 인터페이스 래핑 옵션이 적용되었다고 판단한 경우에는 원주소 획득부(115-2)가 응용 프로그래밍 인터페이스 주소를 획득한 이후에 임포트 주소 테이블을 탐지하도록 설계될 수도 있다.The import address table detection unit 117 may detect the import address table and determine where the import address table exists based on the detection result. For example, Dummy merges a text section (.text), a data section (.data), and an import address table section into the top section (see Rule 1-1). Accordingly, the import address table detection unit 117 may determine the location of the import address table by monitoring memory writes to the uppermost section. The decision result can be recorded in the import address table log. According to an embodiment, when the identification unit 115-1 determines that the application programming interface wrapping option is applied, the import address table detection unit 117 obtains the application programming interface address. It may be designed to detect the import address table after one.

직접 호출/점프 탐지부(119)는 직접 호출/점프 명령문의 위치를 확인 및 기록할 수 있다. 또한, 직접 호출/점프 탐지부(119)는 직접 호출/점프 명령문의 간접 주소를 확인 및 기록할 수도 있다. 간접 주소는 직접 호출/점프 명령문을 간접 호출/점프 명령문으로 변환하기 위한 것이다(규칙 2-3 참조). 구체적으로, 더미다의 경우, 패킹된 코드, 데이터 및 제거된 임포트 주소 테이블을 난독화된 프로그램(2)에 특별한 규칙으로 다시 작성하며, 또한 임포트 주소 테이블을 복원한 경우에, 복원된 임포트 주소 테이블이 호출/점프에 의해 참조되면, 모든 참조된 간접 호출/점프 명령문을 직접 호출/점프 명령문으로 변환시키도록 설계되어 있다. 따라서, 이와 같은 직접 호출/점프 명령문을 간접 호출/점프 명령문으로 다시 변환시키기 위해, 직접 호출/점프 탐지부(119)는 직접 호출/점프 명령문의 간접 주소를 더 획득하여 기록할 수 있다. 직접 호출/점프 명령문의 위치 또는 직접 호출/점프 명령문에 대한 간접 주소는 직접 호출/점프 로그에 기록될 수 있다.The direct call/jump detection unit 119 may check and record the location of the direct call/jump command. In addition, the direct call/jump detection unit 119 may check and record the indirect address of the direct call/jump command. Indirect addresses are intended to convert direct call/jump statements into indirect call/jump statements (see Rule 2-3). Specifically, in the case of dummy, the packed code, data, and the removed import address table are rewritten with special rules in the obfuscated program (2), and when the import address table is restored, the restored import address table When referenced by this call/jump, it is designed to convert all referenced indirect call/jump statements into direct call/jump statements. Therefore, in order to convert such a direct call/jump command back into an indirect call/jump command, the direct call/jump detection unit 119 may further acquire and record the indirect address of the direct call/jump command. The location of the direct call/jump statement or the indirect address for the direct call/jump statement can be recorded in the direct call/jump log.

원시 엔트리 포인트 확인부(121)는 원시 엔트리 포인트(OEP, Original Entry Point)를 확인하고 기록할 수 있다. 원시 엔트리 포인트의 확인 및 기록을 위해서, 입력부(131)를 통해 입력된 난독화된 프로그램(2)이 실행 중인지 여부를 결정할 수 있다. 더미다는 원래의 코드, 데이터 및 임포트 주소 테이블의 위치를 다른 위치로 옮기지는 않으며(규칙 1-3 참조), 난독화된 프로그램(2)이 언패킹된 코드 섹션(25)으로 점프하는 경우, 원시 엔트리 포인트가 목표 주소로 설정된다(규칙 4-3 참조). 원시 엔트리 포인트 확인부(121)는 이와 같은 점을 이용하여 언패킹된 코드 섹션(25)에서 프로그램(2)의 실행 여부를 확인하고 이를 기반으로 원시 엔트리 포인트를 확인하고 기록하게 된다. 확인된 원시 엔트리 포인트는 원시 엔트리 포인트 로그에 기록될 수 있다.The original entry point confirmation unit 121 may check and record an original entry point (OEP). In order to confirm and record the original entry point, it may be determined whether or not the obfuscated program 2 input through the input unit 131 is being executed. The dummy does not move the original code, data, and the location of the import address table to another location (see Rule 1-3), and if the obfuscated program (2) jumps to the unpacked code section (25), the raw The entry point is set to the target address (see Rule 4-3). The original entry point checking unit 121 uses this point to check whether the program 2 is executed in the unpacked code section 25, and checks and records the original entry point based on this. The identified original entry point can be recorded in the original entry point log.

원시 코드 추출부(123)는 원시 코드 및 원시 데이터 중 적어도 하나를 추출할 수 있으며, 예를 들어 난독화된 프로그램(2)이 언패킹된 코드 섹션(25)으로 점프한 이후에 원시 코드 및 원시 데이터 중 적어도 하나를 추출할 수 있다. 구체적으로, 더미다는 난독화된 프로그램(2)이 언패킹된 코드 섹션(25)으로 점프하면, 모든 프로세스가 완료되도록 설계되어 있으며(규칙 2-4 참조), 이에 따라 패킹되거나, 암호화되거나, 압축되거나 및/또는 제거된 모든 객체는 복원되게 된다. 이에 따라 원시 코드 추출부(123)는 난독화된 프로그램(2)의 원시 코드 및 원시 데이터 중 적어도 하나를 획득할 수 있게 된다.The source code extraction unit 123 may extract at least one of the source code and the source data. For example, after the obfuscated program 2 jumps to the unpacked code section 25, the source code and the source code At least one of the data can be extracted. Specifically, when the obfuscated program (2) of the dummy jumps to the unpacked code section (25), all processes are designed to be completed (refer to Rule 2-4), and packed, encrypted, or compressed accordingly. All objects that have been destroyed and/or removed will be restored. Accordingly, the source code extraction unit 123 may acquire at least one of the source code and the source data of the obfuscated program 2.

출력부(132)는 상술한 바에 따라 획득한 정보를 출력할 수 있다. 예를 들어, 출력부(132)는 임포트 주소 테이블 탐지부(117)가 획득한 임포트 주소 테이블에 대한 정보(일례로, 임포트 주소 테이블의 위치를 저장하고 있는 로그), 직접 호출/점프 탐지부(119)가 획득한 직접 호출/점프에 대한 정보(일례로 직접 호출/점프 명령문의 위치 또는 직접 호출/점프 명령문에 대한 간접 주소를 포함하고 있는 로그), 원시 엔트리 포인트 확인부(121)에 의해 확인된 원시 엔트리 포인트에 대한 정보(일례로 원시 엔트리 포인트 로그), 원시 코드 추출부(123)에 의해 추출된 원시 코드 및 원시 코드 추출부(123)에 의해 추출된 원시 데이터 중 적어도 하나를 출력할 수 있다. 필요에 따라서, 출력부(132)는 분석 방지 탐지 결과나 응용 프로그램 인터페이스 래핑 식별 및 처리 결과 등을 더 출력할 수도 있다.The output unit 132 may output information obtained as described above. For example, the output unit 132 includes information on the import address table acquired by the import address table detection unit 117 (for example, a log storing the location of the import address table), a direct call/jump detection unit ( Information on the direct call/jump acquired by 119) (for example, the location of the direct call/jump statement or the log containing the indirect address for the direct call/jump statement), confirmed by the original entry point verification unit 121 At least one of information on the sourced entry point (for example, the source entry point log), the source code extracted by the source code extraction unit 123, and the source data extracted by the source code extraction unit 123 can be output. have. If necessary, the output unit 132 may further output an analysis prevention detection result or an application program interface wrapping identification and processing result.

출력부(132)에 의해 출력된 정보는 복원부(160)로 전달될 수 있다. 실시예에 따라서, 출력부(132)는 획득한 정보의 전부 또는 일부를 포괄하여 복원부(160)에 전달할 수도 있고 또는 정보가 획득될 때마다 획득한 정보의 전부 또는 일부를 복원부(160)에 전달할 수도 있다.Information output by the output unit 132 may be transmitted to the restoration unit 160. Depending on the embodiment, the output unit 132 may include all or part of the acquired information and transmit it to the restoration unit 160, or the restoration unit 160 may transmit all or part of the acquired information each time information is acquired. You can also pass it on.

도 4에는 상술한 난독화 판단부(111), 분석 방지 탐지부(113), 응용 프로그래밍 인터페이스 래핑 처리부(115), 임포트 주소 테이블 탐지부(117), 직접 호출/점프(DCJ, Direct Call & Jump) 탐지부(119), 원시 엔트리 포인트 확인부(121) 및 원시 코드 추출부(123)가 순차적으로 동작하여 정보를 획득하는 것으로 도시되어 있으나, 이들(111 내지 123)의 동작 및 처리 순서는 도 4에 도시된 바에 한정되는 것은 아니다. 이들(111 내지 123)의 동작 및 처리 순서는 설계자의 판단에 따라 임의적으로 변경될 수도 있다.4 shows the above-described obfuscation determination unit 111, analysis prevention detection unit 113, application programming interface wrapping processing unit 115, import address table detection unit 117, direct call/jump (DCJ, Direct Call & Jump). ) The detection unit 119, the source entry point verification unit 121, and the source code extraction unit 123 are shown to sequentially operate to obtain information, but the operation and processing sequence of these (111 to 123) are shown in FIG. It is not limited to what is shown in 4. The operation and processing order of these 111 to 123 may be arbitrarily changed according to the judgment of the designer.

도 5는 복원부의 일 실시예에 대한 블록도이다.5 is a block diagram of an embodiment of a restoration unit.

복원부(160)는 원 프로그램(1)과 동일 또는 유사한 결과 프로그램을 생성할 수 있다. 이에 따라 원 프로그램(1)이 복원될 수 있다.The restoration unit 160 may generate a result program identical to or similar to the original program 1. Accordingly, the original program 1 can be restored.

실시예에 따라서, 복원부(160)는 분석부(110)로부터 원 프로그램(1)에 대한 정보(들)를 수신하고, 수신한 정보(들)를 기반으로 결과 프로그램을 생성할 수도 있다. 이 경우, 복원부(160)는 분석부(110)의 분석이 종료된 이후에 복원 과정을 수행하여 결과 프로그램을 생성할 수도 있고, 또는 분석부(110)의 분석 과정이 진행되는 동안에 복원 과정을 수행하여 결과 프로그램을 생성할 수도 있다. 후자의 경우, 분석부(110)는 분석에 따라 소정의 정보가 획득되면, 분석의 종료 여부와 무관하게 획득한 정보를 복원부(160)로 전송하고, 복원부(160)는 수신한 정보를 실시간으로 또는 비실시간으로 이용하여 결과 프로그램을 생성 및 복원할 수 있다. 복원부(160)는 입력된 난독화된 프로그램(2)과 원 프로그램(1)에 대한 정보를 기반으로, 원 프로그램(1)에 대응하는 프로그램(즉, 결과 프로그램)을 완전히 재구성할 수 있기 때문에, 복원부(160)에 의해 결과 프로그램은 바로 실행이 가능한 장점이 있다. 또한, 복원부(160)는 사용자(예를 들어, 분석가)의 조작 없이도 자동적으로 결과 프로그램의 생성이 가능하므로, 사용자의 편의가 개선되는 효과도 얻을 수 있다.Depending on the embodiment, the restoration unit 160 may receive information(s) about the original program 1 from the analysis unit 110 and generate a result program based on the received information(s). In this case, the restoration unit 160 may perform a restoration process after the analysis of the analysis unit 110 is finished to generate a result program, or perform the restoration process while the analysis process of the analysis unit 110 is in progress. Can also be executed to generate the resulting program. In the latter case, when predetermined information is obtained according to the analysis, the analysis unit 110 transmits the acquired information to the restoration unit 160 regardless of whether the analysis is terminated, and the restoration unit 160 receives the received information. The resulting program can be created and restored using real-time or non-real-time. Since the restoration unit 160 can completely reconstruct a program corresponding to the original program 1 (ie, the result program) based on the input obfuscated program 2 and the information on the original program 1 , There is an advantage that the resultant program can be executed immediately by the restoration unit 160. In addition, since the restoration unit 160 can automatically generate a result program without manipulation of a user (eg, an analyst), the user's convenience may be improved.

도 5에 도시된 바를 참조하면, 복원부(160)는 패치부(161), 압축 처리부(163), 엔트리 포인트 처리부(165), 임포트 디렉터리 테이블 구축부(167, IDT 구축부), 임포트 주소 테이블 구축부(169, IAT 구축부), 간접 호출/점프(ICJ, Indirect Call & Jump) 처리부(171) 및 프로그램 생성부(173)를 포함할 수 있다. 또한, 복원부(160)는 입력부(181) 및 출력부(182)를 더 포함할 수 있다. 실시예에 따라서, 이들 요소(163 내지 173, 181, 182) 중 적어도 하나는 생략 가능하며, 및/또는 이들 요소(163 내지 173, 181, 182) 외에 다른 요소가 더 추가되는 것도 가능하다.5, the restoration unit 160 includes a patch unit 161, a compression processing unit 163, an entry point processing unit 165, an import directory table construction unit 167 (IDT construction unit), and an import address table. It may include a construction unit 169 (IAT construction unit), an indirect call / jump (ICJ, Indirect Call & Jump) processing unit 171 and a program generation unit 173. In addition, the restoration unit 160 may further include an input unit 181 and an output unit 182. Depending on the embodiment, at least one of these elements (163 to 173, 181, 182) may be omitted, and/or other elements other than these elements (163 to 173, 181, 182) may be further added.

입력부(181)는 난독화된 프로그램(2)을 수신할 수 있고, 및/또는 분석부(110)의 출력부(132)에서 출력되는 정보를 수신할 수 있다. 여기서, 출력부(132)에서 출력되는 정보는 임포트 주소 테이블에 대한 정보, 직접 호출/점프에 대한 정보, 원시 엔트리 포인트에 대한 정보, 원시 코드 및 원시 데이터 중 적어도 하나를 포함할 수 있다.The input unit 181 may receive the obfuscated program 2 and/or may receive information output from the output unit 132 of the analysis unit 110. Here, the information output from the output unit 132 may include at least one of information about the import address table, information about direct call/jump, information about an original entry point, source code, and source data.

입력부(181)는 수신한 프로그램 및/또는 정보를 패치부(161), 압축 처리부(163), 엔트리 포인트 처리부(165), 임포트 디렉터리 테이블 구축부(167), 임포트 주소 테이블 구축부(169), 간접 호출/점프 처리부(171) 및 프로그램 생성부(173) 중 적어도 하나로 전달할 수도 있다. 이 경우, 입력부(181)는 수신한 프로그램 및/또는 정보를 각각에 대응하는 요소(163 내지 173)로 전달할 수 있다. 예를 들어, 입력부(181)는 분석부(110)에 의해 추출된 코드 및 데이터를 패치부(161)에 전달할 수도 있고, 엔트리 포인트에 대한 정보를 엔트리 포인트를 처리하는 EP 처리부(165)로 전달할 수도 있다.The input unit 181 includes a patch unit 161, a compression processing unit 163, an entry point processing unit 165, an import directory table construction unit 167, an import address table construction unit 169, and the received program and/or information. It may be transmitted to at least one of the indirect call/jump processing unit 171 and the program generation unit 173. In this case, the input unit 181 may transmit the received program and/or information to the elements 163 to 173 corresponding to each. For example, the input unit 181 may transmit the code and data extracted by the analysis unit 110 to the patch unit 161, or transmit information on the entry point to the EP processing unit 165 that processes the entry point. May be.

패치부(161)는 원시 코드 및/또는 원시 데이터를 패치할 수 있다. 원시 코드 및/또는 원시 데이터는 상술한 분석부(110)의 원시 코드 추출부(123)가 추출한 것일 수 있다. 패치부(161)는 코드 및/또는 데이터의 패치 결과를 압축 처리부(163)나 엔트리 포인트 처리부(165) 등으로 전달할 수 있다.The patch unit 161 may patch the source code and/or the source data. The source code and/or the source data may be extracted by the source code extraction unit 123 of the analysis unit 110 described above. The patch unit 161 may transmit the patch result of the code and/or data to the compression processing unit 163 or the entry point processing unit 165.

압축 처리부(163)는 각각의 섹션(예를 들어, 데이터 섹션(24) 또는 코드 섹션(25))의 압축 및 압축 해제와 관련된 처리를 수행할 수 있다. 일 실시예에 의하면, 압축 처리부(163)는 압축 여부 판단부(163-1) 및 압축 해제부(163-2)를 포함할 수 있다.The compression processing unit 163 may perform processing related to compression and decompression of each section (eg, the data section 24 or the code section 25). According to an embodiment, the compression processing unit 163 may include a compression determination unit 163-1 and a decompression unit 163-2.

압축 여부 판단부(163-1)는 난독화된 프로그램(2)이 압축되었는지 여부를 판단할 수 있다. 예를 들어, 난독화된 프로그램(2)이 데이터 섹션(24) 및/또는 코드 섹션(25)을 포함하는 경우, 압축 여부 판단부(163-1)는 이들 섹션(24, 25) 각각 또는 이들 섹션(24, 25) 모두의 원시 섹션(raw section)의 크기를, 대응하는 가상 섹션(virtual section)의 크기와 서로 비교함으로써, 난독화된 프로그램(2)의 압축 여부를 판단할 수도 있다.The compression determination unit 163-1 may determine whether the obfuscated program 2 is compressed. For example, if the obfuscated program 2 includes the data section 24 and/or the code section 25, the compression determination unit 163-1 may each of the sections 24 and 25 or It is also possible to determine whether the obfuscated program 2 is compressed by comparing the size of the raw section of both the sections 24 and 25 with the size of the corresponding virtual section.

압축 해제부(163-2)는 압축 여부 판단부(163-1)의 판단 결과를 기반으로 압축 해제(decompression)를 수행할 수 있다. 예를 들어, 만약 코드 섹션(25) 및/또는 데이터 섹션(24)이 압축되어 있다고 판단되면, 코드 섹션(25)에 대한 정보 및/또는 데이터 섹션(24)에 대한 정보를 수정하여 원 프로그램(1)에 대응하는 결과 프로그램의 정확한 재구축이 가능하게 할 수 있다.The decompression unit 163-2 may perform decompression based on a determination result of the compression determination unit 163-1. For example, if it is determined that the code section 25 and/or the data section 24 is compressed, the information about the code section 25 and/or the information about the data section 24 is modified to modify the original program ( The result program corresponding to 1) can be accurately rebuilt.

엔트리 포인트 처리부(165)는 분석부(110), 보다 구체적으로는 원시 엔트리 포인트 확인부(121)에 의해 추출된 엔트리 포인트를 패치할 수 있다.The entry point processing unit 165 may patch the entry point extracted by the analysis unit 110, more specifically, the original entry point verification unit 121.

임포트 디렉터리 테이블 구축부(167)는 추출된 임포트 주소 테이블 로그를 이용하여 임포트 디렉터리 테이블을 구축할 수 있다. 더미다는 난독화 시 임포트 디렉터리 테이블도, 임포트 주소 테이블과 동일하게 훼손시키나, 복원 시에는 임포트 디렉터리 테이블을 재작성하지 않는다. 그러나, 더미다는 런타임에서 임포트 주소 테이블을 특정한 위치(예를 들어, 원 프로그램(1)의 임포트 주소 테이블과 동일한 위치)에 재작성하므로, 재작성된 임포트 주소 테이블 및 함수 명칭을 이용하면 임포트 디렉터리 테이블을 복원할 수 있게 된다.The import directory table construction unit 167 may build an import directory table using the extracted import address table log. When dummy is obfuscated, the import directory table is also damaged in the same way as the import address table, but the import directory table is not recreated when restoring. However, since Dummy Dummy rewrites the import address table in a specific location (for example, the same location as the import address table of the original program (1)) at runtime, the import directory table is rewritten by using the rewritten import address table and function name. It can be restored.

임포트 주소 테이블 구축부(169)는 임포트 주소 테이블을 복원할 수 있다. 일 실시예에 의하면, 주소 테이블 구축부(169)는 임포트 주소 테이블의 복원을 위해 함수의 명칭을 이용할 수 있다. 물론 주소 테이블 구축부(169)는 함수의 서수(ordinal)나 가상 주소를 추출하여 임포트 주소 테이블을 구축하는 것도 가능하나, 핀 툴 등의 도구를 이용하는 경우에는 함수의 서수나 가상 주소의 추출은 함수의 명칭의 추출에 비해 상대적으로 어려울 수 있다.The import address table construction unit 169 may restore the import address table. According to an embodiment, the address table construction unit 169 may use the name of the function to restore the import address table. Of course, the address table construction unit 169 can extract the ordinal or virtual address of the function to construct the import address table. However, in the case of using a tool such as a pin tool, the extraction of the function ordinal or virtual address It can be relatively difficult compared to the extraction of the name of.

간접 호출/점프 처리부(171)는 직접 호출/점프 명령문을 수정하여 간접 호출/점프 명령문을 획득할 수 있다. 간접 호출/점프 처리부(171)는 이를 위해서 직접 호출/점프 로그에 기록된 직접 호출/점프 명령문의 간접 주소를 참조할 수도 있다.The indirect call/jump processing unit 171 may obtain the indirect call/jump command by modifying the direct call/jump command. For this purpose, the indirect call/jump processing unit 171 may refer to the indirect address of the direct call/jump command recorded in the direct call/jump log.

프로그램 생성부(173)는 패치부(161), 압축 처리부(163), 엔트리 포인트 처리부(165), 임포트 디렉터리 테이블 구축부(167), 임포트 주소 테이블 구축부(169) 및 간접 호출/점프 처리부(171)의 처리 결과를 기반으로 결과 프로그램을 구축한다. 이에 따라 원 프로그램(1)에 대응하는 프로그램의 복원 및 획득이 가능해 진다.The program generation unit 173 includes a patch unit 161, a compression processing unit 163, an entry point processing unit 165, an import directory table construction unit 167, an import address table construction unit 169, and an indirect call/jump processing unit ( 171), a result program is constructed. Accordingly, it is possible to restore and obtain a program corresponding to the original program (1).

상술한 분석부(110) 및 복원부(160) 중 적어도 하나는, 동일하게 또는 일부 변형되어, 더미다 이외의 다른 난독화 툴(예를 들어, 윈 라이선스 또는 브이엠프로텍트 등)로 난독화된 프로그램(2)의 역난독화에도 적용될 수 있다.At least one of the above-described analysis unit 110 and restoration unit 160 is identically or partially deformed and obfuscated with an obfuscation tool other than Dummy Da (for example, Win License or VM Protect, etc.) It can also be applied to reverse obfuscation of program (2).

예를 들어, 윈 라이선스에 의해 난독화된 프로그램(2)은 더미다에 의해 난독화된 프로그램(2)과 그 구조가 본질적으로 동일 또는 유사하므로, 상술한 분석부(110) 및 복원부(160)를 동일하게 또는 이를 일부 변형시켜 윈 라이선스에 의해 난독화된 프로그램(2)으로부터 원 프로그램(1)을 복원할 수 있다.For example, since the program 2 obfuscated by the Win license is essentially the same or similar in structure to the program 2 obfuscated by the dummy, the above-described analysis unit 110 and restoration unit 160 The original program (1) can be restored from the program (2) obfuscated by the Win license by identically or partially modifying it.

브이엠프로텍트는 더미다에 비해 상대적으로 적은 옵션을 제공하되, 임포트 보호 옵션(import protect option)을 적용하는 경우 임포트 주소 테이블을 훼손하지 않는다. 또한, 브이엠프로텍트는 더미다1 섹션 및 더미다2 섹션과 유사하게 두 개의 섹션(vmp1 및 vmp0 섹션)을 실행시켜 코드 및 데이터 섹션을 복원하도록 하되, 텍스트 섹션 그 자체를 난독화하지는 않는다. 따라서, 임포트 주소 테이블의 복구 없이도 원 코드와 거의 전적으로 동일한 지점에 복원된다. 이런 점을 고려하면, 상술한 분석부(110) 및 복원부(160)와 동일하거나 또는 일부 변형된 방법을 이용하면, 브이엠프로텍트를 기반으로 난독화된 프로그램(2)으로부터도 원 프로그램(1)을 복원할 수 있다.VM Protect provides relatively few options compared to dummy, but does not damage the import address table when the import protect option is applied. In addition, VM Protect restores the code and data sections by executing two sections (vmp1 and vmp0 sections) similar to the dummy1 section and the dummyda2 section, but does not obfuscate the text section itself. Therefore, it is restored almost entirely to the same point as the original code without the need to restore the import address table. Considering this point, if the same or partially modified method as the above-described analysis unit 110 and restoration unit 160 is used, the original program (1) from the obfuscated program (2) based on the VM Protect ) Can be restored.

이하, 도 6 내지 도 8을 참조하여 역난독화 방법의 여러 실시예에 대해서 설명하도록 한다.Hereinafter, various embodiments of the de-obfuscation method will be described with reference to FIGS. 6 to 8.

도 6은 역난독화 방법의 일 실시예에 대한 흐름도이다.6 is a flowchart of an embodiment of a de-obfuscation method.

도 6에 도시된 바에 의하면, 먼저 원 프로그램이 난독화된다(200). 난독화는 소정의 난독화 툴을 기반으로 수행될 수 있으며, 예를 들어, 더미다, 윈 라이선스 및/또는 브이엠프로텍트를 기반으로 수행될 수 있다. 이에 따라 난독화된 프로그램이 생성된다. 원 프로그램의 난독화는 난독화 장치에 의해 수행될 수 있으며, 난독화 장치는 후술하는 역난독화 장치와 동일한 장치일 수도 있고 또는 서로 상이한 장치일 수도 있다. 난독화 장치가 역난독화 장치와 서로 상이한 경우, 양자는 동종의 장치일 수도 있고 이종의 장치일 수도 있다.As shown in FIG. 6, first, the original program is obfuscated (200). Obfuscation may be performed based on a predetermined obfuscation tool, for example, may be performed based on a dummy, a Win license, and/or a VM Protect. Accordingly, an obfuscated program is created. The obfuscation of the original program may be performed by the obfuscation device, and the obfuscation device may be the same device as the de-obfuscation device described later, or may be different devices. When the obfuscation apparatus is different from the de-obfuscation apparatus, both may be the same type of apparatus or a heterogeneous apparatus.

일 실시예에 의하면, 원 프로그램이 난독화되는 경우, 적어도 하나의 난독화 옵션 중 적어도 하나의 옵션이 선택 및 적용될 수 있다. 예를 들어, 안티 디버거 옵션, 안티 덤퍼 옵션, 안티 패칭 옵션, 애플리케이션 또는 자원에 대한 압축화 옵션, 시큐어 엔진 코드 또는 자원의 압축화 옵션, 응용 프로그램 인터페이스 래핑 옵션 또는 엔트리 포인트 난독화 옵션 등 이진 코드 수준에서 분석 방지를 위한 다양한 옵션이 난독화 과정에서 적용 가능하다.According to an embodiment, when the original program is obfuscated, at least one of at least one obfuscation option may be selected and applied. Binary code level, for example, anti-debugger options, anti-dumper options, anti-patching options, compression options for applications or resources, compression options for secure engine code or resources, application interface wrapping options, or entry point obfuscation options. In the process of obfuscation, various options for preventing analysis are applicable.

역난독화 장치는 난독화 장치로부터 난독화된 프로그램을 획득할 수 있다(202). 예를 들어, 역난독화 장치는 적어도 하나의 메모리 매체나 유무선 통신 네트워크 등을 통해 난독화된 프로그램을 획득할 수도 있다. 만약 난독화 장치가 역난독화 장치와 동일한 장치라면, 난독화 종료 즉시 역난독화 장치는 난독화된 프로그램을 획득하게 된다.The de-obfuscation apparatus may obtain an obfuscated program from the obfuscation apparatus (202). For example, the deobfuscation apparatus may acquire an obfuscated program through at least one memory medium or a wired/wireless communication network. If the obfuscation device is the same device as the de-obfuscation device, the de-obfuscation device acquires the obfuscated program immediately after the obfuscation ends.

역난독화 장치는, 사용자의 조작에 따라 수동으로 또는 미리 정의된 설정에 따라 자동으로 난독화된 프로그램의 분석을 개시할 수 있다(210). 난독화된 프로그램의 분석에 따라서 역난독화 장치는 원 프로그램에 대응하는 결과 프로그램의 생성을 위한 각종 정보를 획득할 수 있다. 예를 들어, 역난독화 장치는 분석 결과에 따라 분석 방지 적용 여부에 대한 정보, 응용 프로그래밍 인터페이스 래핑 여부에 대한 정보, 임포트 주소 테이블, 직접 호출 및 점프 명령문, 원시 엔트리 포인트, 원시 코드 및 원시 데이터 중 적어도 하나를 획득할 수 있다. 실시예에 따라서, 난독화된 프로그램의 분석 과정(210)은 생략될 수도 있다.The de-obfuscation apparatus may initiate analysis of the obfuscated program manually according to a user's manipulation or automatically according to a predefined setting (210). According to the analysis of the obfuscated program, the deobfuscation apparatus may acquire various types of information for generating a result program corresponding to the original program. For example, according to the analysis result, the de-obfuscation device provides information on whether to apply analysis prevention, information on whether to wrap the application programming interface, import address table, direct call and jump statements, raw entry points, raw code and raw data. At least one can be obtained. Depending on the embodiment, the analysis process 210 of the obfuscated program may be omitted.

역난독화 장치는 난독화 되기 전의 원 프로그램에 대응하는 결과 프로그램을 생성할 수도 있다(230). 이 경우, 역난독화 장치는 난독화된 프로그램의 분석이 종료되거나(즉, 단계 210의 종료 이후) 또는 난독화된 프로그램이 분석되는 동안(즉, 단계 210과 더불어)에 결과 프로그램을 생성할 수 있다. 역난독화 장치는, 결과 프로그램의 생성을 위해 분석 과정(210)에서 획득된 적어도 하나의 정보를 이용할 수도 있다. 실시예에 따라서, 결과 프로그램의 생성 과정(230)은 생략되는 것도 가능하다.The de-obfuscation apparatus may generate a result program corresponding to the original program before being obfuscated (230). In this case, the de-obfuscation apparatus can generate the resulting program when the analysis of the obfuscated program is finished (ie, after the end of step 210) or while the obfuscated program is being analyzed (ie, together with step 210). have. The de-obfuscation apparatus may use at least one piece of information acquired in the analysis process 210 to generate a result program. Depending on the embodiment, the process 230 of generating the result program may be omitted.

이하 난독화된 프로그램의 분석 과정(210)의 일 실시예에 대해 보다 상세히 설명한다.Hereinafter, an embodiment of the analysis process 210 of the obfuscated program will be described in more detail.

도 7은 난독화된 프로그램의 분석 방법의 일 실시예에 대한 흐름도이다.7 is a flowchart of an example of a method for analyzing an obfuscated program.

도 7에 도시된 바에 의하면, 난독화된 프로그램의 분석을 위해 먼저 입력된 프로그램이 난독화된 프로그램인지 여부가 판단될 수 있다(211). 또한, 필요에 따라, 난독화를 위해 어떤 프로그램이 이용되었는지 여부도 판단될 수 있다. 일 실시예에 의하면, 난독화된 프로그램인지 여부의 판단은 상술한 난독화 툴의 내제적 특징을 이용하여 수행 가능하다. 난독화 툴의 내제적 특징은, 예를 들어, 언패킹 루틴이나 바이트 패턴 등을 포함할 수 있다.As shown in FIG. 7, for analysis of the obfuscated program, it may be determined whether or not the first input program is an obfuscated program (211). Also, if necessary, it may be determined whether a program is used for obfuscation. According to an embodiment, the determination of whether or not the program is obfuscated can be performed using the intrinsic characteristics of the above-described obfuscation tool. The inherent characteristics of the obfuscation tool may include, for example, an unpacking routine or a byte pattern.

만약 프로그램이 난독화되지 않았다고 판단되면(211의 NO), 프로그램의 분석 과정(210)은 종료되고, 복원 과정(230)도 수행되지 않는다.If it is determined that the program has not been obfuscated (NO in 211), the analysis process 210 of the program is terminated, and the restoration process 230 is not performed.

반대로 만약 프로그램이 난독화되었다고 판단되면(211의 YES), 원 프로그램의 난독화 과정(200)에서 분석 방지 옵션의 적용 여부가 순차적으로 판단될 수 있다(212). 예를 들어, 분석 방지 옵션의 적용 여부는 멀티 스레드 프로그램의 추적이 가능한 핀 툴을 이용하여 판단될 수 있다.Conversely, if it is determined that the program has been obfuscated (YES in 211), it may be sequentially determined whether to apply the analysis prevention option in the obfuscation process 200 of the original program (212). For example, whether or not the analysis prevention option is applied may be determined using a pin tool capable of tracking a multi-threaded program.

또한, 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부도 판단될 수 있다(213). 예를 들어, 인터페이스 래핑 옵션의 적용 여부는, 읽기, 쓰기 및 실행 권한을 갖는 소정의 함수를 감시함으로써 수행될 수도 있다.In addition, it may be determined whether the application programming interface wrapping option is applied (213). For example, whether or not the interface wrapping option is applied may be performed by monitoring a predetermined function having read, write, and execution rights.

만약 응용 프로그램 인터페이스 래핑 옵션이 적용되었다면(213의 YES), 이에 응하여 원래의 응용 프로그래밍 인터페이스 주소가 획득될 수 있다(214). 이 경우, 응용 프로그래밍 인터페이스 복제 지시에 포함된 원 주소 및 목적지 주소를 감시함으로써 원래의 응용 프로그래밍 인터페이스 주소가 획득될 수 있다. 획득된 응용 프로그래밍 인터페이스 주소는 언래핑 로그 등에 기록될 수 있다. 이와 반대로 응용 프로그램 인터페이스 래핑 옵션이 적용되지 않았다면(213의 아니오), 응용 프로그래밍 인터페이스 주소의 획득 과정은 수행되지 않을 수 있다.If the application program interface wrapping option is applied (YES in 213), the original application programming interface address may be obtained in response thereto (214). In this case, the original application programming interface address can be obtained by monitoring the original address and the destination address included in the application programming interface copy instruction. The obtained application programming interface address may be recorded in an unwrapping log or the like. Conversely, if the application program interface wrapping option is not applied (No in 213), the process of obtaining the application programming interface address may not be performed.

또한, 임포트 주소 테이블 탐지되고, 이에 따라 임포트 주소 테이블이 존재하는 위치가 결정될 수 있다(215). 더미다의 경우 텍스트 섹션, 데이터 섹션 및 임포트 주소 테이블 섹션을 최상단 섹션에 병합하므로 최상단 섹션에 데이터 기록 여부를 감시하면 임포트 주소 테이블의 위치를 알 수 있게 된다. 응용 프로그래밍 인터페이스 주소가 획득된 경우(214)에는 임포트 주소 테이블은 응용 프로그래밍 인터페이스 주소를 이용하여 보완될 수도 있다.In addition, the import address table is detected, and accordingly, a location where the import address table exists may be determined (215). In the case of dummy da, the text section, data section, and import address table section are merged into the top section, so if you monitor whether data is written to the top section, you can know the location of the import address table. When the application programming interface address is obtained 214, the import address table may be supplemented using the application programming interface address.

또한, 직접 호출/점프 명령문을 탐지하여 직접 호출/점프 명령문의 위치가 확인 및 기록될 수도 있다(216). 이 경우, 직접 호출/점프 명령문의 간접 주소도 마찬가지로 확인 및 기록될 수도 있으며, 이는 직접 호출/점프 명령문을 간접 호출/점프 명령문으로 다시 변환하기 위해서 수행될 수 있다. 직접 호출/점프 명령문의 위치 또는 직접 호출/점프 명령문에 대한 간접 주소는, 예를 들어 직접 호출/점프 로그에 기록될 수도 있다.Also, by detecting the direct call/jump command, the location of the direct call/jump command may be checked and recorded (216). In this case, the indirect address of the direct call/jump statement can be checked and recorded as well, and this can be performed to convert the direct call/jump statement back to an indirect call/jump statement. The location of a direct call/jump statement or an indirect address for a direct call/jump statement may be recorded in the direct call/jump log, for example.

한편, 원시 엔트리 포인트가 확인될 수 있다(217). 더미다의 경우, 원래의 코드, 데이터 및 임포트 주소 테이블의 위치는 다른 위치로 옮겨지지 않고 또한 난독화된 프로그램은 원시 엔트리 포인트가 목표 주소로 설정하여 언패킹된 코드 섹션으로 이동하므로, 먼저 난독화된 프로그램의 실행 여부를 판단하고 순차적으로 원시 엔트리 포인트가 확인될 수 있다. 확인된 원시 엔트리 포인트는, 일례로 원시 엔트리 포인트 로그에 기록될 수 있다.Meanwhile, the original entry point may be identified (217). In the case of dummy, the location of the original code, data, and import address table is not moved to another location, and the obfuscated program moves to the unpacked code section with the original entry point set as the target address, so it is first obfuscated. It is judged whether or not the program is executed, and the original entry points can be sequentially checked. The verified original entry point may be recorded in the original entry point log, for example.

또한, 원시 코드 및/또는 원시 데이터가 추출될 수 있다(218). 난독화된 프로그램이 언패킹된 코드 섹션으로 점프 이동하여 난독화된 모든 객체는 복원되므로, 이를 이용하여 원시 코드 및/또는 원시 데이터를 추출할 수 있다.In addition, source code and/or source data may be extracted (218). Since the obfuscated program jumps to the unpacked code section and all obfuscated objects are restored, the source code and/or the source data can be extracted using this.

추출된 임포트 주소 테이블에 대한 정보, 직접 호출/점프에 대한 정보, 원시 엔트리 포인트에 대한 정보, 원시 코드 및/또는 원시 데이터 등에 대한 정보가 출력된다(219). 출력된 정보는 복원 과정(220)을 위해 이용될 수 있다. 정보의 출력(219)은 상술한 동작(211 내지 218)이 모두 종료된 이후에 수행될 수도 있다. 또한, 정보의 출력(219)은 상술한 동작(211 내지 218)이 수행되는 도중에 수행되는 것도 가능하다. 이 경우, 정보의 출력(219)은 상술한 동작(212 내지 218) 중 적어도 하나가 수행되어 정보가 획득되면 즉시 또는 일정 시간 이내에 수행될 수도 있다.Information about the extracted import address table, information about direct call/jump, information about the original entry point, information about the source code and/or the source data is output (219). The outputted information may be used for the restoration process 220. The information output 219 may be performed after all of the above-described operations 211 to 218 are completed. In addition, the information output 219 may be performed while the above-described operations 211 to 218 are performed. In this case, the information output 219 may be performed immediately or within a predetermined time when at least one of the above-described operations 212 to 218 is performed to obtain information.

상술한 동작들(211 내지 219)은 동시에 또는 이시에 수행될 수도 있으며, 이시에 수행되는 경우에는 순차적으로 수행될 수도 있다. 또한, 상술한 동작들(211 내지 219) 중에서 난독화 여부 판단(211)을 제외한 나머지 동작들(212 내지 219)은 상술한 바와 설계자의 선택에 따라서 상술한 바와 상이한 순서로 처리될 수 있다. 예를 들어, 직접 호출 및 점프를 탐지하는 동작(216)은 임포트 주소 테이블 탐지 동작(215) 이전에 수행될 수도 있고 또는 원시 엔트리 포인트 확인 동작(217) 이후에 수행될 수도 있다. 설계자의 선택에 따라서 동작(212 내지 219)의 일부는 생략되는 것도 가능하다. 또한, 분석 방지 옵션 적용 여부 판단 동작(212) 등은 생략될 수도 있다.The above-described operations 211 to 219 may be performed at the same time or at the same time, or may be performed sequentially when performed at this time. In addition, among the aforementioned operations 211 to 219, the operations 212 to 219 other than the obfuscation determination 211 may be processed in a different order as described above and according to the designer's selection. For example, the direct call and jump detection operation 216 may be performed before the import address table detection operation 215 or after the original entry point verification operation 217. Some of the operations 212 to 219 may be omitted depending on the designer's selection. In addition, the operation 212 of determining whether to apply the analysis prevention option may be omitted.

이하 결과 프로그램의 생성 과정, 즉 원 프로그램의 복원 과정(230)의 일 실시예에 대해 보다 상세히 설명하도록 한다.Hereinafter, an embodiment of the process of generating the result program, that is, the process of restoring the original program 230 will be described in more detail.

도 8은 결과 프로그램의 복원 방법의 일 실시예에 대한 흐름도이다.8 is a flowchart of an embodiment of a method for restoring a result program.

도 8에 도시된 바에 의하면, 원시 코드가 패치되고 필요에 따라 원시 데이터도 함께 패치될 수 있다(231). 원시 코드 및 원시 데이터는 난독화된 프로그램의 분석 동작(210)에 따라 획득된 것일 수 있다.As shown in FIG. 8, the source code is patched, and the source data may also be patched as needed (231). The source code and the source data may be obtained according to the analysis operation 210 of the obfuscated program.

난독화된 프로그램이 압축되었는지 여부가 판단될 수 있다(232). 압축 여부의 판단은 데이터 섹션 및/또는 코드 섹션의 원시 섹션의 크기와 대응하는 가상 섹션의 크기의 상호 비교를 통해 수행될 수도 있다.Whether or not the obfuscated program has been compressed may be determined (232). Determination of compression may be performed by comparing the size of the original section of the data section and/or the code section with the size of the corresponding virtual section.

만약 난독화된 프로그램이 압축된 상태라면(232의 YES), 압축 해제가 수행될 수 있으며, 예를 들어 코드 섹션 및/또는 데이터 섹션에 대한 압축 해제가 수행될 수 있다(233). 만약 난독화된 프로그램이 압축된 상태가 아니라면(232의 NO), 압축 해제 동작(233)은 수행되지 않을 수 있다.If the obfuscated program is in a compressed state (YES in 232), decompression may be performed, and for example, decompression may be performed on the code section and/or the data section (233). If the obfuscated program is not in a compressed state (NO in 232), the decompression operation 233 may not be performed.

또한, 엔트리 포인트 패치가 수행될 수 있다(234). 엔트리 포인트는 상술한 원시 엔트리 포인트 확인 동작(217)에 의해 획득된 것일 수 있다.Also, an entry point patch may be performed (234). The entry point may be obtained by the above-described original entry point verification operation 217.

임포트 디렉터리 테이블의 구축 동작이 수행될 수 있다(235). 임포트 디렉터리 테이블의 구축은 임포트 주소 테이블 로그를 이용하여 수행될 수 있으며, 특히 재작성된 임포트 주소 테이블 및 함수 명칭을 이용하여 수행될 수 있다.The construction of the import directory table may be performed (235). The construction of the import directory table may be performed using the import address table log, and in particular, may be performed using the rewritten import address table and function name.

임포트 주소 테이블의 복원 역시 수행될 수 있다(236). 이때, 함수의 명칭, 함수의 서수나 가상 주소 등을 통해서 임포트 주소 테이블은 복원될 수 있다.Restoration of the import address table may also be performed (236). In this case, the import address table may be restored through the name of the function, the ordinal number of the function, or the virtual address.

간접 호출/점프 명령문이 획득할 수도 있으며(237), 간접 호출/점프 명령문은 직접 호출/점프 명령문을 수정하여 획득될 수 있다. 이를 위해서 직접 호출/점프 명령문의 간접 주소가 참조되는 것도 가능하다.The indirect call/jump statement may be obtained (237), and the indirect call/jump statement may be obtained by modifying the direct call/jump statement. For this, it is possible to refer to the indirect address of the direct call/jump statement.

상술한 동작(231 내지 237)의 결과를 기반으로 결과 프로그램이 생성될 수 있다(238). 결과 프로그램은 원 프로그램과 동일하거나 또는 유사하게 생성될 수 있다. 상술한 동작들(231 내지 238)에 따르면, 원 프로그램의 포맷이 입력된 난독화된 프로그램 및 원본 정보를 이용하여 완전히 재구성되기 때문에, 생성된 결과 프로그램은 바로 실행이 가능하게 된다.A result program may be generated based on the results of the operations 231 to 237 described above (238). The resulting program can be created identical to or similar to the original program. According to the above-described operations 231 to 238, since the format of the original program is completely reconstructed using the input obfuscated program and original information, the generated result program can be executed immediately.

상술한 실시예에 따른 역난독화 방법, 분석 방법 및 복원 방법은 컴퓨터 장치에 의해 구동될 수 있는 프로그램의 형태로 구현될 수 있다. 여기서 프로그램은 프로그램 명령, 데이터 파일 및 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 프로그램은 기계어 코드나 고급 언어 코드를 이용하여 설계 및 제작된 것일 수 있다. 프로그램은 상술한 역난독화 방법, 분석 방법 및 복원 방법을 구현하기 위하여 특별히 설계된 것일 수도 있고, 컴퓨터 소프트웨어 분야에서 통상의 기술자에게 기 공지되어 사용 가능한 각종 함수나 정의를 이용하여 구현된 것일 수도 있다. 여기서, 컴퓨터 장치는 프로그램의 기능을 실현 가능하게 하는 프로세서나 메모리 등을 포함하여 구현된 것일 수 있으며, 필요에 따라 통신 장치를 더 포함할 수도 있다.The de-obfuscation method, the analysis method, and the restoration method according to the above-described embodiment may be implemented in the form of a program that can be driven by a computer device. Here, the program may include a program command, a data file, a data structure, etc. alone or in combination. The program may be designed and manufactured using machine code or high-level language code. The program may be specially designed to implement the above-described de-obfuscation method, analysis method, and restoration method, or may be implemented using various functions or definitions previously known and available to those skilled in the computer software field. Here, the computer device may be implemented including a processor or a memory that enables the function of a program to be realized, and may further include a communication device if necessary.

상술한 역난독화 방법, 분석 방법 및 복원 방법을 구현하기 위한 프로그램은 컴퓨터에 의해 판독 가능한 기록 매체에 기록될 수 있다. 컴퓨터에 의해 판독 가능한 기록 매체는 자기 테이프, 자기 디스크 저장 매체(하드 디스크 플로피 디스크 등), 광 기록 매체(콤팩트 디스크(CD), 디브이디(DVD) 또는 블루레이 디스크 등), 자기-광 기록 매체(플롭티컬 디스크 등) 및 반도체 저장 장치(롬, 램 또는 플래시 메모리 등) 등과 같이 컴퓨터 등의 호출에 따라 실행되는 특정 프로그램을 저장 가능한 다양한 종류의 하드웨어 장치를 포함할 수 있다.A program for implementing the above-described de-obfuscation method, analysis method, and restoration method may be recorded in a computer-readable recording medium. Computer-readable recording media include magnetic tape, magnetic disk storage medium (hard disk floppy disk, etc.), optical recording medium (compact disk (CD), DVD or Blu-ray disk, etc.), magnetic-optical recording medium ( It may include various types of hardware devices capable of storing a specific program executed according to a call such as a computer, such as a floppy disk, etc.) and a semiconductor storage device (ROM, RAM, flash memory, etc.).

이상, 역난독화 장치 및 역난독화 방법의 여러 실시예에 대해 설명하였으나, 장치 및 방법은 오직 상술한 실시예에 한정되는 것은 아니다. 해당 기술 분야에서 통상의 지식을 가진 자가 상술한 실시예를 기초로 수정 및 변형하여 구현 가능한 장치나 방법 역시 상술한 역난독화 장치 또는 역난독화 방법의 일례가 될 수 있다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성 요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나 다른 구성 요소 또는 균등물에 의하여 대치되거나 또는 치환되더라도 상술한 역난독화 장치 또는 역난독화 방법의 일 실시예가 될 수 있다.In the above, various embodiments of the de-obfuscation apparatus and de-obfuscation method have been described, but the apparatus and method are not limited to the above-described embodiments. An apparatus or method that can be implemented by modifying and modifying based on the above-described embodiment by a person of ordinary skill in the art may also be an example of the above-described de-obfuscation apparatus or de-obfuscation method. For example, the described techniques are performed in an order different from the described method, and/or components such as systems, structures, devices, circuits, etc. described are combined or combined in a form different from the described method, or other components or Even if it is replaced or substituted by an equivalent, it may be an embodiment of the above-described reverse obfuscation apparatus or reverse obfuscation method.

1: 원 프로그램 2: 난독화된 프로그램
10: 난독화 장치 11: 난독화부
70: 역난독화 장치 80: 프로세서
90: 메모리 장치 100: 역난독화부
110: 분석부 111: 난독화 판단부
113: 분석 방지 탐지부 115: API 래핑 처리부
117: IAT 탐지부 119: 직접 호출/점프 탐지부
121: 원시 EP 확인부 123: 원시 코드 추출부
160: 복원부 161: 패치부
163: 압축 처리부 165: EP 처리부
167: IDT 구축부 169: IAT 구축부
171: 간접 호출/점프 탐지부 173: 프로그램 생성부
1: original program 2: obfuscated program
10: obfuscation device 11: obfuscation unit
70: deobfuscation device 80: processor
90: memory device 100: deobfuscation unit
110: analysis unit 111: obfuscation determination unit
113: analysis prevention detection unit 115: API wrapping processing unit
117: IAT detection unit 119: direct call/jump detection unit
121: source EP verification unit 123: source code extraction unit
160: restoration unit 161: patch unit
163: compression processing unit 165: EP processing unit
167: IDT construction unit 169: IAT construction unit
171: indirect call/jump detection unit 173: program generation unit

Claims (14)

원 프로그램을 난독화(obfuscation)하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 분석부; 및
상기 분석부가 획득한 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 복원부를 포함하고,
상기 분석부는,
상기 난독화된 프로그램의 실행 시 멀티 스레드 기반 분석 방지 코드의 구동을 감지하여 분석 방지 옵션의 적용 여부를 판단하고,
읽기/쓰기/실행 권한을 갖는 함수를 모니터링하여 상기 난독화된 프로그램의 난독화에 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부를 판단하고, 응용 프로그래밍 인터페이스 래핑 옵션이 적용된 경우 원래의 응용 프로그래밍 인터페이스 주소를 획득하고,
최상단 섹션에 대한 메모리 쓰기를 감시하여 상기 난독화된 프로그램으로부터 임포트 주소 테이블(Import Address Table, IAT)을 탐지하고 상기 임포트 주소 테이블의 위치를 결정하고,
직접 호출/점프 명령문의 간접 주소를 확인하고,
원시 엔트리 포인트를 확인함으로써, 상기 원 프로그램에 대한 정보를 획득하는,
역난독화 장치.
An analysis unit that obtains information on the original program by analyzing the obfuscated program obtained by obfuscation of the original program; And
A restoration unit for obtaining a result program corresponding to the original program based on the information obtained by the analysis unit,
The analysis unit,
When the obfuscated program is executed, it is determined whether to apply the analysis prevention option by detecting the operation of the multi-thread-based analysis prevention code,
It monitors functions with read/write/execute rights to determine whether to apply the application programming interface wrapping option to obfuscation of the obfuscated program, and obtains the original application programming interface address when the application programming interface wrapping option is applied. ,
By monitoring memory writes to the top section, the import address table (IAT) is detected from the obfuscated program and the location of the import address table is determined,
Check the indirect address of the direct call/jump statement,
By checking the original entry point, obtaining information on the original program,
Reverse obfuscation device.
제1항에 있어서,
상기 복원부는 상기 임포트 주소 테이블의 위치를 이용하여 상기 임포트 주소 테이블을 획득하는,
역난독화 장치.
The method of claim 1,
The restoration unit acquires the import address table by using the location of the import address table,
Reverse obfuscation device.
제2항에 있어서,
상기 복원부는 상기 임포트 주소 테이블을 기반으로 임포트 디렉터리 테이블(Import Directory Table, IDT)을 구축하는,
역난독화 장치.
The method of claim 2,
The restoration unit builds an import directory table (IDT) based on the import address table,
Reverse obfuscation device.
제1항에 있어서,
상기 분석부는 적어도 하나의 프로그램을 수신하고, 상기 프로그램이 난독화된 프로그램인지 여부를 원 프로그램의 난독화에 이용된 난독화 툴의 내제적 특징을 기반으로 판단하고,
상기 내제적 특징은 언패킹 루틴, 상기 언패킹 루틴에 포함된 바이트 패턴, 섹션의 개수, 및 섹션의 명칭 중 적어도 하나를 포함하는,
역난독화 장치.
The method of claim 1,
The analysis unit receives at least one program and determines whether the program is an obfuscated program based on an intrinsic characteristic of the obfuscation tool used for obfuscation of the original program,
The intrinsic feature includes at least one of an unpacking routine, a byte pattern included in the unpacking routine, the number of sections, and a name of a section,
Reverse obfuscation device.
제1항에 있어서,
상기 분석부는 원시 코드 및 원시 데이터 중 적어도 하나를 추출하고,
상기 복원부는 상기 원시 코드 및 상기 원시 데이터 중 적어도 하나를 패치하는,
역난독화 장치.
The method of claim 1,
The analysis unit extracts at least one of the source code and the source data,
The restoration unit patches at least one of the original code and the original data,
Reverse obfuscation device.
삭제delete 제1항에 있어서,
상기 복원부는,
코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 여부를 판단하고, 판단 결과에 따라서 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 해제를 수행하거나,
상기 직접 호출/점프 명령문의 간접 주소를 기반으로 상기 직접 호출/점프 명령문을 수정하여 간접 호출/점프 명령문을 획득하거나, 또는
상기 원시 엔트리 포인트를 패치하는,
역난독화 장치.
The method of claim 1,
The restoration unit,
It is determined whether at least one of the code section and the data section is compressed, and decompression is performed on at least one of the code section and the data section according to the determination result, or
Acquire an indirect call/jump statement by modifying the direct call/jump statement based on the indirect address of the direct call/jump statement, or
Patching the original entry point,
Reverse obfuscation device.
적어도 프로세서(processor)를 포함하는 역난독화 장치에 의해 수행되는 역난독화 방법에 있어서,
원 프로그램을 난독화하여 획득된 난독화된 프로그램을 분석하여 상기 원 프로그램에 대한 정보를 획득하는 단계; 및
획득한 상기 정보를 기반으로 상기 원 프로그램에 대응하는 결과 프로그램을 획득하는 단계를 포함하고,
상기 원 프로그램에 대한 정보를 획득하는 단계는,
상기 난독화된 프로그램의 실행 시 멀티 스레드 기반 분석 방지 코드의 구동을 감지하여 분석 방지 옵션의 적용 여부를 판단하는 단계;
읽기/쓰기/실행 권한을 갖는 함수를 모니터링하여 상기 난독화된 프로그램의 난독화에 응용 프로그래밍 인터페이스 래핑 옵션의 적용 여부를 판단하고, 응용 프로그래밍 인터페이스 래핑 옵션이 적용된 경우 원래의 응용 프로그래밍 인터페이스 주소를 획득하는 단계;
최상단 섹션에 대한 메모리 쓰기를 감시하여 상기 난독화된 프로그램으로부터 임포트 주소 테이블(IAT)을 탐지하고 상기 임포트 주소 테이블의 위치를 결정하는 단계;
직접 호출/점프 명령문의 간접 주소를 확인하는 단계; 및
원시 엔트리 포인트를 확인함으로써, 상기 원 프로그램에 대한 정보를 획득하는 단계를 포함하는,
역난독화 방법.
In the de-obfuscation method performed by the de-obfuscation apparatus including at least a processor,
Analyzing the obfuscated program obtained by obfuscating the original program to obtain information on the original program; And
Including the step of obtaining a result program corresponding to the original program based on the obtained information,
Obtaining information on the original program,
Determining whether to apply an analysis prevention option by detecting driving of a multi-thread-based analysis prevention code when the obfuscated program is executed;
It monitors functions with read/write/execute privileges to determine whether to apply the application programming interface wrapping option to obfuscation of the obfuscated program, and obtains the original application programming interface address when the application programming interface wrapping option is applied. step;
Detecting an import address table (IAT) from the obfuscated program by monitoring memory writes to an uppermost section, and determining a location of the import address table;
Checking the indirect address of the direct call/jump statement; And
By confirming the original entry point, comprising the step of obtaining information on the original program,
De-obfuscation method.
제8항에 있어서,
상기 결과 프로그램을 획득하는 단계는 상기 임포트 주소 테이블의 위치를 이용하여 상기 임포트 주소 테이블을 획득하는 단계를 포함하는,
역난독화 방법.
The method of claim 8,
The step of obtaining the resulting program includes obtaining the import address table using a location of the import address table,
De-obfuscation method.
제9항에 있어서,
상기 결과 프로그램을 획득하는 단계는 상기 임포트 주소 테이블을 기반으로 임포트 디렉터리 테이블을 구축하는 단계를 더 포함하는,
역난독화 방법.
The method of claim 9,
The step of obtaining the result program further comprises building an import directory table based on the import address table,
De-obfuscation method.
제8항에 있어서,
상기 원 프로그램에 대한 정보를 획득하는 단계는,
적어도 하나의 프로그램을 수신하는 단계; 및
상기 적어도 하나의 프로그램이 난독화된 프로그램인지 여부를 원 프로그램의 난독화에 이용된 난독화 툴의 내제적 특징을 기반으로 판단하는 단계를 포함하고,
상기 내제적 특징은 언패킹 루틴, 상기 언패킹 루틴에 포함된 바이트 패턴, 섹션의 개수, 및 섹션의 명칭 중 적어도 하나를 포함하는,
역난독화 방법.
The method of claim 8,
Obtaining information on the original program,
Receiving at least one program; And
Determining whether the at least one program is an obfuscated program based on an intrinsic characteristic of the obfuscation tool used for obfuscation of the original program,
The intrinsic feature includes at least one of an unpacking routine, a byte pattern included in the unpacking routine, the number of sections, and a name of a section,
Deobfuscation method.
제8항에 있어서,
상기 원 프로그램에 대한 정보를 획득하는 단계는 원시 코드 및 원시 데이터 중 적어도 하나를 추출하는 단계를 포함하고,
상기 결과 프로그램을 획득하는 단계는 상기 원시 코드 및 상기 원시 데이터 중 적어도 하나를 패치하는 단계를 포함하는,
역난독화 방법.
The method of claim 8,
The step of obtaining the information on the original program includes extracting at least one of the original code and the original data,
The step of obtaining the resulting program comprises fetching at least one of the source code and the source data,
De-obfuscation method.
삭제delete 제8항에 있어서,
상기 결과 프로그램을 획득하는 단계는,
코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 여부를 판단하고, 판단 결과에 따라서 코드 섹션 및 데이터 섹션 중 적어도 하나에 대한 압축 해제를 수행하는 단계;
상기 직접 호출/점프 명령문의 간접 주소를 기반으로 상기 직접 호출/점프 명령문을 수정하여 간접 호출/점프 명령문을 획득하는 단계; 및
상기 원시 엔트리 포인트를 패치하는 단계 중 적어도 하나를 포함하는,
역난독화 방법.
The method of claim 8,
The step of obtaining the result program,
Determining whether to compress at least one of the code section and the data section, and decompressing at least one of the code section and the data section according to the determination result;
Obtaining an indirect call/jump statement by modifying the direct call/jump statement based on the indirect address of the direct call/jump statement; And
Comprising at least one of fetching the original entry point,
De-obfuscation method.
KR1020190055689A 2019-05-13 2019-05-13 Apparatus for deobfuscation and method for the same KR102203200B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190055689A KR102203200B1 (en) 2019-05-13 2019-05-13 Apparatus for deobfuscation and method for the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190055689A KR102203200B1 (en) 2019-05-13 2019-05-13 Apparatus for deobfuscation and method for the same

Publications (2)

Publication Number Publication Date
KR20200131383A KR20200131383A (en) 2020-11-24
KR102203200B1 true KR102203200B1 (en) 2021-01-14

Family

ID=73679645

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190055689A KR102203200B1 (en) 2019-05-13 2019-05-13 Apparatus for deobfuscation and method for the same

Country Status (1)

Country Link
KR (1) KR102203200B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102514888B1 (en) * 2022-03-18 2023-03-27 숭실대학교 산학협력단 Deobfuscation apparatus and method for data flow analysis of obfuscated applications

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101265680B1 (en) 2011-12-14 2013-05-22 한국저작권위원회 Method and apparatus for recoverable sw sourcecode obfuscation and key recovery
JP2018181350A (en) 2017-04-20 2018-11-15 Line株式会社 Method and system for evaluating security of application

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101102855B1 (en) * 2010-04-26 2012-01-10 엔에이치엔(주) System, method and computer readable recording medium for providing game authorization independent from game client
KR101503456B1 (en) * 2013-03-15 2015-03-24 에스케이텔레콤 주식회사 Terminal device and control method thereof
KR101861341B1 (en) 2017-05-30 2018-05-28 올댓소프트 코. Deobfuscation apparatus of application code and method of deobfuscating application code using the same
KR101920597B1 (en) 2017-11-16 2018-11-21 숭실대학교산학협력단 Dynamic code extraction based automatic anti-analysis evasion and code logic analysis Apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101265680B1 (en) 2011-12-14 2013-05-22 한국저작권위원회 Method and apparatus for recoverable sw sourcecode obfuscation and key recovery
JP2018181350A (en) 2017-04-20 2018-11-15 Line株式会社 Method and system for evaluating security of application

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
이재휘 외, "Themida의 API 난독화 복구 자동화에 관한 연구", 디지털포렌식연구 Vol. 11, No. 1, pp. 37-46(2017.)*
이재휘 외, "Themida의 API 난독화 분석과 복구방안 연구", 정보보호학회논문지 Vol. 27, No. 1, pp. 67-77(2017.)*

Also Published As

Publication number Publication date
KR20200131383A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
KR101518420B1 (en) Apparatus and method for managing apk file in a android platform
US20210294879A1 (en) Securing executable code integrity using auto-derivative key
US20030110387A1 (en) Initiating execution of a computer program from an encrypted version of a computer program
KR101503785B1 (en) Method And Apparatus For Protecting Dynamic Library
EP3779745A1 (en) Code pointer authentication for hardware flow control
MX2007011377A (en) Secure boot.
CN107563192B (en) Lesso software protection method and device, electronic equipment and storage medium
US20220035918A1 (en) System and Method for Validating In-Memory Integrity of Executable Files to Identify Malicious Activity
US10296728B2 (en) Method and system for providing cloud-based application security service
US9256756B2 (en) Method of encryption and decryption for shared library in open operating system
CN103077333B (en) A kind of software code protection method under Linux system
KR101990028B1 (en) Hybrid unpacking method and system for binary file recovery
US8656182B2 (en) Security mechanism for developmental operating systems
Suk et al. UnThemida: Commercial obfuscation technique analysis with a fully obfuscated program
KR102203200B1 (en) Apparatus for deobfuscation and method for the same
US11836252B2 (en) Machine learning through iterative memory analysis for malware detection
KR102459774B1 (en) Method of encrypting dll file, system of encrypting dll file performing the same, and storage medium storing the same
EP4109310B1 (en) Iterative memory analysis for malware detection
CN112035803B (en) Protection method and device based on Windows platform software
KR101749209B1 (en) Method and apparatus for hiding information of application, and method and apparatus for executing application
KR102173151B1 (en) Apparatus and method for automatic extraction of original source code
US20110167276A1 (en) Method and device for detecting if a computer file has been copied and method and device for enabling such detection
KR102557007B1 (en) Method for rebuilding binary file and apparatus thereof
KR101556908B1 (en) Apparatus For Protecting Binary Code
KR101977265B1 (en) Method and apparatus for detection original entry point of packed executable files

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant