KR102557007B1 - Method for rebuilding binary file and apparatus thereof - Google Patents

Method for rebuilding binary file and apparatus thereof Download PDF

Info

Publication number
KR102557007B1
KR102557007B1 KR1020210047671A KR20210047671A KR102557007B1 KR 102557007 B1 KR102557007 B1 KR 102557007B1 KR 1020210047671 A KR1020210047671 A KR 1020210047671A KR 20210047671 A KR20210047671 A KR 20210047671A KR 102557007 B1 KR102557007 B1 KR 102557007B1
Authority
KR
South Korea
Prior art keywords
binary file
binary
file
essential information
reconstructed
Prior art date
Application number
KR1020210047671A
Other languages
Korean (ko)
Other versions
KR20220141490A (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 KR1020210047671A priority Critical patent/KR102557007B1/en
Publication of KR20220141490A publication Critical patent/KR20220141490A/en
Application granted granted Critical
Publication of KR102557007B1 publication Critical patent/KR102557007B1/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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)

Abstract

본 발명은 바이너리 파일을 역공학으로부터 안전하게 보호하기 위한 바이너리 파일 재구성 장치에 관한 것으로서, 상기 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 바이너리 분석부; 상기 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성하는 바이너리 재구성부; 및 미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 보안기능 삽입부를 포함할 수 있다.The present invention relates to a binary file reconstruction apparatus for safely protecting a binary file from reverse engineering, comprising: a binary analyzer for analyzing the binary file and extracting essential information required for execution of the binary file from the binary file; a binary reconstruction unit for reconstructing a corresponding binary file based on essential information extracted from the binary file; and a security function insertion unit for inserting a code for performing a predetermined security function into the reconstructed binary file.

Description

바이너리 파일 재구성 방법 및 그 장치{Method for rebuilding binary file and apparatus thereof}Method for rebuilding binary file and apparatus thereof

본 발명은 바이너리 파일을 안전하게 보호할 수 있는 방법 및 그 장치에 관한 것으로서, 보다 구체적으로는 바이너리 파일의 실행에 필요한 필수 정보를 추출하여 해당 바이너리 파일을 재구성할 수 있는 방법 및 그 장치에 관한 것이다. The present invention relates to a method and device capable of safely protecting a binary file, and more particularly, to a method and device capable of reconstructing a binary file by extracting essential information necessary for executing a binary file.

소프트웨어 보안의 중요성은 갈수록 고도화되는 해킹 및 사이버 전쟁의 위협을 통해 지속적으로 대두되고 있다. 이른바 4차 산업혁명 시대를 맞이하면서 다양한 IT 기기가 우리 생활 곳곳에서 사용되고 있으며, 이러한 장비들의 보안 결함은 사람의 생활에 직접적인 영향을 줄 뿐만 아니라, 나아가서는 사람의 생명까지도 위협할 수 있다.The importance of software security continues to emerge through the ever-increasing threat of hacking and cyber warfare. In the era of the so-called 4th industrial revolution, various IT devices are being used everywhere in our lives, and security flaws in these devices not only directly affect people's lives, but can even threaten people's lives.

소프트웨어의 보안성에 대한 분석을 수행하기 위해서는, 해당 소프트웨어의 실행 파일(즉, 바이너리 파일)에 대한 디컴파일(decompile)을 수행할 필요가 있다. 디컴파일이란 이미 컴파일된 기계어나 어셈블러 부호로부터 컴파일 전의 본래 소스 코드를 추출하는 것으로, 최근 다양한 종류의 디컴파일 프로그램들이 제공되고 있다. 하지만 소스 코드만 분석해서는 소프트웨어의 보안성을 보장하는데 한계가 있다. 따라서, 소스 코드 분석과 함께, 소프트웨어 실행 파일에 대한 바이너리 분석을 수행할 필요가 있다.In order to analyze the security of software, it is necessary to decompile an executable file (ie, a binary file) of the corresponding software. Decompilation refers to extracting the original source code before compilation from already compiled machine language or assembler code, and various types of decompilation programs have recently been provided. However, there is a limit to guaranteeing the security of software by analyzing only the source code. Therefore, it is necessary to perform binary analysis on software executable files along with source code analysis.

바이너리 분석은 인간이 이해할 수 없는 기계어로 되어 있는 바이너리 코드로부터 인간이 알아볼 수 있는 소스 코드로 변환하는 과정을 의미하며, 이를 역공학(reverse engineeing)이라 지칭한다. 가령, 도 1에 도시된 바와 같이, 역공학은 컴파일(compile)과 반대되는 과정으로서, 정보 보안 및 바이너리 분석 기술에 필수적이고 중요한 과정이다. 이러한 역공학을 통해 바이너리 코드를 분석하는 기법에는 대표적으로 정적 분석 기법과 동적 분석 기법이 있다.Binary analysis refers to a process of converting binary code in machine language that humans cannot understand into source code that humans can understand, and this is called reverse engineering. For example, as shown in FIG. 1, reverse engineering is a process opposite to compilation, and is an essential and important process for information security and binary analysis technology. There are typically static analysis techniques and dynamic analysis techniques as techniques for analyzing binary codes through such reverse engineering.

바이너리 분석은 다양한 용도로 활용된다. 해커는 타겟 소프트웨어를 분석하여 악성 코드나 불법 복제 크랙을 만들고, 보안 전문가는 반대로 악성 코드를 분석하여 공격 패턴을 찾아내거나 소프트웨어에서 공격 가능성을 제거함으로써 보안성을 높이기도 한다. Binary analysis is used for a variety of purposes. Hackers analyze target software to create malicious codes or pirated cracks, and security experts analyze malicious codes to find attack patterns or increase security by removing the possibility of an attack from software.

한편, 블랙 해커는 바이너리 분석, 즉 역공학을 통해 소프트웨어의 바이너리 파일을 분석하여, 해당 바이너리 파일에 대한 소스 코드 정보를 부당한 방법으로 획득할 수 있다. 이러한 역공학으로부터 바이너리 파일을 안전하게 보호하기 위하여, 종래에는 스트립 유틸리티(strip utility)를 사용하여 바이너리 파일의 디버깅 정보를 제거할 뿐만 아니라, 추가적으로 바이너리 파일에 대한 암호화를 수행하는 기술을 사용하고 있다. On the other hand, a black hacker may analyze a software binary file through binary analysis, that is, reverse engineering, and acquire source code information for the corresponding binary file in an unfair way. In order to safely protect a binary file from such reverse engineering, conventionally, a technique of removing debugging information of a binary file using a strip utility and additionally encrypting the binary file is used.

하지만, 종래의 바이너리 파일 보호 방법은, 스트립 유틸리티의 사용을 금지하고 있는 특정 운영 시스템(가령, 안드로이드 시스템)에 적용할 수 없다는 문제가 있다. 또한, 해당 방법은 스트립 유틸리티에 의해 제거되는 정보가 제한적이여서 일부 중요한 정보가 바이너리 파일에 그대로 포함되는 경우가 발생할 수 있다는 문제가 있다. 또한, 해당 방법은 메모리에 로드된 바이너리 파일이 정상 실행을 위해 암호화가 해제된 상태로 존재하게 되며, 이때 메모리 덤프(memory dump)를 통해 암호화가 해제된 바이너리 파일을 획득할 수 있다는 문제가 있다. However, the conventional binary file protection method has a problem in that it cannot be applied to a specific operating system (eg, Android system) that prohibits the use of a strip utility. In addition, this method has a problem in that information removed by the strip utility is limited, so that some important information may be included in the binary file as it is. In addition, the method has a problem in that the binary file loaded into the memory exists in an unencrypted state for normal execution, and at this time, the unencrypted binary file can be obtained through a memory dump.

본 발명은 사용자 응용 프로그램과 같은 소프트웨어의 바이너리 파일을 역공학으로부터 안전하게 보호할 수 있는 바이너리 파일 재구성 방법 및 그 장치를 제공하고자 한다.An object of the present invention is to provide a binary file reconstruction method and apparatus capable of safely protecting a binary file of software such as a user application program from reverse engineering.

본 발명은 바이너리 파일의 실행에 필요한 필수 정보를 추출하고, 상기 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성할 수 있는 방법 및 그 장치를 제공하고자 한다.An object of the present invention is to provide a method and apparatus capable of extracting essential information necessary for the execution of a binary file and reconstructing the corresponding binary file based on the extracted essential information.

상기 또는 다른 목적을 달성하기 위해 본 발명의 일 측면에 따르면, 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 바이너리 분석부; 상기 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성하는 바이너리 재구성부; 및 미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 보안기능 삽입부를 포함하는 바이너리 파일을 역공학으로부터 보호하기 위한 바이너리 파일 재구성 장치를 제공한다. According to an aspect of the present invention in order to achieve the above or other object, a binary analysis unit for analyzing a binary file and extracting essential information required for execution of the binary file from the binary file; a binary reconstruction unit for reconstructing a corresponding binary file based on essential information extracted from the binary file; and a security function inserting unit for inserting a code for performing a predetermined security function into the reconstructed binary file to protect a binary file from reverse engineering.

본 발명의 다른 측면에 따르면, 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 단계; 상기 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성하는 단계; 및 미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 단계를 포함하는 바이너리 파일을 역공학으로부터 안전하게 보호하기 위한 바이너리 파일 재구성 방법을 제공한다. According to another aspect of the present invention, analyzing a binary file and extracting essential information required for execution of the binary file from the binary file; Reconstructing a corresponding binary file based on essential information extracted from the binary file; and inserting a code for performing a predetermined security function into the reconstructed binary file to safely protect a binary file from reverse engineering.

본 발명의 또 다른 측면에 따르면, 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 과정; 상기 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성하는 과정; 및 미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 과정이 컴퓨터 상에서 실행될 수 있도록 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램을 제공한다.According to another aspect of the present invention, the process of analyzing a binary file and extracting essential information required for execution of the binary file from the binary file; Reconstructing a corresponding binary file based on essential information extracted from the binary file; and a computer program stored in a computer-readable recording medium so that a process of inserting a code for performing a predetermined security function into the reconstructed binary file can be executed on a computer.

덧붙여 상기한 과제의 해결수단은, 본 발명의 특징을 모두 열거한 것이 아니다. 본 발명의 다양한 특징과 그에 따른 장점과 효과는 아래의 구체적인 실시형태를 참조하여 보다 상세하게 이해될 수 있을 것이다.In addition, the solution to the above problem does not enumerate all the features of the present invention. Various features of the present invention and the advantages and effects thereof will be understood in more detail with reference to specific embodiments below.

본 발명의 실시 예들에 따른 바이너리 파일 재구성 방법 및 그 장치의 효과에 대해 설명하면 다음과 같다.A method for reconstructing a binary file according to embodiments of the present invention and effects of the device are described as follows.

본 발명의 실시 예들 중 적어도 하나에 의하면, 바이너리 파일의 실행에 필요한 필수 정보만을 추출하고, 상기 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성함으로써, 역공학으로부터 해당 바이너리 파일을 안전하게 보호할 수 있다는 장점이 있다. According to at least one of the embodiments of the present invention, by extracting only essential information necessary for the execution of a binary file and reconstructing the binary file based on the extracted essential information, the binary file can be safely protected from reverse engineering There are advantages.

다만, 본 발명의 실시예들에 따른 바이너리 파일 재구성 방법 및 그 장치가 달성할 수 있는 효과는 이상에서 언급한 것들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.However, the effects that can be achieved by the binary file reconstruction method and apparatus according to the embodiments of the present invention are not limited to those mentioned above, and other effects not mentioned are the techniques to which the present invention belongs from the description below. It will be clearly understood by those skilled in the art.

도 1은 바이너리 분석에 사용되는 역공학을 설명하기 위해 참조되는 도면;
도 2는 본 발명의 일 실시예에 따른 바이너리 파일 재구성 장치의 구성 블록도;
도 3a는 리눅스용 서브시스템의 실행 파일인 ELF 파일의 구조를 나타내는 도면;
도 3b는 윈도우용 서브시스템의 실행 파일인 PE 파일의 구조를 나타내는 도면;
도 3c는 MAC용 서브시스템의 실행 파일인 MACH-O 파일의 구조를 나타내는 도면;
도 4는 본 발명의 일 실시예에 따른 바이너리 파일 재구성 방법을 설명하는 순서도.
1 is a diagram referenced to explain reverse engineering used in binary analysis;
Figure 2 is a configuration block diagram of a binary file reconstruction device according to an embodiment of the present invention;
3A is a diagram showing the structure of an ELF file that is an executable file of a subsystem for Linux;
3B is a diagram showing the structure of a PE file that is an executable file of a subsystem for Windows;
3C is a diagram showing the structure of a MACH-O file, which is an executable file of a subsystem for MAC;
4 is a flowchart illustrating a binary file reconstruction method according to an embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시 예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 즉, 본 발명에서 사용되는 '부'라는 용어는 소프트웨어, FPGA 또는 ASIC과 같은 하드웨어 구성요소를 의미하며, '부'는 어떤 역할들을 수행한다. 그렇지만 '부'는 소프트웨어 또는 하드웨어에 한정되는 의미는 아니다. '부'는 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다. 따라서, 일 예로서 '부'는 소프트웨어 구성요소들, 객체지향 소프트웨어 구성요소들, 클래스 구성요소들 및 태스크 구성요소들과 같은 구성요소들과, 프로세스들, 함수들, 속성들, 프로시저들, 서브루틴들, 프로그램 코드의 세그먼트들, 드라이버들, 펌웨어, 마이크로 코드, 회로, 데이터, 데이터베이스, 데이터 구조들, 테이블들, 어레이들 및 변수들을 포함한다. 구성요소들과 '부'들 안에서 제공되는 기능은 더 작은 수의 구성요소들 및 '부'들로 결합되거나 추가적인 구성요소들과 '부'들로 더 분리될 수 있다.Hereinafter, the embodiments disclosed in this specification will be described in detail with reference to the accompanying drawings, but the same or similar elements are given the same reference numerals regardless of reference numerals, and redundant description thereof will be omitted. The suffixes "module" and "unit" for components used in the following description are given or used together in consideration of ease of writing the specification, and do not have meanings or roles that are distinct from each other by themselves. That is, the term 'unit' used in the present invention means a hardware component such as software, FPGA or ASIC, and 'unit' performs certain roles. However, 'part' is not limited to software or hardware. A 'unit' may be configured to reside in an addressable storage medium and may be configured to reproduce one or more processors. Thus, as an example, 'unit' refers to components such as software components, object-oriented software components, class components and task components, processes, functions, properties, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuitry, data, databases, data structures, tables, arrays and variables. The functionality provided within the components and 'parts' may be combined into a smaller number of elements and 'parts' or further separated into additional elements and 'parts'.

또한, 본 명세서에 개시된 실시 예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시 예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시 예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.In addition, in describing the embodiments disclosed in this specification, if it is determined that a detailed description of a related known technology may obscure the gist of the embodiment disclosed in this specification, the detailed description thereof will be omitted. In addition, the accompanying drawings are only for easy understanding of the embodiments disclosed in this specification, the technical idea disclosed in this specification is not limited by the accompanying drawings, and all changes included in the spirit and technical scope of the present invention , it should be understood to include equivalents or substitutes.

또한, 본 명세서에서 설명하는 파일(file)은 의미 있는 정보를 담고 있으며, 이름을 가지고 있는 저장 장치상의 논리적인 단위를 의미한다. 컴퓨터 상에서의 파일은 바이너리 파일(binary file)과 텍스트 파일(text file)로 분류된다. 이 중 바이너리 파일은 데이터의 저장과 처리를 목적으로 0과 1의 이진 형식으로 인코딩된 파일을 의미하고, 텍스트 파일은 사람이 알아볼 수 있는 문자열로 이루어진 파일을 의미한다.In addition, a file described in this specification contains meaningful information and means a logical unit on a storage device that has a name. Files on a computer are classified into binary files and text files. Among them, a binary file refers to a file encoded in a binary format of 0 and 1 for the purpose of storing and processing data, and a text file refers to a file composed of human-readable strings.

본 발명은 사용자 응용 프로그램과 같은 소프트웨어의 바이너리 파일을 역공학으로부터 안전하게 보호할 수 있는 바이너리 파일 재구성 방법 및 그 장치를 제공한다. 또한, 본 발명은 바이너리 파일의 실행에 필요한 필수 정보를 추출하고, 상기 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성할 수 있는 방법 및 그 장치를 제공한다.The present invention provides a binary file reconstruction method and apparatus capable of safely protecting a binary file of software such as a user application program from reverse engineering. In addition, the present invention provides a method and apparatus capable of extracting essential information necessary for executing a binary file and reconstructing the binary file based on the extracted essential information.

이하에서는, 본 발명의 다양한 실시 예들에 대하여, 도면을 참조하여 상세히 설명한다.Hereinafter, various embodiments of the present invention will be described in detail with reference to the drawings.

도 2는 본 발명의 일 실시예에 따른 바이너리 파일 재구성 장치의 구성 블록도이다.2 is a configuration block diagram of a binary file reconstruction device according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시 예에 따른 바이너리 파일 재구성 장치(100)는 바이너리 분석부(110), 바이너리 재구성부(120) 및 보안기능 삽입부(130)를 포함할 수 있다. 도 2에 도시된 구성요소들은 바이너리 파일 재구성 장치를 구현하는데 있어서 필수적인 것은 아니어서, 본 명세서 상에서 설명되는 바이너리 파일 재구성 장치는 위에서 열거된 구성요소들 보다 많거나 또는 적은 구성요소들을 가질 수 있다.Referring to FIG. 2 , the binary file reconstruction apparatus 100 according to an embodiment of the present invention may include a binary analysis unit 110, a binary reconstruction unit 120, and a security function insertion unit 130. The components shown in FIG. 2 are not essential to implement the binary file reconstruction device, so the binary file reconstruction device described herein may have more or less components than the components listed above.

바이너리 분석부(110)는 사용자 응용 프로그램의 바이너리 파일(binary file)을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보만을 추출하는 기능을 수행할 수 있다.The binary analyzer 110 may perform a function of analyzing a binary file of a user application program and extracting only essential information required for execution of the corresponding binary file.

바이너리 파일은 사용자 또는 프로그램이 사용하던 정보나 숫자 값을 특별한 가공 없이 그대로 저장한 파일을 의미한다. 따라서, 바이너리 파일 내용을 확인하려면 별도의 프로그램 등이 필요하다.A binary file refers to a file in which information or numeric values used by a user or program are stored as they are without any special  processing. Therefore, a separate program is required to check the binary file contents.

바이너리 파일은 이미지 파일, 음악 파일 및 실행 파일 등을 포함할 수 있다. 이하, 본 실시 예에서 설명하는 바이너리 파일은 실행 파일을 의미하며, 상기 실행 파일로는 리눅스용 서브시스템의 실행 파일에 해당하는 ELF(Executable and Linkable Format) 파일, 윈도우용 서브시스템의 실행 파일에 해당하는 PE(Portable Executable) 파일 및 MAC용 서브시스템의 실행 파일에 해당하는 MACH-O 파일 등이 있다.Binary files may include image files, music files, and executable files. Hereinafter, a binary file described in this embodiment means an executable file, and the executable file corresponds to an Executable and Linkable Format (ELF) file corresponding to an executable file of a subsystem for Linux and an executable file of a subsystem for Windows. There are PE (Portable Executable) files and MACH-O files corresponding to the executable files of subsystems for MAC.

바이너리 파일은 다양한 정보(데이터) 항목들로 구성되어 있다. 그리고, 바이너리 파일을 구성하는 정보 항목들은 해당 파일을 실행하는 서브시스템(또는 운영시스템)의 종류에 따라 상이하다. 가령, 도 3a 내지 도 3c에 도시된 바와 같이, 리눅스용 서브시스템에서 사용되는 ELF 파일, 윈도우용 서브시스템에서 사용되는 PE 파일 및 MAC용 서브시스템에서 사용되는 MACH-O 파일은 서로 다른 정보 항목들로 구성되는 것을 확인할 수 있다. 또한, 바이너리 파일의 실행에 필요한 필수 정보 역시 해당 파일을 사용하는 서브시스템의 종류에 따라 상이하다. 따라서, 각 서브시스템 별로 별도의 바이너리 파일 재구성 장치(100)를 구축할 수 있다. 한편, 다른 실시 예로, 하나의 바이너리 파일 재구성 장치(100)를 구축하여 각 서브시스템에서 사용되는 바이너리 파일에 적용할 수도 있다.A binary file consists of various information (data) items. And, the information items constituting the binary file are different according to the type of subsystem (or operating system) that executes the file. For example, as shown in FIGS. 3A to 3C, the ELF file used in the subsystem for Linux, the PE file used in the subsystem for Windows, and the MACH-O file used in the subsystem for MAC are different information items It can be seen that it consists of In addition, essential information required to execute a binary file is also different depending on the type of subsystem using the corresponding file. Accordingly, a separate binary file reconstruction device 100 can be constructed for each subsystem. Meanwhile, as another embodiment, a single binary file reconstruction apparatus 100 may be constructed and applied to binary files used in each subsystem.

한편, 각 서브시스템의 종류에 관계없이, 공통적으로 바이너리 파일의 실행에 필요한 필수 정보는 크게 실행 코드 타입의 정보(이하, '실행 코드 타입 정보'라 칭함)와 데이터 타입의 정보(이하, '데이터 타입 정보'라 칭함)로 구분될 수 있다. On the other hand, irrespective of the type of each subsystem, the essential information commonly needed to execute a binary file is largely divided into execution code type information (hereinafter referred to as 'execution code type information') and data type information (hereinafter referred to as 'data type information'). referred to as 'type information').

바이너리 분석부(110)는 바이너리 파일의 종류를 식별하고, 상기 식별된 바이너리 파일을 분석하여 두 타입의 필수 정보, 즉 실행 코드 타입 정보와 데이터 타입 정보를 추출할 수 있다. 이때, 상기 바이너리 분석부(110)는 해당 바이너리 파일을 메모리에 로드하고 실행하는 서브시스템의 로더(loader)를 분석하여 해당 파일의 실행에 필요한 필수 정보만을 추출할 수 있다.The binary analyzer 110 may identify the type of binary file and extract two types of essential information, that is, execution code type information and data type information, by analyzing the identified binary file. At this time, the binary analyzer 110 may extract only essential information necessary for executing the corresponding file by analyzing a loader of a subsystem that loads and executes the corresponding binary file into memory.

바이너리 분석부(110)는, 이러한 필수 정보 추출 과정을 통해, 바이너리 파일의 실행에 필요하지 않는 정보, 즉 헤더 정보, 메타 정보, 디버깅 정보 및 심볼 정보 등을 효과적으로 제거할 수 있다.The binary analyzer 110 can effectively remove information that is not required for binary file execution, such as header information, meta information, debugging information, and symbol information, through this essential information extraction process.

예를들어, 디버깅 정보는 바이너리 파일에 대응하는 프로그램의 동작을 분석하기 위해 추가되는 정보로, 디버깅 정보에는 바이너리 파일 내에 포함되는 각각의 소스코드들의 소스코드 네임이나, 소스코드 내 포함되는 각각의 코드들의 라인넘버 등이 포함될 수 있다. 디버깅 정보는 해당 파일에 대한 포렌직(forensic) 등에도 활용될 수 있다.For example, debugging information is information added to analyze the operation of a program corresponding to a binary file, and the debugging information includes the source code name of each source code included in the binary file or each code included in the source code. The line number of , etc. may be included. Debugging information can also be used for forensic about the corresponding file.

디버깅 정보는, 각각의 바이너리 파일의 종류, 실행환경, 컴파일 환경 등에 따라, 다양한 방식으로 바이너리 파일 내에 포함될 수 있으므로, 바이너리 파일에서 디버깅 정보를 일괄적으로 추출하여 제거하기에는 어려움이 존재한다. 따라서, 바이너리 파일 재구성 장치(100)는 바이너리 파일에서 디버깅 정보를 제거하는 대신에, 바이너리 파일의 실행에 필요한 필수 정보만을 추출하여 바이너리 파일을 재구성하는 방식을 활용할 수 있다. 즉, 디버깅 정보들은 필수 정보에 해당하지 않으므로, 바이너리 파일의 재구성 과정에서 디버깅 정보를 자연스럽게 제거하는 것이 가능하다. 여기서, 디버깅 정보 이외에, 헤더 정보, 메타 정보 등도 동일한 방식으로 제거할 수 있다.Debugging information may be included in a binary file in various ways depending on the type of each binary file, an execution environment, a compilation environment, etc., so it is difficult to extract and remove debugging information from a binary file in batches. Accordingly, the apparatus 100 for reconstructing a binary file may utilize a method of reconstructing a binary file by extracting only essential information necessary for executing the binary file, instead of removing debugging information from the binary file. That is, since debugging information does not correspond to essential information, it is possible to naturally remove debugging information in the process of reconstructing a binary file. Here, in addition to debugging information, header information, meta information, and the like can be removed in the same way.

바이너리 재구성부(120)는 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성하는 기능을 수행할 수 있다. 이때, 바이너리 재구성부(120)는 필수 정보를 메모리에 로드할 수 있는 형태로 재구성할 수 있다. 이는 바이너리 파일로부터 추출된 필수 정보는 그 자체로 실행 가능한 형태가 아니기 때문에 메모리 상에서 실행 가능한 형태로 필수 정보를 재구성할 필요가 있기 때문이다. The binary reconstruction unit 120 may perform a function of reconstructing a corresponding binary file based on essential information extracted from the binary file. At this time, the binary reconstruction unit 120 may reconstruct essential information in a form that can be loaded into a memory. This is because the essential information extracted from the binary file is not in an executable form per se, so it is necessary to reconstruct the essential information in an executable form in memory.

좀 더 구체적으로, 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성을 하는 이유는 다음과 같다.More specifically, the reason for reconstructing the binary file based on the essential information extracted from the binary file is as follows.

첫째, 실행 코드는 바이너리 파일이 메모리에 어떻게 로드되는지 알 수 있어야 한다.First, the executable code must know how the binary file is loaded into memory.

둘째, 실행 코드와 데이터를 항상 같은 메모리에 로드 할 수 없기 때문에, 실행 코드는 변경된 정보를 알 수 있어야 한다.Second, since the execution code and data cannot always be loaded into the same memory, the execution code must know the changed information.

셋째, 실행 코드는 운영시스템(OS)의 함수들(system call 혹은 라이브러리)을 사용하게 되는데 그 함수들의 정보를 알 수 있어야 한다.Third, the execution code uses the functions (system call or library) of the operating system (OS), and the information of the functions must be known.

상술한 이유와 관련된 동작은 일반적으로 서브시스템의 로더에 의해 수행되지만, 해당 동작과 관련된 정보들이 바이너리 분석부(110)를 통해 모두 제거되기 때문에, 해당 동작은 바이너리 파일 재구성 장치(100)에 의해 직접 수행되어야 한다. 따라서, 상술한 동작과 관련된 로더 기능을 수행하는 코드가 새로운 바이너리 파일(즉, 재구성된 바이너리 파일)에 삽입될 필요가 있다.The operation related to the above reason is generally performed by the loader of the subsystem, but since all information related to the operation is removed through the binary analyzer 110, the corresponding operation is directly performed by the binary file reconstruction device 100 It should be done. Therefore, the code for performing the loader function related to the above-described operation needs to be inserted into a new binary file (ie, a reconstructed binary file).

실시예에 따라서는, 바이너리 재구성부(120)가 바이너리 파일 내 최초로 나타나는 실행 코드 타입 정보 내에, 바이너리 파일 재구성을 위한 코드들을 추가할 수 있다. 이 경우, 추가되는 코드는 각각의 서브시스템의 로더들과 동일한 결과를 출력하도록 설계될 수 있다. 또한, 바이너리 재구성부(120)는 재구성된 바이너리 파일 내 포함된 각각의 심볼정보들에 대한 보안성을 향상시키기 위하여, 실행 코드 타입 정보 내 포함되는 함수들의 이름을 해쉬(hash) 형태로 변경하여 사용할 수 있다.Depending on the embodiment, the binary reconstruction unit 120 may add codes for binary file reconstruction to executable code type information that appears first in the binary file. In this case, the added code can be designed to output the same result as the loaders of each subsystem. In addition, the binary reconstruction unit 120 changes the names of functions included in the execution code type information into a hash form to improve the security of each symbol information included in the reconstructed binary file. can

예를들어, 실행 코드 타입 정보 내에 "_puts"라는 함수가 포함될 수 있으며, "_puts"라는 함수는 외부 라이브러리 등을 참조하여 사용하는 것일 수 있다. 이때, 바이너리 재구성부(120)는 "puts_ptr"의 코드를 추가하여 "_puts"라는 함수의 주소가 메모리 상의 특정 위치에 저장되어야 함을 지정할 수 있다. 이 경우, 바이너리 파일의 실행에 필수적으로 필요한 "_puts"라는 함수를 별도의 로더없이 메모리로부터 읽어오는 것이 가능하므로, 필수 정보를 메모리에 로드할 수 있는 형태로 재구성한 것에 해당한다. 이와 같이, 바이너리재구성부(120)는 일반적으로 로더에 의해 수행되는 기능을 재구성된 바이너리 파일을 이용하여 구현하는 것이 가능하다. For example, a function called “_puts” may be included in the execution code type information, and the function called “_puts” may be used by referring to an external library or the like. At this time, the binary reconstruction unit 120 may specify that the address of the function "_puts" should be stored in a specific location on the memory by adding the code of "puts_ptr". In this case, since it is possible to read a function called "_puts" essential for binary file execution from memory without a separate loader, it corresponds to reconstructing essential information into a form that can be loaded into memory. In this way, the binary reconstruction unit 120 can implement functions generally performed by the loader using the reconstructed binary file.

또한, 역공학기법 등을 활용하면, 재구성된 바이너리 파일로부터 해당 프로그램이 "_puts"라는 함수를 사용하고 있음이 외부에 표시될 수 있다. 따라서, 바이너리재구성부(120)는 바이너리 파일 재구성시 "_puts" 등 함수이름을 해쉬 형태로 암호화하여 사용함으로써, 바이너라 파일내에서 사용하는 함수의 외부 노출을 방지할 수 있다.In addition, if a reverse engineering technique is used, it may be indicated to the outside that the corresponding program uses a function called "_puts" from the reconstructed binary file. Therefore, the binary reconstruction unit 120 can prevent functions used in binary files from being exposed to the outside by encrypting and using function names such as “_puts” in a hash form when reconstructing binary files.

보안기능 삽입부(130)는 미리 결정된 로더 기능을 수행하는 코드를 생성하여 새로운 바이너리 파일에 삽입할 수 있다. 헤더 정보를 포함하는 일반적인 바이너리 파일을 메모리에 로드하는 경우, 메모리 덤프를 통하여 해당 바이너리 파일을 추출하는 것이 가능하기 때문에, 바이너리 파일을 암호화하여도 무력화되는 경우가 쉽게 발생할 수 있다. 따라서, 보안기능 삽입부(130)는, 로더 기능을 수행하는 코드를 새로운 바이너리 파일에 삽입함으로써, 헤더 정보를 포함하지 않는 바이너리 파일을 메모리에 로드할 수 있고, 이를 통해 메모리 덤프를 방지할 수 있다.The security function insertion unit 130 may generate a code for performing a predetermined loader function and insert it into a new binary file. When a general binary file including header information is loaded into memory, it is possible to extract the corresponding binary file through a memory dump, so even if the binary file is encrypted, it can easily be incapacitated. Therefore, the security function insertion unit 130 inserts a code for performing a loader function into a new binary file to load a binary file that does not include header information into memory, thereby preventing a memory dump. .

보안기능 삽입부(130)는 미리 결정된 보안 기능을 수행하는 코드를 생성하여 새로운 바이너리 파일에 삽입하는 기능을 수행할 수 있다. 이때, 상기 보안 기능은 운영 시스템에 따라 달라질 수 있으나 기본적으로 다음과 같은 두 가지 기능을 포함할 수 있다. The security function insertion unit 130 may perform a function of generating a code for performing a predetermined security function and inserting it into a new binary file. At this time, the security function may vary depending on the operating system, but may basically include the following two functions.

첫 번째 보안 기능은 바이너리 파일의 변경 여부를 확인하는 기능이다. 해당 기능은 보안 기능의 코드와 실제 동작 코드의 위변조 검사로 바이너리 파일의 변경 여부를 확인할 수 있다. The first security feature is the ability to check whether a binary file has been modified. This function can check whether the binary file has been changed by forgery inspection of the code of the security function and the actual operating code.

두 번째 보안 기능은 바이너리 파일의 실행 환경을 확인하는 기능이다. 해당 기능은 안전한 환경에서 바이너리 파일이 동작되는지 확인하는 기능과, 디버거 혹은 기타 해킹 툴에 의해 프로그램이 제어되고 있는지 확인하는 기능을 포함할 수 있다. The second security feature is the ability to check the execution environment of binary files. The corresponding function may include a function of checking whether a binary file is operated in a safe environment and a function of checking whether a program is being controlled by a debugger or other hacking tool.

보안기능 삽입부(130)는 바이너리 파일로부터 추출된 필수 정보를 보호하기 위해, 해당 필수 정보를 암호화한 후 복호화하는 코드를 새로운 바이너리 파일에 추가로 삽입할 수 있다. 이때, 보안기능 삽입부(130)는 암호화/복호화를 수행하기 전에 해당 운영시스템의 보안 위험을 분석하여 복호화 여부를 결정할 수 있으며, 신뢰할 수 있는 실행 환경에서는 필수 정보(즉, 실행 코드 타입 정보와 데이터 타입 정보)가 노출될 수 있도록 하는 기능을 제공할 수 있다. 보안 위험 분석은 운영시스템(OS) 별로 상이하며, 안드로이드 시스템에서는 루팅, 에뮬레이터 등의 위험을 탐지하는 코드가 될 수 있다. 복호화 코드는 AES(Advanced Encryption Standard), SEED 등의 알고리즘이 될 수 있으며, 복호화 키는 검증하려는 대상(무결성 검증)의 해쉬(HASH) 값을 사용할 수 있다. In order to protect the essential information extracted from the binary file, the security function insertion unit 130 may additionally insert a code for encrypting and then decrypting the corresponding essential information into a new binary file. At this time, the security function insertion unit 130 may determine whether to decrypt by analyzing the security risk of the operating system before performing encryption/decryption, and in a reliable execution environment, essential information (ie, execution code type information and data type information) may be provided. Security risk analysis is different for each operating system (OS), and in the Android system, it can be a code that detects risks such as rooting and emulator. The decryption code may be an algorithm such as AES (Advanced Encryption Standard) or SEED, and the decryption key may use a hash (HASH) value of an object to be verified (integrity verification).

보안기능 삽입부(130)는 미리 결정된 로더 기능 및 보안 기능을 수행하는 코드들이 삽입된 최종 바이너리 파일을 메모리에 직접 로드하는 기능을 수행할 수 있다. 상기 메모리에 로드된 최종 바이너리 파일은 복호화되어 메모리 상에 노출되더라도 메모리 덤프를 사용하여 해당 바어너리 파일의 필수 정보를 추출하는 것이 불가능하다. The security function insertion unit 130 may perform a function of directly loading a final binary file in which codes for performing a predetermined loader function and security function are inserted into memory. Even if the final binary file loaded into the memory is decrypted and exposed on the memory, it is impossible to extract essential information of the corresponding binary file using a memory dump.

이상 상술한 바와 같이, 본 발명의 일 실시 예에 따른 바이너리 파일 재구성 장치는 바이너리 파일의 실행에 필요한 필수 정보만을 추출하여 해당 바이너리 파일을 재구성함으로써, 역공학으로부터 해당 바이너리 파일을 안전하게 보호할 수 있다. As described above, the apparatus for reconstructing a binary file according to an embodiment of the present invention can safely protect a corresponding binary file from reverse engineering by reconstructing the binary file by extracting only essential information necessary for executing the binary file.

도 4는 본 발명의 일 실시예에 따른 바이너리 파일 재구성 방법을 설명하는 순서도이다. 4 is a flowchart illustrating a binary file reconstruction method according to an embodiment of the present invention.

도 4를 참조하면, 본 발명의 일 실시예에 따른 바이너리 파일 재구성 장치(200)는 사용자 응용 프로그램의 바이너리 파일이 입력되는지를 확인할 수 있다(S410). Referring to FIG. 4 , the apparatus 200 for reconstructing a binary file according to an embodiment of the present invention may check whether a binary file of a user application program is input (S410).

상기 410 단계의 확인 결과, 바이너리 파일이 입력되는 경우, 바이너리 파일 재구성 장치(200)는 상기 입력된 바이너리 파일의 종류를 식별할 수 있다(S420). As a result of checking in step 410, if a binary file is input, the binary file reconstruction apparatus 200 can identify the type of the input binary file (S420).

예를 들어, 바이너리 파일 재구성 장치(200)는 해당 바이너리 파일이 어떤 서브시스템에서 사용되는 실행 파일인지를 식별할 수 있다. 즉, 바이너리 파일 재구성 장치(200)는 해당 바이너리 파일이 리눅스용 서브시스템에서 사용되는 ELF 파일인지, 윈도우용 서브시스템에서 사용되는 PE 파일인지, 아니면 MAC용 서브시스템에서 사용되는 MACH-O 파일인지를 식별할 수 있다.For example, the binary file reconstruction device 200 may identify an executable file used in which subsystem the corresponding binary file is. That is, the binary file reconstruction device 200 determines whether the binary file is an ELF file used in the subsystem for Linux, a PE file used in the subsystem for Windows, or a MACH-O file used in the subsystem for MAC. can be identified.

바이너리 파일 재구성 장치(200)는 상기 식별된 바이너리 파일에 포함된 정보(데이터) 항목들을 분석할 수 있다(S430). 이때, 상기 바이너리 파일 재구성 장치(200)는 해당 바이너리 파일을 메모리에 로드하고 실행하는 서브시스템의 로더(loader)를 분석할 수 있다. 이는 바이너리 파일의 실행에 필요한 필수 정보는 해당 파일을 사용하는 서브시스템의 종류에 따라 상이하기 때문이다. The binary file reconstruction device 200 may analyze information (data) items included in the identified binary file (S430). At this time, the binary file reconstruction apparatus 200 may analyze a loader of a subsystem that loads and executes a corresponding binary file into memory. This is because essential information required to execute a binary file differs depending on the type of subsystem using the corresponding file.

바이너리 파일 재구성 장치(200)는 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보만을 추출(검출)할 수 있다(S440). 이때, 상기 필수 정보는 바이너리 파일에 포함된 복수의 정보 항목들 중 실행 코드 타입 정보와 데이터 타입 정보를 포함할 수 있다. The binary file reconstruction device 200 may analyze the binary file and extract (detect) only essential information required for the execution of the binary file (S440). In this case, the essential information may include execution code type information and data type information among a plurality of information items included in the binary file.

바이너리 파일 재구성 장치(200)는 이러한 필수 정보 추출 과정을 통해 바이너리 파일의 실행에 필요하지 않는 정보, 즉 헤더 정보, 메타 정보, 디버깅 정보 및 심볼 정보 등을 효과적으로 제거할 수 있다. The binary file reconstruction device 200 can effectively remove information not necessary for binary file execution, such as header information, meta information, debugging information, and symbol information, through this essential information extraction process.

바이너리 파일 재구성 장치(200)는 바이너리 파일로부터 추출된 필수 정보를 기반으로 해당 바이너리 파일을 재구성할 수 있다(S450). 이는 바이너리 파일로부터 추출된 필수 정보가 그 자체로 실행 가능한 형태가 아니기 때문에, 메모리 상에서 실행 가능한 형태로 필수 정보를 재구성하기 위함이다. The binary file reconstruction device 200 may reconstruct the corresponding binary file based on essential information extracted from the binary file (S450). This is to reconstruct the essential information in an executable form on memory since the essential information extracted from the binary file is not in an executable form per se.

바이너리 파일 재구성 장치(200)는 미리 결정된 로더 기능을 수행하는 코드를 생성하여 재구성된 바이너리 파일에 삽입할 수 있다(S460). 이에 따라, 바이너리 파일 재구성 장치(200)는 헤더 정보를 포함하지 않는 바이너리 파일을 메모리에 직접 로드할 수 있고, 이를 통해 메모리 덤프를 방지할 수 있다.The apparatus 200 for reconstructing a binary file may generate a code for performing a predetermined loader function and insert it into the reconstructed binary file (S460). Accordingly, the binary file reconstruction apparatus 200 may directly load a binary file not including header information into memory, thereby preventing a memory dump.

바이너리 파일 재구성 장치(200)는 미리 결정된 보안 기능을 수행하는 코드를 생성하여 재구성된 바이너리 파일에 삽입할 수 있다(S470). 이때, 상기 보안 기능은 암호화/복호화 기능, 디컴파일 방지 기능, 무결성 검사 기능 등을 포함할 수 있다.Binary file reconstruction device 200 may generate a code for performing a predetermined security function and insert it into the reconstructed binary file (S470). In this case, the security function may include an encryption/decryption function, a decompilation prevention function, an integrity check function, and the like.

바이너리 파일 재구성 장치(200)는 미리 결정된 로더 기능 및 보안 기능을 수행하는 코드들이 삽입된 새로운 바이너리 파일을 출력(생성)할 수 있다(S480). The binary file reconstruction apparatus 200 may output (generate) a new binary file in which codes for performing predetermined loader functions and security functions are inserted (S480).

바이너리 파일 재구성 장치(200)는, 바이너리 파일의 실행 요청 시, 새로운 바이너리 파일을 메모리에 직접 로드하여 해당 바이너리 파일을 실행할 수 있다.The binary file reconstruction device 200 may directly load a new binary file into memory and execute the corresponding binary file upon request for execution of the binary file.

이상 상술한 바와 같이, 본 발명의 일 실시 예에 따른 바이너리 파일 재구성 방법은 바이너리 파일의 실행에 필요한 필수 정보를 추출하여 해당 바이너리 파일을 재구성함으로써, 역공학으로부터 해당 바이너리 파일을 안전하게 보호할 수 있다.As described above, the method for reconstructing a binary file according to an embodiment of the present invention can safely protect a corresponding binary file from reverse engineering by extracting essential information necessary for executing the binary file and reconstructing the binary file.

전술한 본 발명은, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다. 따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.The above-described present invention can be implemented as computer readable code on a medium on which a program is recorded. The computer-readable medium may continuously store programs executable by the computer or temporarily store them for execution or download. In addition, the medium may be various recording means or storage means in the form of a single or combined hardware, but is not limited to a medium directly connected to a certain computer system, and may be distributed on a network. Examples of the medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical recording media such as CD-ROM and DVD, magneto-optical media such as floptical disks, and ROM, RAM, flash memory, etc. configured to store program instructions. In addition, examples of other media include recording media or storage media managed by an app store that distributes applications, a site that supplies or distributes various other software, and a server. Accordingly, the above detailed description should not be construed as limiting in all respects and should be considered illustrative. The scope of the present invention should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of the present invention are included in the scope of the present invention.

본 발명은 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어, 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 본 발명에 따른 구성요소를 치환, 변형 및 변경할 수 있다는 것이 명백할 것이다.The present invention is not limited by the foregoing embodiments and accompanying drawings. It will be clear to those skilled in the art that the components according to the present invention can be substituted, modified, and changed without departing from the technical spirit of the present invention.

100: 바이너리 파일 재구성 장치 110: 바이너리 분석부
120: 바이너리 재구성부 130: 보안기능 삽입부
100: binary file reconstruction device 110: binary analysis unit
120: binary reconstruction unit 130: security function insertion unit

Claims (10)

바이너리 파일을 역공학으로부터 보호하기 위한 바이너리 파일 재구성 장치에 있어서,
상기 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 바이너리 분석부;
상기 바이너리 파일로부터 추출된 필수 정보를, 메모리 상에서 실행 가능한 형태로 재구성하여, 재구성된 바이너리 파일을 생성하는 바이너리 재구성부; 및
미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 보안기능 삽입부를 포함하는 것으로,
상기 바이너리 분석부는, 상기 바이너리 파일을 메모리에 로드하고 실행하는 서브시스템의 로더(loader)를 분석하여, 상기 바이너리 파일로부터 상기 필수 정보를 추출하는 것인, 바이너리 파일 재구성 장치.
In the binary file reconstruction device for protecting binary files from reverse engineering,
a binary analysis unit that analyzes the binary file and extracts essential information required for execution of the binary file from the binary file;
A binary reconstruction unit for reconstructing essential information extracted from the binary file into an executable form on memory and generating a reconstructed binary file; and
To include a security function insertion unit for inserting code for performing a predetermined security function into the reconstructed binary file,
Wherein the binary analysis unit extracts the essential information from the binary file by analyzing a loader of a subsystem that loads and executes the binary file into memory.
제1항에 있어서,
상기 바이너리 파일은, 서브시스템에서 사용 가능한 실행 파일으로서, ELF(Executable and Linkable Format) 파일, PE(Portable Executable) 파일 및 MACH-O 파일 중 적어도 하나를 포함하는 것을 특징으로 하는 바이너리 파일 재구성 장치.
According to claim 1,
The binary file is an executable file usable in the subsystem, and includes at least one of an Executable and Linkable Format (ELF) file, a Portable Executable (PE) file, and a MACH-O file.
제1항에 있어서,
상기 필수 정보는, 상기 바이너리 파일에 포함된 복수의 정보 항목들 중 실행 코드 타입의 정보와 데이터 타입의 정보를 포함하는 것을 특징으로 하는 바이너리 파일 재구성 장치.
According to claim 1,
The binary file reconstruction apparatus, characterized in that the essential information includes information of an execution code type and information of a data type among a plurality of information items included in the binary file.
삭제delete 삭제delete 제1항에 있어서,
상기 보안기능 삽입부는, 상기 필수 정보를 암호화 및 복호화하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 것을 특징으로 하는 바이너리 파일 재구성 장치.
According to claim 1,
The security function insertion unit inserts a code for encrypting and decrypting the essential information into the reconstructed binary file.
바이너리 파일을 역공학으로부터 보호하기 위한 바이너리 파일 재구성 장치에 있어서,
상기 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 바이너리 분석부;
상기 바이너리 파일로부터 추출된 필수 정보를, 메모리 상에서 실행 가능한 형태로 재구성하여, 재구성된 바이너리 파일을 생성하는 바이너리 재구성부; 및
미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 보안기능 삽입부를 포함하는 것으로,
상기 보안기능 삽입부는, 미리 결정된 로더 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 것을 특징으로 하는 바이너리 파일 재구성 장치.
In the binary file reconstruction device for protecting binary files from reverse engineering,
a binary analysis unit that analyzes the binary file and extracts essential information required for execution of the binary file from the binary file;
A binary reconstruction unit for reconstructing essential information extracted from the binary file into an executable form on memory and generating a reconstructed binary file; and
To include a security function insertion unit for inserting code for performing a predetermined security function into the reconstructed binary file,
The binary file reconstruction device, characterized in that the security function insertion unit inserts a code for performing a predetermined loader function into the reconstructed binary file.
제7항에 있어서,
상기 보안기능 삽입부는, 상기 바이너리 파일의 실행 요청 시, 상기 재구성된 바이너리 파일을 메모리에 직접 로드하는 것을 특징으로 하는 바이너리 파일 재구성 장치.
According to claim 7,
The binary file reconstruction device, characterized in that the security function inserting unit directly loads the reconstructed binary file into a memory when the execution of the binary file is requested.
바이너리 파일을 역공학으로부터 보호하기 위한, 바이너리 파일 재구성 장치의 바이너리 파일 재구성 방법에 있어서,
상기 바이너리 파일을 분석하여 해당 바이너리 파일의 실행에 필요한 필수 정보를 상기 바이너리 파일로부터 추출하는 단계;
상기 바이너리 파일로부터 추출된 필수 정보를, 메모리 상에서 실행 가능한 형태로 재구성하여, 재구성된 바이너리 파일을 생성하는 단계; 및
미리 결정된 보안 기능을 수행하는 코드를 상기 재구성된 바이너리 파일에 삽입하는 단계를 포함하는 것으로,
상기 추출하는 단계는, 상기 바이너리 파일을 메모리에 로드하고 실행하는 서브시스템의 로더(loader)를 분석하여, 상기 바이너리 파일로부터 상기 필수 정보를 추출하는 것인, 바이너리 파일 재구성 방법.
In the binary file reconstruction method of the binary file reconstruction device for protecting the binary file from reverse engineering,
analyzing the binary file and extracting essential information required for execution of the binary file from the binary file;
Reconstructing essential information extracted from the binary file into an executable form on memory to generate a reconstructed binary file; and
Including inserting code for performing a predetermined security function into the reconstructed binary file,
In the extracting, the essential information is extracted from the binary file by analyzing a loader of a subsystem that loads the binary file into a memory and executes the binary file.
청구항 제9항에 따른 방법이 컴퓨터 상에서 실행될 수 있도록 컴퓨터 판독 가능한 기록매체에 저장된 컴퓨터 프로그램.

A computer program stored in a computer readable recording medium so that the method according to claim 9 can be executed on a computer.

KR1020210047671A 2021-04-13 2021-04-13 Method for rebuilding binary file and apparatus thereof KR102557007B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210047671A KR102557007B1 (en) 2021-04-13 2021-04-13 Method for rebuilding binary file and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210047671A KR102557007B1 (en) 2021-04-13 2021-04-13 Method for rebuilding binary file and apparatus thereof

Publications (2)

Publication Number Publication Date
KR20220141490A KR20220141490A (en) 2022-10-20
KR102557007B1 true KR102557007B1 (en) 2023-07-19

Family

ID=83804722

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210047671A KR102557007B1 (en) 2021-04-13 2021-04-13 Method for rebuilding binary file and apparatus thereof

Country Status (1)

Country Link
KR (1) KR102557007B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009230545A (en) * 2008-03-24 2009-10-08 Nippon Telegr & Teleph Corp <Ntt> Processing device, its program and computer system
KR101521765B1 (en) * 2015-01-08 2015-05-20 숭실대학교산학협력단 Apparatus For Code Obfuscation Using Indistinguishable Identifier Conversion and Method Thereof
KR101907846B1 (en) * 2018-07-24 2018-10-12 주식회사 스틸리언 Apparatus, method for encryption using dependency integrity check of androids and other similar systems
KR102105020B1 (en) * 2019-08-30 2020-04-27 (유)아홉 Dynamic self mutation system using virtual machine based code transformation technology

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170069337A (en) * 2015-12-10 2017-06-21 주식회사 엔젠소프트 Method and apparatus for protecting application and program made by the method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009230545A (en) * 2008-03-24 2009-10-08 Nippon Telegr & Teleph Corp <Ntt> Processing device, its program and computer system
KR101521765B1 (en) * 2015-01-08 2015-05-20 숭실대학교산학협력단 Apparatus For Code Obfuscation Using Indistinguishable Identifier Conversion and Method Thereof
KR101907846B1 (en) * 2018-07-24 2018-10-12 주식회사 스틸리언 Apparatus, method for encryption using dependency integrity check of androids and other similar systems
KR102105020B1 (en) * 2019-08-30 2020-04-27 (유)아홉 Dynamic self mutation system using virtual machine based code transformation technology

Also Published As

Publication number Publication date
KR20220141490A (en) 2022-10-20

Similar Documents

Publication Publication Date Title
JP6227772B2 (en) Method and apparatus for protecting a dynamic library
Gao et al. Survey on malware anti-analysis
CN105512521A (en) Reinforcement and protection method and system for software installation package
JP2004511031A (en) Digital data protection configuration
US8533826B2 (en) Method for protecting the source code of a computer program
Suk et al. UnThemida: Commercial obfuscation technique analysis with a fully obfuscated program
Kerns et al. Double-extortion ransomware: A technical analysis of maze ransomware
Holder et al. Evaluating optimal phase ordering in obfuscation executives
de Assumpção et al. Forensic method for decrypting TPM-protected BitLocker volumes using Intel DCI
US8738931B1 (en) Method for determining and protecting proprietary source code using mnemonic identifiers
KR101749209B1 (en) Method and apparatus for hiding information of application, and method and apparatus for executing application
KR102557007B1 (en) Method for rebuilding binary file and apparatus thereof
WO2016188134A1 (en) Application reinforcing implementation method and apparatus
KR102203200B1 (en) Apparatus for deobfuscation and method for the same
Zhao et al. Automatic extraction of secrets from malware
Vidyarthi et al. Identifying ransomware-specific properties using static analysis of executables
Brand Forensic analysis avoidance techniques of malware
Groß Forensic Data Extraction from Modern File Systems
Mc Brearty et al. Extracting Cryptographic Keys from. NET Applications
Li et al. A token strengthened encryption packer to prevent reverse engineering PE files
Salman et al. Static Analysis Method on Portable Executable Files for REMNUX based Malware Identification
Park et al. Multi-partitioned bytecode wrapping scheme for minimizing code exposure on android
KR101300256B1 (en) Method for securing software executable files by prohibiting dynamic and static analysis, and computer-readable recording medium for storing program for securing software executable files for the same
KR102258408B1 (en) How to obfuscate return commands and how to execute obfuscated return commands
JP6752347B1 (en) Information processing equipment, computer programs and information processing methods

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right