KR102066022B1 - Apparatus and method for generating function signature on executable code - Google Patents

Apparatus and method for generating function signature on executable code Download PDF

Info

Publication number
KR102066022B1
KR102066022B1 KR1020180090947A KR20180090947A KR102066022B1 KR 102066022 B1 KR102066022 B1 KR 102066022B1 KR 1020180090947 A KR1020180090947 A KR 1020180090947A KR 20180090947 A KR20180090947 A KR 20180090947A KR 102066022 B1 KR102066022 B1 KR 102066022B1
Authority
KR
South Korea
Prior art keywords
function
signature
block
blocks
flow
Prior art date
Application number
KR1020180090947A
Other languages
Korean (ko)
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 KR1020180090947A priority Critical patent/KR102066022B1/en
Application granted granted Critical
Publication of KR102066022B1 publication Critical patent/KR102066022B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/53Decompilation; Disassembly

Abstract

The present invention relates to an apparatus and a method for generating a function signature on an executable code. The apparatus for generating a function signature on an executable code comprises: a function determination part disassembling an executable code to determine at least one function; a function flow generation part generating a function flow composed of a plurality of blocks and flows by analyzing a specific function; a block signature determination part determining a block signature by analyzing each of the plurality of blocks; and a function signature determination part determining a function signature for the specific function through a logical bit operation based on the block signature according to the flows. Accordingly, the present invention can obtain constant function characteristic information regardless of the order of blocks constituting the function.

Description

실행 코드 상의 함수 시그니처 생성 장치 및 방법{APPARATUS AND METHOD FOR GENERATING FUNCTION SIGNATURE ON EXECUTABLE CODE}Apparatus and method for generating function signature on executable code {APPARATUS AND METHOD FOR GENERATING FUNCTION SIGNATURE ON EXECUTABLE CODE}

본 발명은 실행 코드 상의 함수 시그니처 생성 기술에 관한 것으로, 보다 상세하게는 함수를 구성하는 블록의 순서에 상관없이 일정한 함수 특징 정보를 얻을 수 있는 실행 코드 상의 함수 시그니처 생성 장치 및 방법에 관한 것이다.The present invention relates to a technique for generating function signatures on executable code, and more particularly, to an apparatus and method for generating function signatures on executable code capable of obtaining constant function characteristic information regardless of the order of blocks constituting the function.

역어셈블러 또는 디스어셈블러(disassembler)는 기계어를 어셈블리어로 변환하는 컴퓨터 프로그램에 해당할 수 있다. 역어셈블러는 어셈블리어가 아닌 고급 프로그래밍 언어를 대상으로 하는 역컴파일러와 구분될 수 있고, 역어셈블러의 출력물인 디스어셈블리(disassembly)는 사람이 읽기 쉬운 형식으로 변환될 수 있어 리버스 엔지니어링에 사용될 수 있다.The disassembler or disassembler may correspond to a computer program for converting machine language into assembly language. The disassembler can be distinguished from the decompiler for high-level programming languages, not assembly language, and the disassembly output, which can be converted to human-readable form, can be used for reverse engineering.

어셈블리어 소스 코드는 보통 상수와 프로그래머의 주석을 허용하지만, 기계어로 변환되는 과정에서 어셈블러에 의해 제거될 수 있다. 따라서, 역어셈블리는 원본 소스 코드보다는 사람이 해석하기 어려운 단점을 가질 수 있다. IDA Pro는 사용자에게 값이나 코드의 영역을 위한 연상 기호를 사용할 수 있게 함으로써 사용자의 이해를 역어셈블 과정에 적용할 수 있도록 하는 장점을 가지고 있다.Assembly language source code usually allows constants and comments from programmers, but can be removed by the assembler during translation into machine language. Thus, disassembly may have a disadvantage that is more difficult for humans to interpret than the original source code. IDA Pro has the advantage of allowing users to use associative symbols for values or areas of code to apply their understanding to the disassembly process.

한국등록특허 제10-0960117(2010.05.19)호Korea Patent Registration No. 10-0960117 (2010.05.19)

본 발명의 일 실시예는 함수를 구성하는 블록의 순서에 상관없이 일정한 함수 특징 정보를 얻을 수 있는 실행 코드 상의 함수 시그니처 생성 장치 및 방법을 제공하고자 한다.An embodiment of the present invention is to provide an apparatus and method for generating a function signature on executable code that can obtain constant function feature information regardless of the order of blocks constituting the function.

본 발명의 일 실시예는 복수의 블록들로부터 문자열을 추출하고 해시 함수를 적용하여 고정 길이의 비트열을 블록 시그니처로서 생성할 수 있는 실행 코드 상의 함수 시그니처 생성 장치 및 방법을 제공하고자 한다.An embodiment of the present invention is to provide a function signature generation apparatus and method in executable code that can generate a string of fixed length as a block signature by extracting a string from a plurality of blocks and applying a hash function.

본 발명의 일 실시예는 배타적 논리곱 연산을 통해 블록 시그니처를 동일한 길이의 비트열로 통합한 후 하나의 정수로 변환함으로써 함수 시그니처를 생성할 수 있는 실행 코드 상의 함수 시그니처 생성 장치 및 방법을 제공하고자 한다.One embodiment of the present invention is to provide an apparatus and method for generating a function signature in executable code that can generate a function signature by integrating a block signature into a bit string of the same length through an exclusive AND operation and converting the same into a single integer. do.

실시예들 중에서, 실행 코드 상의 함수 시그니처 생성 장치는 실행 코드를 분해하여 적어도 하나의 함수를 결정하는 함수 결정부, 특정 함수를 분석하여 복수의 블록들과 플로우로 구성된 함수 플로우를 생성하는 함수 플로우 생성부, 상기 복수의 블록들 각각을 분석하여 블록 시그니처(signature)를 결정하는 블록 시그니처 결정부 및 상기 플로우에 따라 상기 블록 시그니처를 기초로 논리적 비트 연산을 통해 상기 특정 함수에 대한 함수 시그니처를 결정하는 함수 시그니처 결정부를 포함한다.Among the embodiments, the function signature generation device on the execution code is a function determination unit for decomposing the execution code to determine at least one function, the function flow generation for generating a function flow consisting of a plurality of blocks and flows by analyzing a specific function A block signature determiner that determines a block signature by analyzing each of the plurality of blocks, and a function that determines a function signature for the specific function through a logical bit operation based on the block signature according to the flow. It includes a signature determination unit.

상기 함수 결정부는 특정 소프트웨어의 기계어 코드를 기초로 변환된 어셈블리어 코드를 상기 실행 코드로서 분해할 수 있다.The function determiner may decompose the assembly language code converted based on the machine code of the specific software as the execution code.

상기 함수 플로우 생성부는 상기 복수의 블록들 각각에 대응되는 노드와 상기 플로우에 대응되는 단방향 간선으로 구성된 방향 그래프를 상기 함수 플로우로서 생성할 수 있다.The function flow generator may generate a direction graph including a node corresponding to each of the plurality of blocks and a unidirectional trunk corresponding to the flow as the function flow.

상기 블록 시그니처 결정부는 상기 복수의 블록들로부터 특징 정보를 추출하고 상기 특징 정보를 이용하여 상기 블록 시그니처를 생성할 수 있다.The block signature determiner may extract feature information from the plurality of blocks and generate the block signature using the feature information.

상기 블록 시그니처 결정부는 상기 특징 정보로서 문자열을 추출하고 상기 문자열에 해시 함수를 적용하여 고정 길이의 비트열을 상기 블록 시그니처로서 생성할 수 있다.The block signature determiner may extract a string as the feature information and apply a hash function to the string to generate a fixed length bit string as the block signature.

상기 함수 시그니처 결정부는 배타적 논리곱 연산을 통해 상기 블록 시그니처를 상기 블록 시그니처와 동일한 길이의 비트열로 통합한 후 하나의 정수로 변환함으로써 상기 함수 시그니처를 결정할 수 있다.The function signature determiner may determine the function signature by integrating the block signature into a bit string having the same length as that of the block signature through an exclusive AND operation and converting the block signature into an integer.

상기 함수 시그니처 결정부는 상기 복수의 블록들 각각에 대한 블록 시그니처 중 2개 이상의 블록 시그니처들을 선별하여 상기 논리적 비트 연산을 수행할 수 있다.The function signature determiner may select two or more block signatures from among the block signatures for each of the plurality of blocks to perform the logical bit operation.

상기 함수 시그니처 결정부는 상기 복수의 블록들 각각에 대한 블록 시그니처 중 상기 플로우에 따라 처음과 끝에 위치한 블록 시그니처들 사이에 존재하는 블록 시그니처만을 선별하여 상기 논리적 비트 연산을 수행할 수 있다.The function signature determiner may perform the logical bit operation by selecting only the block signatures existing between the block signatures located at the beginning and the end of the block signatures for each of the plurality of blocks according to the flow.

실시예들 중에서, 실행 코드 상의 함수 시그니처 생성 방법은 실행 코드를 분해하여 적어도 하나의 함수를 결정하는 단계, 특정 함수를 분석하여 복수의 블록들과 플로우로 구성된 함수 플로우를 생성하는 단계, 상기 복수의 블록들 각각을 분석하여 블록 시그니처(signature)를 결정하는 단계 및 상기 플로우에 따라 상기 블록 시그니처를 기초로 논리적 비트 연산을 통해 상기 특정 함수에 대한 함수 시그니처를 결정하는 단계를 포함한다.Among the embodiments, the method for generating a function signature on the executable code may include decomposing the executable code to determine at least one function, analyzing a specific function to generate a function flow composed of a plurality of blocks and flows, Analyzing each of the blocks to determine a block signature and determining a function signature for the particular function through logical bit operations based on the block signature according to the flow.

개시된 기술은 다음의 효과를 가질 수 있다. 다만, 특정 실시예가 다음의 효과를 전부 포함하여야 한다거나 다음의 효과만을 포함하여야 한다는 의미는 아니므로, 개시된 기술의 권리범위는 이에 의하여 제한되는 것으로 이해되어서는 아니 될 것이다.The disclosed technique can have the following effects. However, since a specific embodiment does not mean to include all of the following effects or only the following effects, it should not be understood that the scope of the disclosed technology is limited by this.

본 발명의 일 실시예에 따른 실행 코드 상의 함수 시그니처 생성 장치 및 방법은 복수의 블록들로부터 문자열을 추출하고 해시 함수를 적용하여 고정 길이의 비트열을 블록 시그니처로서 생성할 수 있다.The apparatus and method for generating a function signature on execution code according to an embodiment of the present invention may extract a string from a plurality of blocks and apply a hash function to generate a fixed length bit string as a block signature.

본 발명의 일 실시예에 따른 실행 코드 상의 함수 시그니처 생성 장치 및 방법은 배타적 논리곱 연산을 통해 블록 시그니처를 동일한 길이의 비트열로 통합한 후 하나의 정수로 변환함으로써 함수 시그니처를 생성할 수 있다.An apparatus and method for generating a function signature on executable code according to an embodiment of the present invention may generate a function signature by integrating a block signature into a bit string having the same length and converting it into an integer through an exclusive AND operation.

도 1은 본 발명의 일 실시예에 따른 실행 코드 상의 함수 시그니처 생성 시스템을 설명하는 도면이다.
도 2는 도 1에 있는 함수 시그니처 생성 장치를 설명하는 블록도이다.
도 3은 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 함수 시그니처 생성 과정을 설명하는 순서도이다.
도 4는 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 블록 시그니처 생성 과정을 설명하는 예시도이다.
도 5는 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 함수 시그니처 생성 과정을 설명하는 예시도이다.
1 is a diagram illustrating a function signature generation system on executable code according to an embodiment of the present invention.
FIG. 2 is a block diagram illustrating an apparatus for generating a function signature in FIG. 1.
3 is a flowchart illustrating a function signature generation process performed by the function signature generation device of FIG. 1.
4 is an exemplary diagram illustrating a block signature generation process performed by the apparatus for generating a function signature of FIG. 1.
FIG. 5 is an exemplary diagram illustrating a function signature generation process performed by the function signature generation device of FIG. 1.

본 발명에 관한 설명은 구조적 내지 기능적 설명을 위한 실시예에 불과하므로, 본 발명의 권리범위는 본문에 설명된 실시예에 의하여 제한되는 것으로 해석되어서는 아니 된다. 즉, 실시예는 다양한 변경이 가능하고 여러 가지 형태를 가질 수 있으므로 본 발명의 권리범위는 기술적 사상을 실현할 수 있는 균등물들을 포함하는 것으로 이해되어야 한다. 또한, 본 발명에서 제시된 목적 또는 효과는 특정 실시예가 이를 전부 포함하여야 한다거나 그러한 효과만을 포함하여야 한다는 의미는 아니므로, 본 발명의 권리범위는 이에 의하여 제한되는 것으로 이해되어서는 아니 될 것이다.Description of the present invention is only an embodiment for structural or functional description, the scope of the present invention should not be construed as limited by the embodiments described in the text. That is, since the embodiments may be variously modified and may have various forms, the scope of the present invention should be understood to include equivalents capable of realizing the technical idea. In addition, the objects or effects presented in the present invention does not mean that a specific embodiment should include all or only such effects, the scope of the present invention should not be understood as being limited thereby.

한편, 본 출원에서 서술되는 용어의 의미는 다음과 같이 이해되어야 할 것이다.On the other hand, the meaning of the terms described in the present application should be understood as follows.

"제1", "제2" 등의 용어는 하나의 구성요소를 다른 구성요소로부터 구별하기 위한 것으로, 이들 용어들에 의해 권리범위가 한정되어서는 아니 된다. 예를 들어, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.Terms such as "first" and "second" are intended to distinguish one component from another component, and the scope of rights should not be limited by these terms. For example, the first component may be named a second component, and similarly, the second component may also be named a first component.

어떤 구성요소가 다른 구성요소에 "연결되어"있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결될 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어"있다고 언급된 때에는 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. 한편, 구성요소들 간의 관계를 설명하는 다른 표현들, 즉 "~사이에"와 "바로 ~사이에" 또는 "~에 이웃하는"과 "~에 직접 이웃하는" 등도 마찬가지로 해석되어야 한다.When a component is referred to as being "connected" to another component, it should be understood that there may be other components in between, although it may be directly connected to the other component. On the other hand, when a component is referred to as being "directly connected" to another component, it should be understood that there is no other component in between. On the other hand, other expressions describing the relationship between the components, such as "between" and "immediately between" or "neighboring to" and "directly neighboring to", should be interpreted as well.

단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한 복수의 표현을 포함하는 것으로 이해되어야 하고, "포함하다"또는 "가지다" 등의 용어는 실시된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함을 지정하려는 것이며, 하나 또는 그 이상의 다른 특징이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.Singular expressions should be understood to include plural expressions unless the context clearly indicates otherwise, and terms such as "comprise" or "have" refer to a feature, number, step, operation, component, part, or feature thereof. It is to be understood that the combination is intended to be present and does not exclude in advance the possibility of the presence or addition of one or more other features or numbers, steps, operations, components, parts or combinations thereof.

각 단계들에 있어 식별부호(예를 들어, a, b, c 등)는 설명의 편의를 위하여 사용되는 것으로 식별부호는 각 단계들의 순서를 설명하는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 일어날 수 있다. 즉, 각 단계들은 명기된 순서와 동일하게 일어날 수도 있고 실질적으로 동시에 수행될 수도 있으며 반대의 순서대로 수행될 수도 있다.In each step, an identification code (e.g., a, b, c, etc.) is used for convenience of explanation, and the identification code does not describe the order of each step, and each step clearly indicates a specific order in context. Unless stated otherwise, they may occur out of the order noted. That is, each step may occur in the same order as specified, may be performed substantially simultaneously, or may be performed in the reverse order.

본 발명은 컴퓨터가 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현될 수 있고, 컴퓨터가 읽을 수 있는 기록 매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록 장치를 포함한다. 컴퓨터가 읽을 수 있는 기록 매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있다. 또한, 컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.The present invention can be embodied as computer readable code on a computer readable recording medium, and the computer readable recording medium includes all kinds of recording devices in which data can be read by a computer system. . Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like. The computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.

여기서 사용되는 모든 용어들은 다르게 정의되지 않는 한, 본 발명이 속하는 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한 이상적이거나 과도하게 형식적인 의미를 지니는 것으로 해석될 수 없다.All terms used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. Generally, the terms defined in the dictionary used are to be interpreted as being consistent with the meaning in the context of the related art, and should not be interpreted as having an ideal or excessively formal meaning unless explicitly defined in the present application.

도 1은 본 발명의 일 실시예에 따른 실행 코드 상의 함수 시그니처 생성 시스템을 설명하는 도면이다.1 is a diagram illustrating a function signature generation system on executable code according to an embodiment of the present invention.

도 1을 참조하면, 실행 코드 상의 함수 시그니처 생성 시스템(100)은 사용자 단말(110), 함수 시그니처 생성 장치(130) 및 데이터베이스(150)을 포함할 수 있다.Referring to FIG. 1, the function signature generation system 100 on executable code may include a user terminal 110, a function signature generation device 130, and a database 150.

사용자 단말(110)은 함수 특징 정보를 제공받아 확인할 수 있는 컴퓨팅 장치에 해당할 수 있다. 사용자 단말(110)은 스마트폰, 노트북 또는 컴퓨터로 구현될 수 있으며, 반드시 이에 한정되지 않고, 태블릿 PC 등 다양한 디바이스로도 구현될 수 있다. 사용자 단말(110)은 함수 시그니처 생성 장치(130)와 네트워크를 통해 연결될 수 있고, 복수의 사용자 단말(110)들은 함수 시그니처 생성 장치(130)와 동시에 연결될 수 있다. 일 실시예에서, 사용자 단말(110)은 함수 특징 정보 분석이 필요한 소프트웨어 또는 해당 소프트웨어의 실행 코드를 함수 시그니처 생성 장치(130)에 제공할 수 있다.The user terminal 110 may correspond to a computing device that can receive and confirm function feature information. The user terminal 110 may be implemented as a smartphone, a notebook, or a computer, and is not limited thereto, and may also be implemented as various devices such as a tablet PC. The user terminal 110 may be connected to the function signature generator 130 through a network, and the plurality of user terminals 110 may be simultaneously connected to the function signature generator 130. In an embodiment, the user terminal 110 may provide the function signature generation device 130 with software that requires the analysis of the function characteristic information or execution code of the corresponding software.

함수 시그니처 생성 장치(130)는 소프트웨어 또는 해당 소프트웨어의 실행 코드를 분석하여 복수의 함수들 각각에 대한 특징 정보를 정수로 변환할 수 있는 컴퓨터 또는 프로그램에 해당하는 서버로 구현될 수 있다. 함수 시그니처 생성 장치(130)는 사용자 단말(110)과 유선 네트워크 또는 블루투스, WiFi 등과 같은 무선 네트워크로 연결될 수 있고, 유선 또는 무선 네트워크를 통해 사용자 단말(110)과 통신을 수행할 수 있다. 일 실시예에서, 함수 시그니처 생성 장치(130)는 데이터베이스(150)와 연동하여 함수 시그니처 생성에 필요한 다양한 정보들을 저장할 수 있다. 한편, 함수 시그니처 생성 장치(130)는 도 1과 달리, 데이터베이스(150)를 내부에 포함하여 구현될 수 있다.The function signature generation device 130 may be implemented as a server corresponding to a computer or a program capable of analyzing software or executable code of the corresponding software and converting feature information about each of the plurality of functions into integers. The function signature generator 130 may be connected to the user terminal 110 through a wired network or a wireless network such as Bluetooth, WiFi, or the like, and may communicate with the user terminal 110 through a wired or wireless network. In an embodiment, the function signature generation device 130 may store various information necessary for generating the function signature in cooperation with the database 150. Meanwhile, unlike in FIG. 1, the function signature generation device 130 may be implemented by including a database 150 therein.

일 실시예에서, 함수 시그니처 생성 장치(130)는 사용자 단말(110)로부터 소프트웨어 또는 해당 소프트웨어의 실행 코드를 수신하여 이를 분석한 결과를 사용자 단말(110)에 제공할 수 있고, 데이터베이스(150)에 저장된 데이터를 기초로 함수 시그니처를 생성하여 데이터베이스(150)에 저장할 수 있다. 다른 실시예에서, 함수 시그니처 생성 장치(130)는 외부 프로그램을 이용하여 실행 코드의 분해와 함수 플로우 생성을 대체할 수 있다. 예를 들어, 함수 시그니처 생성 장치(130)는 IDA Pro와 같은 디스어셈블러를 이용하여 소프트웨어 또는 실행 코드를 분석할 수 있고, 함수에 대한 함수 플로우 정보를 제공받아 이후 절차를 내부적으로 수행할 수 있다.In one embodiment, the function signature generation device 130 may receive the software or the execution code of the software from the user terminal 110 and provide the analysis result to the user terminal 110, the database 150 to The function signature may be generated based on the stored data and stored in the database 150. In another embodiment, the function signature generation device 130 may replace the decomposition of the execution code and the function flow generation using an external program. For example, the function signature generation device 130 may analyze software or executable code using a disassembler such as IDA Pro, and may receive a function flow information on a function to perform a later procedure internally.

데이터베이스(150)는 함수 시그니처 생성 장치(130)가 실행 코드를 분해하여 각 함수에 대한 함수 시그니처를 생성하는데 필요한 다양한 정보들을 저장할 수 있다. 예를 들어, 데이터베이스(150)는 사용자 단말(110)로부터 수신한 소프트웨어 또는 실행 코드를 저장할 수 있고, 실행 코드를 분석하여 획득한 함수 플로우 및 시그니처 정보들을 저장할 수 있으며, 반드시 이에 한정되지 않고, 함수 시그니처를 생성하는 과정에서 다양한 형태로 수집 또는 가공된 정보들을 저장할 수 있다.The database 150 may store various pieces of information necessary for the function signature generating device 130 to decompose executable code to generate a function signature for each function. For example, the database 150 may store software or executable code received from the user terminal 110, and store function flow and signature information obtained by analyzing the executable code, but are not necessarily limited thereto. In the process of generating a signature, information collected or processed in various forms may be stored.

도 2는 도 1에 있는 함수 시그니처 생성 장치를 설명하는 블록도이다.FIG. 2 is a block diagram illustrating an apparatus for generating a function signature in FIG. 1.

도 2를 참조하면, 함수 시그니처 생성 장치(130)는 함수 결정부(210), 함수 플로우 생성부(230), 블록 시그니처 결정부(250), 함수 시그니처 결정부(270) 및 제어부(290)를 포함할 수 있다.Referring to FIG. 2, the function signature generator 130 may include a function determiner 210, a function flow generator 230, a block signature determiner 250, a function signature determiner 270, and a controller 290. It may include.

함수 결정부(210)는 실행 코드를 분해하여 적어도 하나의 함수를 결정할 수 있다. 함수 결정부(210)는 실행 코드를 라인 단위로 스캔하여 함수 선언, 함수 개시 및 함수 종료 중 적어도 하나와 연관시킬 수 있고, 각 라인 별로 연관된 정보를 기초로 실행 코드를 분해할 수 있다. 예를 들어, 함수 결정부(210)는 함수 선언과 관련된 라인 이후에 함수 개시와 연관된 라인이 연속으로 나타나는 경우 해당 라인부터 함수 종료와 연관된 라인까지의 구간을 하나의 함수 구간으로 결정할 수 있다.The function determiner 210 may determine at least one function by decomposing execution code. The function determiner 210 may scan the execution code in line units and associate it with at least one of a function declaration, a function start, and a function end, and decompose the execution code based on information associated with each line. For example, the function determiner 210 may determine a section from the corresponding line to the line associated with the end of the function as one function section when the line associated with the function start appears continuously after the line associated with the function declaration.

일 실시예에서, 함수 결정부(210)는 특정 소프트웨어의 기계어 코드를 기초로 변환된 어셈블리어 코드를 실행 코드로서 분해할 수 있다. 함수 결정부(210)는 기계어 코드를 어셈블리어 코드로 변환하는 디스어셈블 연산을 수행할 수 있다. 다른 실시예에서, 함수 결정부(210)는 디스어셈블러를 이용하여 어셈블리어 코드로의 변환을 수행할 수 있다. 함수 결정부(210)는 어셈블리어 코드를 분석하여 각 함수에 대응되는 코드 구간을 결정하여 적어도 하나의 함수를 결정할 수 있다.In one embodiment, the function determiner 210 may decompose the converted assembly language code as executable code based on the machine language code of the specific software. The function determiner 210 may perform a disassembly operation of converting machine code into assembly code. In another embodiment, the function determiner 210 may perform conversion to assembly language code using a disassembler. The function determiner 210 may determine at least one function by analyzing an assembly code and determining a code section corresponding to each function.

함수 플로우 생성부(230)는 특정 함수를 분석하여 복수의 블록들과 플로우로 구성된 함수 플로우를 생성할 수 있다. 여기에서, 블록은 함수를 구성하는 단일 연산 단위에 해당하는 부분 코드에 해당할 수 있고, 예를 들어, 엔트리 외에는 들어오는 분기가 없고 출구 외에는 나가는 분기가 없는 직선 코드열에 해당할 수 있다. 플로우는 함수가 동작하는 순서에 해당할 수 있고, 각 블록 간의 동작 순서와 연결 관계를 시각적으로 표현할 수 있다. 예를 들어, 플로우는 방향을 가진 에지(edge)에 해당할 수 있다. 함수 플로우는 함수를 시각적으로 표현한 것으로 블록과 플로우로 구성될 수 있다.The function flow generator 230 may generate a function flow composed of a plurality of blocks and flows by analyzing a specific function. Here, the block may correspond to a partial code corresponding to a single operation unit constituting a function, and for example, may correspond to a straight code string having no incoming branch except an entry and no outgoing branch except an exit. The flow may correspond to the order in which the functions operate, and may visually express the order of operation and the connection relationship between each block. For example, the flow may correspond to an edge with direction. A function flow is a visual representation of a function and can be composed of blocks and flows.

함수 플로우 생성부(230)는 함수 결정부(210)에 의해 결정된 적어도 하나의 함수에 대해 각 함수별로 독립적인 분석을 차례대로 수행하여 함수별 함수 플로우를 생성할 수 있다. 함수 플로우 생성부(230)는 각 함수별 분석을 병렬적으로 수행하여 함수별 함수 플로우를 생성할 수 있다.The function flow generator 230 may generate a function flow for each function by sequentially performing independent analysis for each function on at least one function determined by the function determiner 210. The function flow generator 230 may generate a function flow for each function by performing the analysis for each function in parallel.

일 실시예에서, 함수 플로우 생성부(230)는 복수의 블록들 각각에 대응되는 노드와 플로우에 대응되는 단방향 간선으로 구성된 방향 그래프를 함수 플로우로서 생성할 수 있다. 함수 플로우 생성부(230)는 함수 플로우를 방향 그래프 형태로 표현하여 생성할 수 있고, 이 경우 복수의 블록들 각각은 하나의 그래프 노드에 대응될 수 있고, 플로우는 방향을 가진 그래프 간선에 대응될 수 있다. 또한, 함수를 구성하는 기본 단위 연산을 기초로 블록이 생성된 경우 함수 플로우 생성부(230)는 플로우를 단반향 간선으로만 표현할 수 있다. 함수 플로우 생성부(230)는 함수에 대응되는 코드를 차례대로 스캔하여 각 블록 간의 연결 순서 및 연결 방향을 결정할 수 있고, 단방향 간선으로 블록 사이를 연결하여 하나의 방향 그래프를 생성할 수 있다.In one embodiment, the function flow generation unit 230 may generate a direction graph composed of a node corresponding to each of the plurality of blocks and a unidirectional trunk corresponding to the flow as a function flow. The function flow generator 230 may generate the function flow in the form of a direction graph. In this case, each of the plurality of blocks may correspond to one graph node, and the flow may correspond to a graph edge having a direction. Can be. In addition, when a block is generated based on a basic unit operation constituting a function, the function flow generator 230 may express the flow as a unidirectional trunk only. The function flow generator 230 may sequentially scan the code corresponding to the function to determine the connection order and the connection direction between each block, and generate one direction graph by connecting the blocks with one-way trunks.

블록 시그니처 결정부(250)는 복수의 블록들 각각을 분석하여 블록 시그니처를 결정할 수 있다. 블록 시그니처는 블록들 각각을 식별하거나 또는 블록들 각각에 대한 특징 정보를 표현하기 위하여 특징 정보와 연관된 값에 해당할 수 있고, 일정한 길이를 가지는 비트열 또는 문자열 등으로 표현될 수 있다. 블록 시그니처 결정부(250)는 각 블록에 대응하는 실행 코드를 기초로 블록 시그니처를 결정할 수 있다.The block signature determiner 250 may determine a block signature by analyzing each of the plurality of blocks. The block signature may correspond to a value associated with the feature information to identify each of the blocks or to express feature information for each of the blocks, and may be represented by a bit string or a string having a predetermined length. The block signature determiner 250 may determine a block signature based on executable code corresponding to each block.

일 실시예에서, 블록 시그니처 결정부(250)는 복수의 블록들로부터 특징 정보를 추출하고 특징 정보를 이용하여 블록 시그니처를 생성할 수 있다. 특징 정보는 블록 식별이나 블록 간의 비교를 위하여 사용하는 정보에 해당할 수 있고, 예를 들어, 블록에 대응되는 실행 코드에 포함된 대표 문자열에 해당할 수 있다. 블록 시그니처 결정부(250)는 블록을 구성하는 실행 코드, 블록의 크기, 블록의 길이 등 블록과 관련된 정보를 기초로 특징 정보를 추출할 수 있으며, 예를 들어, 블록을 구성하는 실행 코드에 포함된 명령어들의 집합을 특징 정보로서 추출할 수 있다.In an embodiment, the block signature determiner 250 may extract feature information from the plurality of blocks and generate a block signature using the feature information. The feature information may correspond to information used for block identification or comparison between blocks. For example, the feature information may correspond to a representative string included in executable code corresponding to the block. The block signature determiner 250 may extract feature information based on information related to the block, such as the execution code constituting the block, the size of the block, the length of the block, and the like, and may be included in the execution code constituting the block. The set of commands can be extracted as feature information.

일 실시예에서, 블록 시그니처 결정부(250)는 특징 정보로서 문자열을 추출하고 문자열에 해시 함수를 적용하여 고정 길이의 비트열을 블록 시그니처로서 생성할 수 있다. 보다 구체적으로, 블록 시그니처 결정부(250)는 블록에 대응되는 실행 코드로부터 명령어만을 추출한 후 정렬시켜 문자열을 생성할 수 있고, 해당 문자열에 대해 해시 함수를 적용할 수 있다. 예를 들어, 블록 시그니처 결정부(250)는 문자열에 MD5 함수를 적용하여 128 비트의 비트열을 블록 시그니처로서 생성할 수 있다. MD5 함수는 128비트 암호화 해시 함수에 해당할 수 있고, 주로 프로그램이나 파일이 원본 그대로인지를 확인하는 무결성 검사 등에 사용될 수 있다.In an embodiment, the block signature determiner 250 may generate a fixed length bit string as a block signature by extracting a string as feature information and applying a hash function to the string. More specifically, the block signature determiner 250 may generate a string by extracting and sorting only an instruction from executable code corresponding to the block, and apply a hash function to the string. For example, the block signature determiner 250 may generate a 128-bit bit string as a block signature by applying an MD5 function to a string. The MD5 function can correspond to a 128-bit cryptographic hash function, and can be used mainly for integrity checking to verify that a program or file is intact.

함수 시그니처 결정부(270)는 플로우에 따라 블록 시그니처를 기초로 논리적 비트 연산을 통해 특정 함수에 대한 함수 시그니처를 결정할 수 있다. 함수 시그니처 결정부(270)는 함수 플로우의 시작 블록부터 플로우를 따라 종료 블록까지 각 블록에 대한 블록 시그니처를 이용하여 비트 연산을 수행하여 함수 시그니처를 결정할 수 있다. 특정 함수는 복수의 블록들로 구성될 수 있기 때문에 각 블록들로부터 획득한 블록 시그니처에 대한 비트 연산을 통해 산출된 정보는 해당 함수에 대한 특징을 반영할 수 있다. 함수 시그니처 결정부(270)는 블록 시그니처에 포함된 블록 특징 정보를 이용하여 해당 블록들로 구성된 함수의 특징 정보를 획득할 수 있다.The function signature determiner 270 may determine a function signature for a specific function through a logical bit operation based on the block signature according to the flow. The function signature determiner 270 may determine a function signature by performing a bit operation using a block signature for each block from the start block of the function flow to the end block along the flow. Since a particular function may be composed of a plurality of blocks, information calculated through bit operations on block signatures obtained from each block may reflect characteristics of the corresponding function. The function signature determiner 270 may obtain feature information of a function composed of corresponding blocks by using block feature information included in the block signature.

일 실시예에서, 함수 시그니처 결정부(270)는 배타적 논리곱 연산을 통해 블록 시그니처를 블록 시그니처와 동일한 길이의 비트열로 통합한 후 하나의 정수로 변환함으로써 함수 시그니처를 결정할 수 있다. 함수 시그니처 결정부(270)는 배타적 논리곱 연산(XOR 연산)을 통해 블록 시그니처 간의 연산을 수행할 수 있고, 배타적 논리곱 연산은 연산에 사용되는 블록 시그니처의 순서 조합에 상관없이 동일한 값을 제공하기 때문에, 함수 시그니처 결정부(270)는 동일한 블록 시그니처에 대해 동일한 함수 시그니처를 생성할 수 있다.In one embodiment, the function signature determiner 270 may determine the function signature by integrating the block signature into a bit string having the same length as the block signature and converting the result into one integer through an exclusive AND operation. The function signature determiner 270 may perform operations between block signatures through an exclusive AND operation (XOR operation), and the exclusive AND operation provides the same value regardless of the order combination of block signatures used in the operation. Therefore, the function signature determiner 270 may generate the same function signature for the same block signature.

일 실시예에서, 함수 시그니처 결정부(270)는 복수의 블록들 각각에 대한 블록 시그니처 중 2개 이상의 블록 시그니처들을 선별하여 논리적 비트 연산을 수행할 수 있다. 함수 시그니처 결정부(270)는 함수를 구성하는 복수의 블록들에 대한 블록 시그니처 모두에 대해 논리적 비트 연산을 수행하지 않고, 블록 시그니처 중에서 중요한 블록 시그니처만을 선별하여 논리적 비트 연산을 수행할 수 있다.In one embodiment, the function signature determiner 270 may perform a logical bit operation by selecting two or more block signatures among the block signatures for each of the plurality of blocks. The function signature determiner 270 may perform a logical bit operation by selecting only an important block signature among block signatures without performing logical bit operations on all block signatures of a plurality of blocks constituting the function.

일 실시예에서, 함수 시그니처 결정부(270)는 복수의 블록들 각각에 대한 블록 시그니처 중 플로우에 따라 처음과 끝에 위치한 블록 시그니처들 사이에 존재하는 블록 시그니처만을 선별하여 논리적 비트 연산을 수행할 수 있다. 함수 시그니처 결정부(270)는 함수 플로우에서 처음과 끝에 위치한 블록의 경우 함수 내에서 상대적으로 중요한 연산을 수행할 확률이 낮기 때문에 이를 제외하고 나머지 블록들만을 기초로 함수의 특징 정보를 추출함으로써 함수의 특징이 잘 반영된 함수 시그니처를 추출할 수 있다.In one embodiment, the function signature determiner 270 may perform a logical bit operation by selecting only block signatures existing between the block signatures located at the beginning and the end of the block signatures for each of the plurality of blocks according to the flow. . Since the function signature determiner 270 has a low probability of performing a relatively important operation in the function in the case of the blocks located at the beginning and the end of the function flow, the function signature extractor 270 extracts the characteristic information of the function based on only the remaining blocks. We can extract the function signature that reflects the feature well.

일 실시예에서, 함수 시그니처 결정부(270)는 복수의 블록들 각각에 대한 블록 시그니처 중 플로우에 따라 처음과 끝에 위치한 블록 시그니처들 사이에 존재하는 블록 시그니처만을 선별하여 배타적 논리곱 연산을 수행한 비트열 및 처음과 끝에 위치한 블록 시그니처들 간의 논리적 비트 연산을 통해 생성된 비트열 간의 배타적 논리곱 연산을 수행할 수 있다. In one embodiment, the function signature determiner 270 selects only the block signatures existing between the block signatures located at the beginning and the end of the block signatures for each of the plurality of blocks, and performs the exclusive AND operation. An exclusive AND operation between the strings and the bit strings generated through the logical bit operations between the block signatures located at the beginning and the end may be performed.

예를 들어, 함수 시그니처 결정부(270)는 총 5개의 블록 시그니처 중에서 처음과 끝 블록 시그니처를 제외한 나머지 3개의 블록 시그니처들 간의 배타적 논리곱 연산을 통해 제1 비트열을 생성할 수 있고, 처음과 끝 블록 시그니처 간의 논리적 비트 연산을 통해 제2 비트열을 생성할 수 있으며, 제1 비트열 및 제2 비트열들 간의 배타적 논리곱 연산을 통해 최종적으로 하나의 비트열로 통합할 수 있다. 처음과 끝 블록 시그니처 간의 논리적 비트 연산은 AND, OR, XOR 등의 연산을 포함할 수 있다.For example, the function signature determiner 270 may generate the first bit string through an exclusive AND operation between the remaining three block signatures except for the first and the last block signatures out of a total of five block signatures. The second bit string may be generated through logical bit operations between the end block signatures, and may be finally integrated into one bit string through an exclusive AND operation between the first bit string and the second bit strings. Logical bit operations between the first and last block signatures may include operations such as AND, OR, XOR, and the like.

제어부(290)는 함수 시그니처 생성 장치(130)의 전체적인 동작을 제어하고ㅗ, 함수 결정부(210), 함수 플로우 생성부(230), 블록 시그니처 결정부(250), 함수 시그니처 결정부(270) 간의 제어 흐름 또는 데이터 흐름을 관리할 수 있다.The control unit 290 controls the overall operation of the function signature generator 130, and the function determination unit 210, the function flow generation unit 230, block signature determination unit 250, function signature determination unit 270 You can manage the control flow or data flow between them.

도 3은 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 함수 시그니처 생성 과정을 설명하는 순서도이다.3 is a flowchart illustrating a function signature generation process performed by the function signature generation device of FIG. 1.

도 3을 참조하면, 함수 시그니처 생성 장치(130)는 함수 결정부(210)를 통해 실행 코드를 분해하여 적어도 하나의 함수를 결정할 수 있다(단계 S310). 함수 시그니처 생성 장치(130)는 함수 플로우 생성부(230)를 통해 특정 함수를 분석하여 복수의 블록들과 플로우로 구성된 함수 플로우를 생성할 수 있다(단계 S330).Referring to FIG. 3, the function signature generation device 130 may determine at least one function by decomposing execution code through the function determination unit 210 (step S310). The function signature generating apparatus 130 may generate a function flow composed of a plurality of blocks and flows by analyzing a specific function through the function flow generating unit 230 (step S330).

함수 시그니처 생성 장치(130)는 블록 시그니처 결정부(250)를 통해 복수의 블록들 각각을 분석하여 블록 시그니처를 결정할 수 있다(단계 S350). 함수 시그니처 생성 장치(130)는 함수 시그니처 결정부(270)를 통해 플로우에 따라 블록 시그니처를 기초로 논리적 비트 연산을 통해 특정 함수에 대한 함수 시그니처를 결정할 수 있다(단계 S370).The function signature generator 130 may determine the block signature by analyzing each of the plurality of blocks through the block signature determiner 250 (step S350). The function signature generator 130 may determine a function signature for a specific function through logical bit operation based on the block signature according to the flow through the function signature determiner 270 (step S370).

도 4는 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 블록 시그니처 생성 과정을 설명하는 예시도이다.4 is an exemplary diagram illustrating a block signature generation process performed by the apparatus for generating a function signature of FIG. 1.

도 4를 참조하면, 함수 시그니처 생성 장치(130)는 함수를 구성하는 복수의 블록들 각각에 대해 문자열을 추출할 수 있다. 이 경우, 블록들로부터 추출되는 문자열을 블록들에 포함된 명령어의 집합에 해당할 수 있다. 함수 시그니처 생성 장치(130)는 문자열을 해시 함수 H(x)에 입력하여 고정 길이 n bits의 비트열을 블록 시그니처로서 생성할 수 있다. 예를 들어, 함수 시그니처 생성 장치(130)는 해시 함수 H(x)로서 MD5 함수를 사용할 수 있다.Referring to FIG. 4, the function signature generator 130 may extract a string for each of a plurality of blocks constituting a function. In this case, the string extracted from the blocks may correspond to a set of instructions included in the blocks. The function signature generator 130 may input a string into the hash function H (x) to generate a bit string having a fixed length n bits as a block signature. For example, the function signature generator 130 may use the MD5 function as the hash function H (x).

도 4에서, 특정 함수는 총 4개의 블록들로 구성될 수 있고, 함수 시그니처 생성 장치(130)는 각 블록들로부터 명령어의 집합에 해당하는 문자열로서 addjnz, movjmp, incadc, retn**을 추출할 수 있다. 특히, 마지막 블록의 경우 명령어가 retn으로 다른 블록에서 추출된 문자열보다 길이가 작은 경우 함수 시그니처 생성 장치(130)는 동일한 길이를 가지도록 패딩(padding) 연산을 수행할 수 있고 retn**과 같은 문자열을 생성할 수 있다.In FIG. 4, a specific function may be composed of a total of four blocks, and the function signature generator 130 may extract addjnz, movjmp, incadc, and retn ** as a string corresponding to a set of instructions from each block. Can be. Particularly, in the case of the last block, if the instruction is smaller in length than the string extracted from another block, the function signature generator 130 may perform a padding operation to have the same length, and a string such as retn **. Can be generated.

도 5는 도 1에 있는 함수 시그니처 생성 장치에서 수행되는 함수 시그니처 생성 과정을 설명하는 예시도이다.5 is an exemplary diagram illustrating a function signature generation process performed by the function signature generation device of FIG. 1.

도 5를 참조하면, 함수 시그니처 생성 장치(130)는 블록 시그니처 결정부(250)를 통해 함수를 구성하는 복수의 블록들 각각에 대해 고정 길이의 비트열에 해당하는 블록 시그니처를 생성할 수 있다. 함수 시그니처 생성 장치(130)는 블록 시그니처를 논리적 배타곱 연산인 XOR 연산을 통해 n bits의 비트열을 생성할 수 있고, 해당 비트열을 정수로 변환함으로써 최종적인 함수 시그니처를 생성할 수 있다. 함수 시그니처 생성 장치(130)는 블록 시그니처 간의 XOR 연산을 통해 블록 시그니처의 순서에 상관없이 동일한 블록 시그니처에 대해서는 동일한 함수 시그니처를 생성할 수 있다.Referring to FIG. 5, the function signature generator 130 may generate a block signature corresponding to a bit string having a fixed length for each of a plurality of blocks constituting a function through the block signature determiner 250. The function signature generator 130 may generate a bit string of n bits through the XOR operation, which is a logical double product operation, and may generate a final function signature by converting the bit string into an integer. The function signature generator 130 may generate the same function signature for the same block signature regardless of the order of the block signatures through XOR operations between the block signatures.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.Although described above with reference to a preferred embodiment of the present invention, those skilled in the art will be variously modified and changed within the scope of the invention without departing from the spirit and scope of the invention described in the claims below I can understand that you can.

100: 실행 코드 상의 함수 시그니처 생성 시스템
110: 사용자 단말 130: 함수 시그니처 생성 장치
150: 데이터베이스
210: 함수 결정부 230: 함수 플로우 생성부
250: 블록 시그니처 결정부 270: 함수 시그니처 결정부
290: 제어부
100: function signature generation system in executable code
110: user terminal 130: function signature generating device
150: database
210: function determination unit 230: function flow generation unit
250: block signature determiner 270: function signature determiner
290: control unit

Claims (9)

실행 코드를 분해하여 적어도 하나의 함수를 결정하는 함수 결정부;
상기 적어도 하나의 함수에 대해 각 함수별로 독립적인 분석을 통해 복수의 블록들과 플로우로 구성된 함수 플로우를 생성하는 함수 플로우 생성부;
상기 복수의 블록들로부터 특징 정보를 추출하고 상기 특징 정보를 이용하여 블록 시그니처(signature)를 생성하는 블록 시그니처 결정부; 및
상기 함수 플로우에 따라 상기 블록 시그니처를 기초로 논리적 비트 연산을 통해 상기 특정 함수에 대한 함수 시그니처를 결정하는 함수 시그니처 결정부를 포함하되,
상기 함수 시그니처 결정부는 (a) 상기 복수의 블록들 각각에 대한 블록 시그니처 중 상기 함수 플로우에 따라 처음과 끝에 각각 위치한 제1 블록 시그니처를 결정하는 단계, (b) 상기 제1 블록 시그니처 사이에 존재하는 제2 블록 시그니처에 대해 배타적 논리곱 연산을 수행하여 제2 비트열을 생성하는 단계, (c) 상기 제1 블록 시그니처에 대해 상기 배타적 논리곱 연산과 상이한 논리적 비트 연산을 수행하여 제1 비트열을 생성하는 단계 및 (d) 상기 제1 및 제2 비트열들 간의 배타적 논리곱 연산을 수행하여 상기 함수 시그니처를 결정하는 단계를 순차적으로 수행하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
A function determination unit for decomposing execution code to determine at least one function;
A function flow generation unit for generating a function flow composed of a plurality of blocks and flows through independent analysis for each function of the at least one function;
A block signature determiner which extracts feature information from the plurality of blocks and generates a block signature using the feature information; And
A function signature determiner configured to determine a function signature for the specific function through a logical bit operation based on the block signature according to the function flow,
The function signature determining unit may include (a) determining first block signatures respectively located at the beginning and the end of the block signatures for each of the plurality of blocks according to the function flow, and (b) existing between the first block signatures. Performing an exclusive AND operation on the second block signature to generate a second bit string; (c) performing a logical bit operation different from the exclusive AND operation on the first block signature to generate a first bit string; And generating (d) an exclusive AND operation between the first and second bit strings to determine the function signature in a sequential order.
제1항에 있어서, 상기 함수 결정부는
특정 소프트웨어의 기계어 코드를 기초로 변환된 어셈블리어 코드를 상기 실행 코드로서 분해하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
The method of claim 1, wherein the function determining unit
And an assembly language code converted based on machine code of a specific software as the execution code.
제1항에 있어서, 상기 함수 플로우 생성부는
상기 복수의 블록들 각각에 대응되는 노드와 상기 플로우에 대응되는 단방향 간선으로 구성된 방향 그래프를 상기 함수 플로우로서 생성하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
The method of claim 1, wherein the function flow generating unit
And generating a direction graph including a node corresponding to each of the plurality of blocks and a unidirectional trunk corresponding to the flow as the function flow.
삭제delete 제1항에 있어서, 상기 블록 시그니처 결정부는
상기 특징 정보로서 문자열을 추출하고 상기 문자열에 해시 함수를 적용하여 고정 길이의 비트열을 상기 블록 시그니처로서 생성하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
The method of claim 1, wherein the block signature determination unit
Extracting a character string as the feature information and applying a hash function to the character string to generate a fixed length bit string as the block signature.
제5항에 있어서, 상기 함수 시그니처 결정부는
배타적 논리곱 연산을 통해 상기 블록 시그니처를 상기 블록 시그니처와 동일한 길이의 비트열로 통합한 후 하나의 정수로 변환함으로써 상기 함수 시그니처를 결정하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
The method of claim 5, wherein the function signature determiner
And determining the function signature by integrating the block signature into a bit string having the same length as the block signature through an exclusive AND operation and converting the block signature into a single integer.
제1항에 있어서, 상기 함수 시그니처 결정부는
상기 복수의 블록들 각각에 대한 블록 시그니처 중 2개 이상의 블록 시그니처들을 선별하여 상기 논리적 비트 연산을 수행하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 장치.
The method of claim 1, wherein the function signature determiner
And selecting at least two block signatures among the block signatures for each of the plurality of blocks to perform the logical bit operation.
삭제delete 실행 코드 상의 함수 시그니처 생성 장치에서 수행되는 함수 시그니처 생성 방법에 있어서,
실행 코드를 분해하여 적어도 하나의 함수를 결정하는 단계;
상기 적어도 하나의 함수에 대해 각 함수별로로 독립적인 분석을 통해 복수의 블록들과 플로우로 구성된 함수 플로우를 생성하는 단계;
상기 복수의 블록들로부터 특징 정보를 추출하고 상기 특징 정보를 이용하여 블록 시그니처(signature)를 생성하는 단계; 및
상기 함수 플로우에 따라 상기 블록 시그니처를 기초로 논리적 비트 연산을 통해 상기 특정 함수에 대한 함수 시그니처를 결정하는 단계를 포함하되,
상기 함수 시그니처를 결정하는 단계는 (a) 상기 복수의 블록들 각각에 대한 블록 시그니처 중 상기 함수 플로우에 따라 처음과 끝에 각각 위치한 제1 블록 시그니처를 결정하는 단계, (b) 상기 제1 블록 시그니처 사이에 존재하는 제2 블록 시그니처에 대해 배타적 논리곱 연산을 수행하여 제2 비트열을 생성하는 단계, (c) 상기 제1 블록 시그니처에 대해 상기 배타적 논리곱 연산과 상이한 논리적 비트 연산을 수행하여 제1 비트열을 생성하는 단계 및 (d) 상기 제1 및 제2 비트열들 간의 배타적 논리곱 연산을 수행하여 상기 함수 시그니처를 결정하는 단계를 포함하는 것을 특징으로 하는 실행 코드 상의 함수 시그니처 생성 방법.
In the function signature generation method performed in the function signature generation device on the execution code,
Decomposing the execution code to determine at least one function;
Generating a function flow composed of a plurality of blocks and flows through independent analysis for each of the at least one function;
Extracting feature information from the plurality of blocks and generating a block signature using the feature information; And
Determining a function signature for the specific function through a logical bit operation based on the block signature according to the function flow,
The determining of the function signature may include (a) determining a first block signature located at the beginning and the end of the block signature for each of the plurality of blocks according to the function flow, and (b) between the first block signatures. Generating a second bit string by performing an exclusive AND operation on the second block signature existing in the second block signature; and (c) performing a logical bit operation different from the exclusive AND operation on the first block signature to perform a first bit sequence. Generating a bit string; and (d) performing an exclusive AND operation between the first and second bit strings to determine the function signature.
KR1020180090947A 2018-08-03 2018-08-03 Apparatus and method for generating function signature on executable code KR102066022B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180090947A KR102066022B1 (en) 2018-08-03 2018-08-03 Apparatus and method for generating function signature on executable code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180090947A KR102066022B1 (en) 2018-08-03 2018-08-03 Apparatus and method for generating function signature on executable code

Publications (1)

Publication Number Publication Date
KR102066022B1 true KR102066022B1 (en) 2020-01-14

Family

ID=69152679

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180090947A KR102066022B1 (en) 2018-08-03 2018-08-03 Apparatus and method for generating function signature on executable code

Country Status (1)

Country Link
KR (1) KR102066022B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100960117B1 (en) 2007-12-17 2010-05-28 한국전자통신연구원 Signature Pattern Matching Method, the System for the Same and Computer Readable Medium Storing a Signature Pattern
KR20150133498A (en) * 2014-05-20 2015-11-30 한양대학교 산학협력단 Signature generation apparatus for generating signature of program and the method, malicious code detection apparatus for detecting malicious code of signature and the method
KR20160082644A (en) * 2014-12-30 2016-07-08 충남대학교산학협력단 Method and apparatus for detecting malware by code block classification

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100960117B1 (en) 2007-12-17 2010-05-28 한국전자통신연구원 Signature Pattern Matching Method, the System for the Same and Computer Readable Medium Storing a Signature Pattern
KR20150133498A (en) * 2014-05-20 2015-11-30 한양대학교 산학협력단 Signature generation apparatus for generating signature of program and the method, malicious code detection apparatus for detecting malicious code of signature and the method
KR20160082644A (en) * 2014-12-30 2016-07-08 충남대학교산학협력단 Method and apparatus for detecting malware by code block classification

Similar Documents

Publication Publication Date Title
CN111639344B (en) Vulnerability detection method and device based on neural network
CN109445834B (en) Program code similarity rapid comparison method based on abstract syntax tree
CN108446540B (en) Program code plagiarism type detection method and system based on source code multi-label graph neural network
US8051410B2 (en) Apparatus for migration and conversion of software code from any source platform to any target platform
US10243982B2 (en) Log analyzing device, attack detecting device, attack detection method, and program
CN110348214B (en) Method and system for detecting malicious codes
US9218372B2 (en) System and method of record matching in a database
CN110825363A (en) Intelligent contract obtaining method and device, electronic equipment and storage medium
JP6778654B2 (en) Word-splitting estimation model learning device, word-splitting device, method, and program
CN106990956A (en) Code file clone's detection method based on suffix tree
CN105426707B (en) A kind of instruction-level cryptographic algorithm recognition methods and system
CN108845843A (en) A kind of function processing method, device and relevant device
CN112685738B (en) Malicious confusion script static detection method based on multi-stage voting mechanism
JP2016157407A (en) Prior construction method of vocabulary semantic pattern for text analysis and response system
CN112764738A (en) Code automatic generation method and system based on multi-view program characteristics
JP4951416B2 (en) Program verification method and program verification apparatus
US10394763B2 (en) Method and device for generating pileup file from compressed genomic data
CN112579469A (en) Source code defect detection method and device
US20210389977A1 (en) System migration support apparatus, system migration support method and program
KR102066022B1 (en) Apparatus and method for generating function signature on executable code
CN108304467B (en) Method for matching between texts
US20110067010A1 (en) Method for Characterization of a Computer Program Part
Savchenko et al. Deedp: vulnerability detection and patching based on deep learning
CN109656543B (en) Automatic code generation method based on file keyword replacement
JP6175306B2 (en) Control program dividing apparatus, control program dividing method and recording medium therefor

Legal Events

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