KR102013657B1 - Apparatus for statically analyzing assembly code including assoxiated multi files - Google Patents

Apparatus for statically analyzing assembly code including assoxiated multi files Download PDF

Info

Publication number
KR102013657B1
KR102013657B1 KR1020180043918A KR20180043918A KR102013657B1 KR 102013657 B1 KR102013657 B1 KR 102013657B1 KR 1020180043918 A KR1020180043918 A KR 1020180043918A KR 20180043918 A KR20180043918 A KR 20180043918A KR 102013657 B1 KR102013657 B1 KR 102013657B1
Authority
KR
South Korea
Prior art keywords
function
assembly code
static analysis
trace
file
Prior art date
Application number
KR1020180043918A
Other languages
Korean (ko)
Other versions
KR20180129623A (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 충남대학교산학협력단
Publication of KR20180129623A publication Critical patent/KR20180129623A/en
Application granted granted Critical
Publication of KR102013657B1 publication Critical patent/KR102013657B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection

Abstract

본 발명은 연관된 다중 파일 정적 분석 장치에 관한 것으로, 디스어셈블된 바이너리의 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보, 추적 정보, 추적 상태 및 인스트럭션에 대응하는 레지스터명을 저장하는 데이터베이스, 분석 대상 바이너리가 입력되면 바이너리의 특성을 분석하여 대응되는 복수의 파일 및 복수의 함수 목록을 표시하고, 상기 표시된 복수의 함수 목록 중 제1 함수가 선택되면, 상기 제1 함수의 정방향 또는 역방향 콜체인을 표시하고, 상기 제1 함수, 상기 제1 함수의 정방향 함수인 제2 함수 또는 상기 제1 함수의 역방향 함수인 제3 함수의 어셈블리 코드를 표시하고, 상기 제1 함수의 선택이 해지되고 상기 제2 함수가 선택되면 상기 제1 함수, 상기 제2 함수, 상기 제3 함수의 어셈블리 코드 표시를 해제하고, 상기 제2 함수, 상기 제2 함수의 정방향 함수인 제4 함수 또는 역방향 함수인 제5 함수의 어셈블리 코드를 표시하는 어셈블리 코드 추출부, 및 상기 어셈블리 코드 추출부에서 상기 제1 함수 내지 제5 함수 중 하나에 대응하는 레지스터명의 추적을 요청하는 경우, 상기 데이터베이스를 통해 상기 레지스터명에 대응되는 레지스터 정보를 추출하여 상기 어셈블리 코드 추출부로 제공하는 정적 분석부를 포함한다. 본 발명에 의하면, 기계어 수준에서도 서로 연관된 다중 파일의 함수의 흐름을 자동으로 표시하여 정적 분석이 가능하도록 제공하므로 복수의 실행 파일에서 함께 활용되는 특정 함수의 콜체인을 쉽게 추적할 수 있어 정적 분석 속도를 향상시킬 수 있다.The present invention relates to an associated multi-file static analysis device, comprising: a database storing program names, function names, assembly code, branch information, trace information, trace names, trace states, and register names corresponding to disassembled binaries; When a binary is input, the characteristics of the binary are analyzed to display a list of corresponding files and a plurality of functions. When a first function is selected from the displayed list of functions, a forward or reverse call chain of the first function is displayed. And display assembly code of the first function, a second function that is a forward function of the first function, or a third function that is a reverse function of the first function, the selection of the first function is terminated, and the second function When is selected, the display of assembly code of the first function, the second function, and the third function is canceled, and the second function, the phase An assembly code extracting unit for indicating assembly code of a fourth function that is a forward function of the second function or a fifth function that is a reverse function, and a register name corresponding to one of the first to fifth functions in the assembly code extracting unit In the case of requesting tracking, it includes a static analysis unit for extracting the register information corresponding to the register name through the database to provide to the assembly code extraction unit. According to the present invention, since the flow of functions of multiple files associated with each other is automatically displayed even at the machine language level, the static analysis speed can be easily traced by easily tracking the call chain of a specific function utilized in a plurality of executable files. Can improve.

Description

연관된 다중 파일 정적 분석 장치{APPARATUS FOR STATICALLY ANALYZING ASSEMBLY CODE INCLUDING ASSOXIATED MULTI FILES}Associated multi-file static analysis device {APPARATUS FOR STATICALLY ANALYZING ASSEMBLY CODE INCLUDING ASSOXIATED MULTI FILES}

본 발명은 바이너리 분석 중 디스어셈블된 코드를 따라가며 실행흐름을 파악하는 정적 분석에 관한 것이다.The present invention relates to a static analysis that tracks the disassembled code and analyzes execution flow during binary analysis.

스마트폰, PC 등을 비롯하여 사용자의 주변에 도움을 주는 각종 기기들은 점차 널리 보급되고 있다. 이러한 기기들은 사용자들에게 각종 생활 편의를 제공하고 있다. Smartphones, PCs and other devices that help the user around are becoming more and more widespread. Such devices provide various conveniences to users.

이러한 기기들이 사용자에게 생활 편의를 제공하는 과정에서 필수적으로 개인정보가 사용되게 되며, 이에 따라 개인 정보 탈취 등을 목적으로 하는 악성 행위를 유발하는 프로그램들이 늘어나고 있다. 이러한 악성 행위를 하는 프로그램에 대처하기 위하여 해당되는 프로그램의 바이너리를 분석하는 것이 필수적이다.In the process of providing the convenience to users of these devices, personal information is essentially used, and accordingly, programs that cause malicious behavior for the purpose of taking personal information are increasing. It is essential to analyze the binary of the program in order to cope with such malicious program.

대표적인 바이너리 분석 방법에는 크게 정적 분석 방법과 동적 분석 방법이 있고, 이들 중 정적 분석 방법은 디스어셈블된 코드를 따라가며 실행 흐름을 파악하는 방법이고, 동적 분석 방법은 디버거를 붙여서 코드의 줄 단위로 실행하며 분석하는 방법이다. Typical binary analysis methods include static analysis methods and dynamic analysis methods. Among them, static analysis methods follow the disassembled code and grasp the execution flow, and dynamic analysis methods are executed by line of code by attaching a debugger. And analysis.

일반적으로, 바이너리 분석을 수행하기 위하여 상술한 두 가지 분석 방법을 동시에 사용하여 분석을 진행한다. 그러나, 악성 행위를 하는 프로그램 중 일부는 동적 분석 대상이 되는 파일에 대해 디버거를 활용하여 할 때 해당 파일을 종료시키거나 에러를 발생시켜 동적 분석을 방해하는 경우가 있다. In general, in order to perform binary analysis, the analysis is performed by using the above-described two analysis methods simultaneously. However, some of the malicious programs may terminate the file or generate an error when the debugger is used for the file to be analyzed, thereby interfering with the dynamic analysis.

이러한 경우, 정적 분석 방법만으로 바이너리 분석을 진행해야 하기 때문에 분석자가 수동으로 디스어셈블된 코드를 따라가며 실행흐름을 파악해는데 소요되는 시간이 크게 늘어나는 문제가 있다. In this case, since the binary analysis must be performed using only static analysis method, the time required for the analyst to follow the disassembled code manually and figure out the execution flow is greatly increased.

또한, 정적 분석 방법으로 대표적으로 사용되는 상용 프로그램인 IDA pro는 하나의 바이너리를 대상으로 디스어셈블을 진행하고 함수 콜체인을 보여줘서 분석을 용이하게 한다. 정적 분석을 진행함에 있어서 사용되는 종래의 IDA 프로그램은 하나의 바이너리를 디스어셈블하여 리버싱 할 수 있도록 하는 프로그램으로, 분석 중 다른 프로그램에서 정의한 함수가 발견되는 경우 임포트 테이블을 확인하여 해당 함수가 어떤 프로그램에 정의되어있는지 사용자가 직접 확인하고, 확인된 프로그램을 다시 IDA로 열어 분석해야하는 번거로움이 있다.In addition, IDA pro, a commercial program typically used as a static analysis method, disassembles a binary and shows a function call chain to facilitate analysis. The conventional IDA program used in the static analysis is a program that disassembles and reverses one binary. If a function defined by another program is found during analysis, the program checks the import table. It is a hassle that you have to check if it is defined in and then open the identified program again with IDA.

또한, 종래의 IDA 프로그램은 바이너리 분석시에 레지스터의 값이 어디로부터 영향을 받았는지(역방향 분석), 어디로 영향을 끼치는지(정방향 분석) 각각에 대한 분석을 진행하는 경우 줄 단위로 확인하여 분석을 진행하여야 하므로 분석에 오랜 시간이 걸리며, 올바른 분석이 진행되었는지 확인하는데 어려움이 있다.In addition, the conventional IDA program checks in line units when analyzing the binary values from where the register value is affected (reverse analysis) and where it affects (forward analysis). The analysis takes a long time because it must proceed, and it is difficult to confirm that the correct analysis has been performed.

본 발명은 연관된 복수의 파일들을 분석하여 복수의 파일들 각각에 포함된 함수들의 관계를 데이터베이스화함으로써 서로 다른 파일에 포함된 함수들의 관계를 추적할 수 있는 연관된 다중 파일 정적 분석 장치를 제공하는데 그 목적이 있다.An object of the present invention is to provide an associated multi-file static analysis apparatus capable of tracking the relationship of functions included in different files by analyzing a plurality of related files and databaseting the relationship of functions included in each of the plurality of files. There is this.

상기의 목적을 달성하기 위해 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치는 디스어셈블된 바이너리의 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보, 추적 정보, 추적 상태 및 인스트럭션에 대응하는 레지스터명 중 적어도 하나를 저장하는 데이터베이스, 분석 대상 바이너리가 입력되면 바이너리의 특성을 분석하여 대응되는 복수의 파일 및 복수의 함수 목록을 표시하고, 상기 표시된 복수의 함수 목록 중 제1 함수가 선택되면, 상기 제1 함수의 정방향 또는 역방향 콜체인을 표시하고, 상기 제1 함수, 상기 제1 함수의 정방향 함수인 제2 함수 또는 상기 제1 함수의 역방향 함수인 제3 함수의 어셈블리 코드를 표시하고, 상기 제1 함수의 선택이 해지되고 상기 제2 함수가 선택되면 상기 제1 함수, 상기 제2 함수, 상기 제3 함수의 어셈블리 코드 표시를 해제하고, 상기 제2 함수, 상기 제2 함수의 정방향 함수인 제4 함수 또는 역방향 함수인 제5 함수의 어셈블리 코드를 표시하는 어셈블리 코드 추출부, 및 상기 어셈블리 코드 추출부에서 상기 제1 함수 내지 제5 함수 중 하나에 대응하는 레지스터명의 추적을 요청하는 경우, 상기 데이터베이스를 통해 상기 레지스터명에 대응되는 레지스터 정보를 추출하여 상기 어셈블리 코드 추출부로 제공하는 정적 분석부를 포함한다. In order to achieve the above object, an associated multi-file static analysis apparatus according to an embodiment of the present invention corresponds to a program name, a function name, assembly code, branch information, trace information, trace state, and instructions of a disassembled binary. When a database storing at least one of the register names and a binary to be analyzed are input, the characteristics of the binary are analyzed to display a list of corresponding files and a plurality of functions, and when a first function is selected from the displayed list of functions, Indicates a forward or reverse call chain of the first function, displays assembly code of the first function, a second function that is a forward function of the first function, or a third function that is a reverse function of the first function, and When the selection of the first function is terminated and the second function is selected, the first function, the second function, and the third function An assembly code extracting unit for releasing assembly code display and displaying assembly code of the second function, a fourth function that is a forward function of the second function, or a fifth function that is a reverse function, and the assembly code extracting unit; When requesting to track a register name corresponding to one of the first to fifth functions, and includes a static analysis unit for extracting the register information corresponding to the register name through the database to provide to the assembly code extraction unit.

연관된 다중 파일 정적 분석 장치는 상기 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보 및 레지스터명을 생성하는 전처리부를 더 포함할 수 있다. The associated multi-file static analysis apparatus may further include a preprocessor for generating a program name, a function name, an assembly code, branch information, and a register name corresponding to each of the plurality of files.

정적 분석 장치는, 클라이언트 장치와 연결되고, 상기 클라이언트 장치는, 상기 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보 및 레지스터명을 생성하여 상기 정적 분석 장치로 전달할 수 있다. The static analysis device is connected to a client device, and the client device may generate a program name, a function name, an assembly code, branch information, and a register name corresponding to each of the plurality of files and transmit the generated program name to the static analysis device. .

또한, 정적 분석부는 특정 레지스터명이 추적 대상으로 선택되면 상기 추적 대상의 추적 정보와 추적 상태를 상기 데이터베이스에 저장한 후 추적을 시작하며, 상기 추적 정보는 추적 대상의 함수 정보, 코드라인 정보, 레지스터, 추적 형태, 코드 및 추적 체인에 대한 정보를 포함할 수 있다.In addition, if a specific register name is selected as a tracking target, the static analyzer stores the tracking information and tracking status of the tracking target in the database and starts tracking. The tracking information may include tracking function information, code line information, registers, and the like. It may contain information about trace type, code, and trace chain.

또한, 정적 분석부는 정추적이 요청되면 인스트럭션 단위로 추적 대상을 분석하여 분기 명령이 있는지 판단하고, 분기 명령이 있다고 판단되면 상기 레지스터명에 대응되는 추적 대상이 존재하는지 판단하고, 추적 대상이 존재하면 역추적 결과에 따라 추적 완료 또는 메모리 추적을 수행할 수 있다.In addition, when static tracking is requested, the static analysis unit analyzes the tracking target in units of instructions to determine whether there is a branch instruction, and if there is a branch instruction, determines whether there is a tracking target corresponding to the register name. Depending on the traceback result, trace completion or memory trace can be performed.

또한, 정적 분석부는 상기 추적 대상이 존재하지 않으면 다음 명령어를 확인하여 상기 추적 대상 분석 과정부터 다시 수행할 수 있다. In addition, if the tracer does not exist, the static analyzer may check the next command and perform the tracer analysis process again.

또한, 정적 분석부는 상기 분기 명령이 없다고 판단되면 다른 함수에게 영향을 주는지 또는 다른 함수로부터 영향을 받는지에 따라 추적 대상에 대응하는 상기 레지스터명을 변경하여 다음 명령어를 확인한 후 상기 추적 대상 분석 과정을 다시 수행하거나, 또는 추적을 완료할 수 있다. In addition, if it is determined that the branch instruction does not exist, the static analysis unit changes the register name corresponding to the trace object according to whether it affects another function or is influenced by the other function, confirms the next instruction, and then repeats the trace object analysis process. You can either do it or complete the trace.

또한, 정적 분석부는 역추적이 요청되면 인스트럭션 단위로 추적 대상을 확인하고, 상기 레지스터명에 대응되는 추적 대상이 존재하는지 판단하고, 추적 대상이 존재하면 다른 함수로부터 영향을 받는지에 따라 레지스터명을 확인하는 단계로 넘어가거나 또는 인스트럭션을 해석하기 위한 참조 주소를 확인할 수 있다. In addition, the static analyzer checks the trace target in units of instructions when the traceback is requested, determines whether a trace target corresponding to the register name exists, and if the trace target exists, checks the register name according to whether it is affected by another function. You can either go to step one or check the reference address to resolve the instruction.

또한, 정적 분석부는 상기 추적 대상이 존재하지 않으면 참조 주소를 확인할 수 있다. In addition, the static analyzer may check the reference address if the tracking target does not exist.

또한, 정적 분석부는 상기 참조 주소를 확인하여 내부 주소인지 외부 파일인지 판단하고, 상기 참조 주소가 내부 주소 또는 외부 파일인 경우, 추적 대상을 수정한 후 상기 추적 대상 확인 단계부터 다시 수행하고, 상기 참조 주소가 내부 주소도 아니고 외부 파일도 아닌 경우, 추적을 완료할 수 있다. The static analyzer may determine whether the reference address is an internal address or an external file by checking the reference address, and if the reference address is an internal address or an external file, correct the tracking target and then perform the tracking target check step again. If the address is neither an internal address nor an external file, tracing can be completed.

또한, 정적 분석부는 상기 레지스터명을 확인하여, 상기 레지스터명이 존재하면 명령어에 따른 추적 대상을 추가 또는 변경하고, 상기 레지스터명이 존재하지 않으면 메모리 추적을 수행할 수 있다. The static analyzer may check the register name to add or change a tracking target according to an instruction if the register name exists, and perform memory tracking if the register name does not exist.

또한, 어셈블리 코드 추출부는 상기 복수의 함수 목록 중 특정 함수의 정방향 또는 역방향 콜체인을 표시하고, 상기 콜체인에 포함된 다른 파일의 함수를 선택한 경우, 상기 정적 분석부에서 상기 선택된 다른 파일의 함수를 호출하여 표시하는 방법으로 연관된 다중 파일의 실행 흐름을 분석할 수 있다. In addition, the assembly code extracting unit displays a forward or reverse call chain of a specific function among the plurality of function lists, and when selecting a function of another file included in the call chain, the assembly unit extracts a function of the selected other file. You can analyze the execution flow of multiple associated files by calling and displaying them.

본 발명에 의하면, 기계어 수준에서도 서로 연관된 다중 파일의 함수의 흐름을 자동으로 표시하여 정적 분석이 가능하도록 제공하므로 복수의 실행 파일에서 함께 활용되는 특정 함수의 콜체인을 쉽게 추적할 수 있어 정적 분석 속도를 향상시킬 수 있는 효과가 있다.According to the present invention, since the flow of functions of multiple files associated with each other is automatically displayed even at the machine language level, the static analysis speed can be easily traced by easily tracking the call chain of a specific function utilized in a plurality of executable files. There is an effect to improve.

도 1은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 개략적인 구성도이다.
도 2는 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치를 포함하는 시스템의 개략적인 구성도이다.
도 3은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 분석 결과를 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 콜체인을 설명하기 위한 개념도이다.
도 5 내지 도 6은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 정방향 분석을 설명하기 위한 도면이다.
도 7 내지 도 8은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 역방향 분석을 설명하기 위한 도면이다.
1 is a schematic structural diagram of an associated multi-file static analysis apparatus according to an embodiment of the present invention.
2 is a schematic structural diagram of a system including an associated multi-file static analysis apparatus according to an embodiment of the present invention.
3 is a view for explaining an analysis result of the associated multi-file static analysis device according to an embodiment of the present invention.
4 is a conceptual diagram illustrating a call chain of an associated multi-file static analysis apparatus according to an embodiment of the present invention.
5 to 6 illustrate a forward analysis of an associated multi-file static analysis apparatus according to an embodiment of the present invention.
7 to 8 illustrate reverse analysis of an associated multi-file static analysis apparatus according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면을 참조하여 상세하게 설명하도록 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.As the present invention allows for various changes and numerous embodiments, particular embodiments will be described in detail with reference to the accompanying drawings. However, this is not intended to limit the present invention to specific embodiments, it should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. In describing the drawings, similar reference numerals are used for similar elements.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재 항목들의 조합 또는 복수의 관련된 기재 항목들 중의 어느 항목을 포함한다.Terms such as first, second, A, and B may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes any of a plurality of related description items or a combination of a plurality of related description items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급될 때에는 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. When a component is said to be "connected" or "connected" to another component, it may be directly connected to or connected to the other component, but it should be understood that there may be other components in between. something to do. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "comprise" or "have" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art and shall not be construed in ideal or excessively formal meanings unless expressly defined in this application. Do not.

명세서 및 청구범위 전체에서, 어떤 부분이 어떤 구성 요소를 포함한다고 할때, 이는 특별히 반대되는 기재가 없는 한 다른 구성 요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있다는 것을 의미한다. Throughout the specification and claims, when a part includes a certain component, it means that it may further include other components, except to exclude other components unless specifically stated otherwise.

이하, 본 발명에 따른 바람직한 실시예를 첨부된 도면을 참조하여 상세하게 설명한다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 개략적인 구성도이다.1 is a schematic structural diagram of an associated multi-file static analysis apparatus according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치(100)는 데이터베이스(110), 어셈블리 코드 추출부(120) 및 정적 분석부(130)를 포함한다. 또한, 연관된 다중 파일 정적 분석 장치(100)는 전처리부(140)를 더 포함할 수 있고, 도시하지는 않았지만, 통신부, 인터페이스부, 디스플레이부 등을 더 포함할 수 있다. Referring to FIG. 1, an associated multi-file static analysis apparatus 100 according to an embodiment of the present invention includes a database 110, an assembly code extractor 120, and a static analyzer 130. In addition, the associated multi-file static analysis apparatus 100 may further include a preprocessor 140, and although not illustrated, may further include a communication unit, an interface unit, a display unit, and the like.

구체적으로, 데이터베이스(110)는 디스어셈블된 바이너리의 프로그램 이름, 함수의 이름 어셈블리 코드, 분기 정보, 추적 정보, 추적 상태 및 인스트럭션에 대응하는 레지스터명 중 적어도 하나를 저장할 수 있다. 이때, 데이터베이스(110)에 저장되는 정보는 전처리부(140)에서 생성된 정보일수도 있고, 외부의 클라이언트 장치로부터 수신한 정보일수도 있다. In detail, the database 110 may store at least one of a program name of a disassembled binary, a name assembly code of a function, branch information, trace information, a trace state, and a register name corresponding to an instruction. In this case, the information stored in the database 110 may be information generated by the preprocessor 140 or information received from an external client device.

어셈블리 코드 추출부(120)는 분석 대상 바이너리에서 사용되는 복수의 파일과 각 파일에 포함되는 복수의 함수 목록을 데이터베이스(110)를 검색하여 표시할 수 있다. 즉, 어셈블리 코드 추출부(120)는 분석 대상 바이너리가 입력되면 바이너리의 특성을 분석하여 대응하는 파일, 함수 목록을 데이터베이스(110)를 통해 검색하여 표시할 수 있다. The assembly code extractor 120 may search and display the database 110 for a plurality of files used in the analysis target binary and a plurality of function lists included in each file. That is, when the analysis target binary is input, the assembly code extractor 120 may analyze the characteristics of the binary to search for and display a list of corresponding files and functions through the database 110.

어셈블리 코드 추출부(120)는 표시된 복수의 함수 목록 중 제1 함수가 선택되면, 제1 함수의 정방향 함수인 제2 함수 또는 제1 함수의 역방향 함수인 제3 함수의 어셈블리 코드를 표시할 수 있다. 구체적으로, 제1 함수가 선택되면 제1 함수를 호출하는 적어도 하나의 정방향 함수와, 제1 함수로부터 호출된 적어도 하나의 역방향 함수를 표시할 수 있다. 설명의 편의를 위하여, 적어도 하나의 정방향 함수가 1개인 경우, 적어도 하나의 역방향 함수가 1개인 경우를 예로 들어 설명하지만, 제1 함수와 직접 연결된 복수의 정방향 함수와 복수의 역방향 함수가 존재할 수 있다. When the first function is selected from the plurality of function lists displayed, the assembly code extractor 120 may display the assembly code of the second function that is a forward function of the first function or the third function that is a reverse function of the first function. . Specifically, when the first function is selected, at least one forward function calling the first function and at least one reverse function called from the first function may be displayed. For convenience of description, when the at least one forward function is one, the at least one reverse function is described as an example, but there may be a plurality of forward functions and a plurality of backward functions directly connected to the first function. .

어셈블리 코드 추출부(120)는 제1 함수의 선택이 해지되고 제2 함수가 선택되면 제1 함수, 제2 함수, 제3 함수의 어셈블리 코드 표시를 해제하고, 제2 함수, 제2 함수의 정방향 함수인 제4 함수 또는 역방향 함수인 제5 함수의 어셈블리 코드를 표시할 수 있다. 여기서, 어셈블리 코드 추출부(120)는 제2 함수가 선택되는 신호를 제1 함수의 선택 해지 신호로 판단할 수 있다. 제2 함수의 정방향 함수만 존재하는 경우에는 제4 함수만 표시하고, 역방향 함수만 존재하는 경우에는 제5 함수만 표시하고, 정방향 함수와 역방향 함수가 모두 존재하는 경우에는 제4 함수, 제5 함수를 모두 표시할 수 있다. When the selection of the first function is canceled and the second function is selected, the assembly code extractor 120 releases the display of assembly code of the first function, the second function, and the third function, and forwards the second function and the second function. The assembly code of the fourth function, which is a function, or the fifth function, which is a reverse function, can be displayed. Here, the assembly code extractor 120 may determine the signal from which the second function is selected as the selection release signal of the first function. If only the forward function of the second function is present, only the fourth function is displayed; if only the reverse function is present, only the fifth function is displayed; if both the forward and reverse functions are present, the fourth and fifth functions are displayed. You can display all of them.

어셈블리 코드 추출부(120)는 복수의 함수 목록 중 특정 함수의 정방향 또는 역방향 콜체인을 표시하고, 콜체인에 포함된 다른 파일의 함수를 선택한 경우, 정적 분석부(130)에서 선택된 다른 파일의 함수를 호출하여 표시하는 방법의 연관된 다중 파일의 실행 흐름을 분석할 수 있다. The assembly code extracting unit 120 displays the forward or reverse call chain of a specific function among a plurality of function lists, and when a function of another file included in the call chain is selected, the function of the other file selected by the static analysis unit 130. You can analyze the execution flow of multiple associated files in a way of calling and displaying them.

정적 분석부(130)는 어셈블리 코드 추출부(120)에서 제1 함수 내지 제5 함수 중 하나에 대응하는 레지스터명의 추적을 요청하는 경우, 데이터베이스(110)를 통해 상기 레지스터명에 대응되는 레지스터 정보를 추출하여 어셈블리 코드 추출부(120)로 제공할 수 있다. When the static analysis unit 130 requests tracking of a register name corresponding to one of the first to fifth functions from the assembly code extracting unit 120, the static analysis unit 130 obtains register information corresponding to the register name through the database 110. Can be extracted and provided to the assembly code extraction unit 120.

정적 분석부(130)는 특정 레지스터 값이 추적 대상으로 선택되면 추적 대상의 추적 정보와 추적 상태를 데이터베이스(110)에 저장한 후 추적을 시작할 수 있다. 정적 분석부(130)는 정추적이 요청되면 추적 대상을 분석하고, 분기 명령이 있는지, 추적 대상이 존재하는 지, 다른 함수와의 관계 등에 따라 구체적인 추적 방법을 결정할 수 있다. 또한, 정적 분석부(130)는 역추적이 요청되면 추적 대상을 확인하고, 추적 대상의 존재 여부, 다른 함수와의 관계 등에 따라 구체적인 추적 방법을 결정할 수 있다. If a specific register value is selected as the tracking target, the static analyzer 130 may start tracking after storing the tracking information and the tracking status of the tracking target in the database 110. When static tracking is requested, the static analysis unit 130 may analyze the tracking target and determine a specific tracking method according to whether there is a branch instruction, whether the tracking target exists, or a relationship with another function. In addition, the static analysis unit 130 may check the tracking target when the backtracking request is requested, and determine a specific tracking method according to the existence of the tracking target and the relationship with other functions.

전처리부(140)는 분석 대상 바이너리를 분석하여 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보, 및 레지스터명을 생성할 수 있다. The preprocessor 140 may analyze the binary to be analyzed to generate a program name, a function name, assembly code, branch information, and a register name corresponding to each of the plurality of files.

상기의 어셈블리 코드 추출부(120), 정적 분석부(130), 및 전처리부(140)는 각각 독립된 하드웨어를 의미할 수도 있고, 하나의 CPU(Computer Processing Unit) 내의 기능별로 구분된 모듈 내지 기능 단위를 의미할 수도 있다. The assembly code extractor 120, the static analyzer 130, and the preprocessor 140 may each refer to independent hardware, and may be divided into modules or functional units classified by functions in one computer processing unit (CPU). It may mean.

연관된 다중 파일 정적 분석 장치(100)는 전처리부(140)에서 분석 대상 바이너리를 분석하여 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보, 및 레지스터명을 생성할 수 있지만, 전처리부(140)에서 이러한 기능을 수행하지 않고, 클라이언트 장치로부터 상기의 정보들을 수신하여 데이터베이스(110)에 저장할 수 있다. 여기서, 클라이언트 장치는 연관된 다중 파일 정적 분석 장치(100)와는 물리적 또는 개념적으로 분리된 별개의 장치를 의미한다. The associated multi-file static analysis apparatus 100 may analyze the binary to be analyzed in the preprocessor 140 to generate a program name, a function name, assembly code, branch information, and a register name corresponding to each of the plurality of files. The preprocessing unit 140 may receive the above information from the client device and store the information in the database 110 without performing this function. Here, the client device refers to a separate device that is physically or conceptually separated from the associated multi-file static analysis device 100.

도 2는 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치를 포함하는 시스템의 개략적인 구성도이다.2 is a schematic structural diagram of a system including an associated multi-file static analysis apparatus according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 시스템은 연관된 다중 파일 정적 분석 장치(100), 및 클라이언트 장치(200)로 구성될 수 있다. 또한, 연관된 다중 파일 정적 분석 시스템은 사용자 단말기(300)를 더 구비할 수 있다. Referring to FIG. 2, an associated multi-file static analysis system according to an embodiment of the present invention may be composed of an associated multi-file static analysis apparatus 100 and a client device 200. In addition, the associated multi-file static analysis system may further include a user terminal 300.

사용자 단말기(300)는 분석할 바이너리 임포트 테이블의 함수가 있는 바이너리를 입력하여 클라이언트 장치(200)에 제공한다.The user terminal 300 inputs a binary having a function of a binary import table to be analyzed and provides it to the client device 200.

클라이언트 장치(200)는 상술한 IDA PRO를 통해 바이너리를 분석함으로써 복수의 프로그램 각각의 이름, 복수의 프로그램 각각에 포함된 함수 정보, 복수의 프로그램 각각에 포함된 분기점 정보 및 복수의 프로그램 각각의 어셈블리코드 정보를 생성하여 연관된 다중 파일 정적 분석 장치(100)에 전송한다. 이때, 클라이언트 장치(200)는 디스어셈블러 및 분석기로 구성이 구분될 수 있다.The client device 200 analyzes the binary through the above-described IDA PRO, thereby analyzing the names of the plurality of programs, function information included in each of the plurality of programs, branch point information included in each of the plurality of programs, and assembly codes of the plurality of programs. The information is generated and transmitted to the associated multi-file static analysis apparatus 100. In this case, the client device 200 may be divided into a disassembler and an analyzer.

그 결과, 본 발명의 실시예에 따른 연관된 다중 파일 정적 분석 장치(100)는 수신한 함수 정보, 분기점 정보 및 어셈블리코드 정보를 활용하여 복수의 프로그램에 대해 정적 분석을 수행할 수 있으며, 특히나 복수의 프로그램에서 연속적으로 활용되는 특정 함수에 대해서, 특정 함수 활용되는 프로그램의 콜체인을 분석할 수 있다. 여기서, 파일은 파일 이름, 파일 해쉬, 파일 함수 개수에 대한 정보를 포함하고, 함수는 함수 이름, 함수 해쉬, 함수 타입, 함수 콜 카운트, 함수 라인 등의 정보를 포함한다. 함수 콜은 연관된 함수, 호출명, 호출에 대한 정보 등을 포함하고, 함수 코드는 연관된 함수, 어셈블리 코드, 코드 정보 등을 포함하고, 기록은 추적 정보, 연관된 함수, 코드라인 정보 등의 정보를 포함한다. 추적은 함수 정보, 코드라인 정보, 레지스터, 추적 형태, 코드, 추적 체인, 추적 상태 등의 정보를 포함하며, 클라이언트 장치(200)에서 이러한 정보들은 추출되어 연관된 다중 파일 정적 분석 장치(100)의 데이터베이스(100)에 저장될 수 있다. As a result, the associated multi-file static analysis apparatus 100 according to the embodiment of the present invention may perform a static analysis on a plurality of programs by using the received function information, branch point information, and assembly code information. You can analyze the call chain of a program that utilizes a specific function for a specific function that is used continuously in the program. Here, the file includes information about a file name, a file hash, and the number of file functions, and the function includes information such as a function name, a function hash, a function type, a function call count, a function line, and the like. The function call includes the associated function, call name, information about the call, etc., the function code includes the associated function, assembly code, code information, etc., and the record includes information such as trace information, associated function, codeline information, etc. . The trace includes information such as function information, codeline information, registers, trace type, code, trace chain, trace state, and the like, which is extracted from the client device 200 and the database of the associated multi-file static analysis device 100. 100 may be stored.

도 3은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 분석 결과를 설명하기 위한 도면이고, 도 4는 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 콜체인을 설명하기 위한 개념도이다.3 is a diagram illustrating an analysis result of an associated multi-file static analysis device according to an embodiment of the present invention, and FIG. 4 is a view illustrating a call chain of an associated multi-file static analysis device according to an embodiment of the present invention. This is a conceptual diagram.

도 3을 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치는 분석 대상 바이너리에서 사용되는 복수의 파일 목록을 표시하고, 특정 파일을 선택하면 특정 파일에 포함된 복수의 함수 목록을 분석 대상 선택 화면에 표시할 수 있다. Referring to FIG. 3, an associated multi-file static analysis apparatus according to an embodiment of the present invention displays a list of a plurality of files used in an analysis target binary, and selecting a specific file displays a plurality of function lists included in a specific file. Can be displayed on the analysis target selection screen.

또한, 특정 함수를 선택하면 특정 함수(Caller)의 정방향 함수 또는 역방향 함수(Callee)를 표시하고, 각각의 어셈블리 코드를 분석 대상 출력 화면에 표시한다. 분석 대상 선택 화면과 분석 대상 출력 화면은 디스플레이부의 구분된 화면 영역일 수 있다. 또한, 디스어셈블리 코드 출력 화면과 추적 대상 선택 화면도 분석 대상 선택 화면과 분석 대상 출력 화면과 구분할 수 있다. In addition, if a specific function is selected, a forward function or a backward function (Callee) of a specific function (Caller) is displayed, and each assembly code is displayed on the analysis target output screen. The analysis target selection screen and the analysis target output screen may be divided screen areas of the display unit. Also, the disassembly code output screen and the tracking target selection screen may be distinguished from the analysis target selection screen and the analysis target output screen.

도 4를 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치는 분석의 대상이 되는 특정 함수가 사용된 곳을 모든 바이너리에서 추출할 수 있으며, 이를 토대로 정방향 또는 역방향 분석을 수행할 수 있다.Referring to FIG. 4, an associated multi-file static analysis apparatus according to an embodiment of the present invention may extract a location where a specific function to be analyzed is used from all binaries, and perform forward or reverse analysis based on the same. Can be.

더 나아가, 본 발명의 실시예에 따른 연관된 다중 파일 정적 분석 장치(100)는 각각의 함수의 어셈블리 코드를 추출하여 분석을 진행할 수 있으며, 이와 함께 서버에서 백 그라운드로 동작하여, 웹에서 해당 레지스터 값을 추적 요청 하면 DB에 저장된 데이터를 토대로 정방향 추적 또는 역방향 추적기능을 제공할 수 있다. Furthermore, the associated multi-file static analysis apparatus 100 according to the embodiment of the present invention may extract the assembly code of each function and proceed with the analysis. If you request a trace, you can provide forward or reverse tracking based on the data stored in the DB.

도시한 바와 같이, 함수 추적은 함수 간의 호출 관계에 따라 추적을 하게 되며, 파일 A의 함수가 같은 파일 A 내에 존재하는 함수 2, 3만 호출하는 것이 아니라, 파일 B에 있는 함수 5까지 추적해서 분석할 수 있다. 마찬가지로, 역으로 파일 A의 함수 1을 호출하는 것은 같은 파일 A의 함수 7뿐만 아니라 파일 C의 함수 8이 호출하는 것도 알고 분석을 이어갈 수 있다. 이때, 정방향 추적의 알고리즘은 도 5 내지 도 6에 도시된 바와 같으며, 역방향 추적의 알고리즘은 도 7 내지 도 8에 도시된 바와 같다.As shown, function tracing is traced according to the call relationship between functions, and the function of file A does not call only functions 2 and 3 existing in the same file A, but also traces to function 5 in file B. can do. Similarly, calling function 1 of file A conversely knows that function 8 of file C, as well as function 7 of file A, can continue analysis. At this time, the algorithm of the forward tracking is as shown in Figs. 5 to 6, the algorithm of the backward tracking is as shown in Figs.

도 5 내지 도 6은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 정방향 분석을 설명하기 위한 도면이다.5 to 6 illustrate a forward analysis of an associated multi-file static analysis apparatus according to an embodiment of the present invention.

도 5 내지 도 6을 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 정방향 분석은 정추적 요청을 수신하는 경우 시작된다. 정추적은 향후 실행되는 방향으로 추적을 진행하는 것을 의미한다. 5-6, forward analysis of an associated multi-file static analysis device in accordance with one embodiment of the present invention begins upon receiving a request for tracing. Traceability means tracking in the direction of future execution.

먼저, 정추적이 요청되면(A) 추적 대상을 분석하여(B) 분기 명령이 있는지 판단하고(C), 분기 명령이 있다고 판단되면(Yes) 추적 대상이 존재하는지 판단하고(D), 추적 대상이 존재하면(Yes) 역추적 결과에 따라(E) 추적 완료(J) 또는 메모리 추적을 수행(I)할 수 있다. 또한, 추적 대상을 분석하여(B) 추적 대상이 존재하지 않으면(No) 다음 명령어를 확인하여 추적 대상 분석 과정(B)부터 다시 수행할 수 있다. 또한, 분기 명령이 없다고 판단되면(C_No) 다른 함수에게 영향을 주는지(F) 또는 다른 함수로부터 영향을 받는지(G)에 따라 추적 대상에 대응하는 레지스터명을 변경하여(H) 다음 명령어를 확인한 후 추적 대상 분석 과정(B)을 다시 수행하거나, 또는 Crash로 판단(J)할 수 있다. First, when tracking is requested (A), the tracking target is analyzed (B) to determine if there is a branch instruction (C), and if it is determined that there is a branch instruction (Yes) to determine whether a tracking target exists (D), and the tracking target If present (Yes), depending on the traceback result (E), the trace completion (J) or the memory trace can be performed (I). In addition, if the tracking target is analyzed (B) and the tracking target does not exist (No), the next command may be checked to perform the tracking target analysis process (B) again. If it is determined that there is no branch instruction (C_No), the register name corresponding to the tracking target is changed (H) depending on whether it is affected by another function (F) or by another function (G). The tracking target analysis process (B) may be performed again or may be determined as crash (J).

도 6의 구체적인 실시 예에서, 정추적이 요청되면 추적 대상 "LDR X2, [X8, #0x50]"을 분석하고, 추적 대상이 현재 인스트럭션이고, X8이며, 분기 명령은 'No', 영향을 주는지는 'Yes' 영향을 주는 레지스터는 X2이므로 추적 레지스터를 변경한다. 다음으로, 추적 대상 "MOV X0, X20"을 분석하고, 추적 대상은 현재 인스트럭션 X2이고, 분기 명령은 'No', 영향을 주는지는 'No', 영향을 받는가는 'No'이므로 다음 추적 대상을 분석한다. 이러한 과정을 거쳐, 정방향으로 추적을 수행하면, 마지막 인스트럭션 "MOV X2, #0x0"과 같이 레지스터 X2를 '0'으로 설정하는 경우면 분기 명령 'No', 영향을 주는가 'No', 영향을 받는가 'Yes'로 분석이 완료된다. 결과적으로, X8을 추적하였으나, X2에는 영향을 주되 프로그램에 큰 영향은 없는 것으로 추적은 완료된다. In the specific embodiment of FIG. 6, if tracking is requested, the tracking target "LDR X2, [X8, # 0x50]" is analyzed, and the tracking target is the current instruction, the X8, and the branch instruction is 'No'. The register that affects 'Yes' is X2, so change the trace register. Next, the trace targets "MOV X0, X20" are analyzed, the trace target is the current instruction X2, the branch instruction is 'No', the influence is 'No', the influence is 'No', and the next trace target is analyzed. do. Through this process, if the tracking is performed in the forward direction, if the register X2 is set to '0' as in the last instruction "MOV X2, # 0x0", is the branch instruction 'No', or 'No' affected? The analysis is completed with 'Yes'. As a result, X8 is traced, but the trace is complete as it affects X2 but does not significantly affect the program.

도 7 내지 도 8은 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 역방향 분석을 설명하기 위한 도면이다.7 to 8 illustrate reverse analysis of an associated multi-file static analysis apparatus according to an embodiment of the present invention.

도 7 내지 도 8을 참조하면, 본 발명의 일 실시예에 따른 연관된 다중 파일 정적 분석 장치의 역방향 분석은 역추적 요청을 수신하는 경우 시작된다. 역추적은 분석 대상으로부터 프로그램이 실행되어 왔던 역방향을 추적하는 것을 의미한다. 7 to 8, reverse analysis of an associated multi-file static analysis device according to an embodiment of the present invention begins upon receiving a backtracking request. Backtracking means tracking back the program from which the program was run.

역추적이 요청되면(A) 추적 대상을 확인하고(B), 추적 대상이 존재하는지 판단하고(C), 추적 대상이 존재하면(Yes) 다른 함수로부터 영향을 받는지(D)에 따라 레지스터명을 확인하는 단계(E)로 넘어가거나 또는 참조 주소를 확인(H)할 수 있다. 추적 대상이 존재하지 않으면(C_No) 참조 주소를 확인(H)할 수 있다. If a traceback is requested (A) to check the trace target (B), determine whether the trace target exists (C), and if the trace target exists (Yes), register the register name according to whether it is affected by another function (D). The verification step (E) or the reference address can be confirmed (H). If the trace target does not exist (C_No), the reference address may be confirmed (H).

다음으로, 참조 주소를 확인하여(H) 내부 주소인지(I) 외부 파일인지 판단하고(J), 참조 주소가 내부 주소(Yes) 또는 외부 파일인 경우(Yes), 추적 대상을 수정한 후(K) 추적 대상 확인 단계(B)부터 다시 수행한다. 또한, 참조 주소가 내부 주소도 아니고(No) 외부 파일도 아닌 경우(N), Crash로 판단할 수 있다(L). Next, check the reference address (H) to determine whether it is an internal address (I) or an external file (J), and if the reference address is an internal address (Yes) or an external file (Yes), then modify the tracking target ( K) Perform again from the tracking target confirmation step (B). In addition, when the reference address is neither an internal address (No) nor an external file (N), it may be determined as a crash (L).

레지스터명을 확인하여(E), 레지스터명이 존재하면(Yes) 명령어에 따른 추적 대상을 추가 또는 변경하고(F), 레지스터명이 존재하지 않으면(No) 메모리 추적을 수행할 수 있다(G).By checking the register name (E), if the register name exists (Yes), the trace target according to the instruction can be added or changed (F), and if the register name does not exist (No), memory tracing can be performed (G).

도 8의 구체적인 실시 예에서, 역추적이 요청되면 추적 결과를 아래부터 위로 확인해야 하고, 가장 아래 라인을 보면 추적 대상은 이전 인스트럭션 X8이고, 상위 라인을 분석하면, 추적 대상은 현재 인스트럭션 X8이고, 추적 대상이 존재하고(Yes), 영향을 받는 함수가 있고(Yes), 레지스터가 존재하고(Yes), 추적 대상은 이전 인스트럭션 X20임을 확인할 수 있다. 이러한 방법으로, 역방향 추적을 수행할 수 있다. In the specific embodiment of FIG. 8, when the traceback is requested, the tracking result should be checked from the bottom up. When the bottom line is viewed, the tracking target is the previous instruction X8. When the upper line is analyzed, the tracking target is the current instruction X8. We can see that the trace target exists (Yes), the function affected (Yes), the register exists (Yes), and the trace target is the previous instruction X20. In this way, backward tracking can be performed.

여기서, 이전 인스트럭션에서 X19와 같은 레지스터를 추적하는 경우, 도 8의 과정으로 추적된다. 이전 인스트럭션 X19값+0x5C0를 추적하는 경우, 해당 값은 특정 주소이므로 레지스터명으로부터 온 것이 아니기 때문에 역추적을 종료하고 메모리 추적을 진행하게 된다. Here, in the case of tracing a register such as X19 in the previous instruction, the tracing is performed in the process of FIG. 8. If the previous instruction X19 value + 0x5C0 is traced, the value is a specific address, so it is not from the register name, so the traceback ends and the memory trace proceeds.

추적이 완료된 경우, X8을 추적한 결과 X8에 영향을 준 것은 X1으로 결정되고 추적은 완료된다. 결과적으로, 추적 대상 레지스터 X8을 중심으로 정추적과 역추적을 진행하게 된다. If the trace is complete, tracing X8 determines that X1 affected X8 and tracing is complete. As a result, forward and backtracking is performed around the trace target register X8.

따라서, 본 발명에 의하면, 기계어 수준에서도 서로 연관된 다중 파일의 함수의 흐름을 자동으로 표시하여 정적 분석이 가능하도록 제공하므로 연관된 파일들 사이의 정적 분석도 용이하게 수행할 수 있다.Therefore, according to the present invention, since the flow of functions of multiple files associated with each other is automatically displayed at the machine language level, the static analysis can be easily performed.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 사람이라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely illustrative of the technical idea of the present invention, and those skilled in the art to which the present invention pertains may make various modifications and changes without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are not intended to limit the technical idea of the present invention but to describe the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The protection scope of the present invention should be interpreted by the following claims, and all technical ideas within the equivalent scope should be interpreted as being included in the scope of the present invention.

100: 연관된 다중 파일 정적 분석 장치 110: 데이터베이스
120: 어셈블리 코드 추출부 130: 정적 분석부
140: 전처리부
100: associated multi-file static analysis device 110: database
120: assembly code extraction unit 130: static analysis unit
140: preprocessing unit

Claims (12)

디스어셈블된 바이너리의 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보, 추적 정보, 추적 상태 및 인스트럭션에 대응하는 레지스터명을 저장하는 데이터베이스;
분석 대상 바이너리가 입력되면 바이너리의 특성을 분석하여 대응되는 복수의 파일 및 복수의 함수 목록을 표시하고, 상기 표시된 복수의 함수 목록 중 제1 함수가 선택되면, 상기 제1 함수의 정방향 또는 역방향 콜체인을 표시하고, 상기 제1 함수, 상기 제1 함수의 정방향 함수인 제2 함수 또는 상기 제1 함수의 역방향 함수인 제3 함수의 어셈블리 코드를 표시하고, 상기 제1 함수의 선택이 해지되고 상기 제2 함수가 선택되면 상기 제1 함수, 상기 제2 함수, 상기 제3 함수의 어셈블리 코드 표시를 해제하고, 상기 제2 함수, 상기 제2 함수의 정방향 함수인 제4 함수 또는 역방향 함수인 제5 함수의 어셈블리 코드를 표시하는 어셈블리 코드 추출부; 및
상기 어셈블리 코드 추출부에서 상기 제1 함수 내지 제5 함수 중 하나에 대응하는 레지스터명의 추적을 요청하는 경우, 상기 데이터베이스를 통해 상기 레지스터명에 대응되는 레지스터 정보를 추출하여 상기 어셈블리 코드 추출부로 제공하는 정적 분석부;
를 포함하는 연관된 다중 파일 정적 분석 장치.
A database that stores a register name corresponding to a program name, a function name, assembly code, branch information, trace information, trace state, and an instruction of the disassembled binary;
When the binary to be analyzed is input, the characteristics of the binary are analyzed to display a list of corresponding files and a plurality of functions. When a first function is selected from the displayed list of functions, the forward or reverse call chain of the first function is selected. Display an assembly code of the first function, a second function that is a forward function of the first function, or a third function that is a reverse function of the first function, and the selection of the first function is terminated and When the second function is selected, the display of the assembly code of the first function, the second function, and the third function is canceled, and the fifth function is a fourth function or a reverse function which is a forward function of the second function and the second function. An assembly code extracting unit to display an assembly code of the assembly; And
When the assembly code extracting unit requests tracking of a register name corresponding to one of the first to fifth functions, static information is provided to the assembly code extracting unit by extracting register information corresponding to the register name through the database. An analysis unit;
Associated multi-file static analysis device comprising a.
제1항에 있어서,
상기 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보 및 레지스터명을 생성하는 전처리부;를 더 포함하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 1,
And a preprocessor for generating a program name, a function name, an assembly code, branch information, and a register name corresponding to each of the plurality of files.
제1항에 있어서,
상기 정적 분석 장치는, 클라이언트 장치와 연결되고,
상기 클라이언트 장치는, 상기 복수의 파일 각각에 대응하는 프로그램 이름, 함수의 이름, 어셈블리 코드, 분기 정보 및 레지스터명을 생성하여 상기 정적 분석 장치로 전달하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 1,
The static analysis device is connected with the client device,
And the client device generates and passes a program name, function name, assembly code, branch information, and register name corresponding to each of the plurality of files to the static analysis device.
제1항에 있어서,
상기 정적 분석부는, 특정 레지스터명이 추적 대상으로 선택되면 상기 추적 대상의 추적 정보와 추적 상태를 상기 데이터베이스에 저장한 후 추적을 시작하며,
상기 추적 정보는 추적 대상의 함수 정보, 코드라인 정보, 레지스터, 추적 형태, 코드 및 추적 체인에 대한 정보를 포함하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 1,
The static analysis unit, when a specific register name is selected as a tracking target, starts tracking after storing the tracking information and the tracking status of the tracking target in the database.
And the tracing information comprises information about tracing function information, codeline information, registers, tracing forms, code and tracing chains.
제4항에 있어서,
상기 정적 분석부는, 정추적이 요청되면 인스트럭션 단위로 추적 대상을 분석하여 분기 명령이 있는지 판단하고, 분기 명령이 있다고 판단되면 상기 레지스터명에 대응되는 추적 대상이 존재하는지 판단하고, 추적 대상이 존재하면 역추적 결과에 따라 추적 완료 또는 메모리 추적을 수행하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 4, wherein
When static tracking is requested, the static analysis unit analyzes a tracking target on an instruction basis to determine whether there is a branch instruction, and if there is a branch instruction, determines whether a tracking target corresponding to the register name exists, and if a tracking target exists. An associated multi-file static analysis device that performs trace completion or memory trace based on the traceback results.
제5항에 있어서,
상기 정적 분석부는, 상기 추적 대상이 존재하지 않으면 다음 명령어를 확인하여 상기 추적 대상 분석 과정부터 다시 수행하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 5,
The static analysis unit, if the trace object does not exist, checks the next command to perform again from the trace object analysis process, associated multi-file static analysis device.
제5항에 있어서,
상기 정적 분석부는, 상기 분기 명령이 없다고 판단되면 다른 함수에게 영향을 주는지 또는 다른 함수로부터 영향을 받는지에 따라 추적 대상에 대응하는 상기 레지스터명을 변경하여 다음 명령어를 확인한 후 상기 추적 대상 분석 과정을 다시 수행하거나, 또는 추적을 완료하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 5,
If it is determined that the branch instruction does not exist, the static analysis unit changes the register name corresponding to the trace object according to whether it affects another function or is affected by the other function, checks the next instruction, and then repeats the trace object analysis process. An associated multi-file static analysis device that performs or completes a trace.
제4항에 있어서,
상기 정적 분석부는, 역추적이 요청되면 인스트럭션 단위로 추적 대상을 확인하고, 상기 레지스터명에 대응되는 추적 대상이 존재하는지 판단하고, 추적 대상이 존재하면 다른 함수로부터 영향을 받는지에 따라 레지스터명을 확인하는 단계로 넘어가거나 또는 인스트럭션을 해석하기 위한 참조 주소를 확인하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 4, wherein
When the traceback is requested, the tracer checks a trace target in units of instructions, determines whether a trace target corresponding to the register name exists, and if the trace target exists, checks a register name according to whether it is affected by another function. Associated multi-file static analysis device that proceeds to a step or identifies a reference address for resolving the instruction.
제8항에 있어서,
상기 정적 분석부는, 상기 추적 대상이 존재하지 않으면 참조 주소를 확인하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 8,
The static analysis unit is associated with the multi-file static analysis device, if the tracking target does not exist.
제9항에 있어서,
상기 정적 분석부는, 상기 참조 주소를 확인하여 내부 주소인지 외부 파일인지 판단하고, 상기 참조 주소가 내부 주소 또는 외부 파일인 경우, 추적 대상을 수정한 후 상기 추적 대상 확인 단계부터 다시 수행하고, 상기 참조 주소가 내부 주소도 아니고 외부 파일도 아닌 경우, 추적을 완료하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 9,
The static analyzer determines whether the reference address is an internal address or an external file by checking the reference address. When the reference address is an internal address or an external file, the static analysis unit corrects the tracking target and then performs the tracking target confirmation step again. Associated multi-file static resolution device that completes tracing if the address is neither an internal address nor an external file.
제8항에 있어서,
상기 정적 분석부는, 상기 레지스터명을 확인하여, 상기 레지스터명이 존재하면 명령어에 따른 추적 대상을 추가 또는 변경하고, 상기 레지스터명이 존재하지 않으면 메모리 추적을 수행하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 8,
And the static analyzer checks the register name, adds or changes a trace object according to an instruction if the register name exists, and performs memory tracking if the register name does not exist.
제1항에 있어서,
상기 어셈블리 코드 추출부는, 상기 복수의 함수 목록 중 특정 함수의 정방향 또는 역방향 콜체인을 표시하고, 상기 콜체인에 포함된 다른 파일의 함수를 선택한 경우, 상기 정적 분석부에서 상기 선택된 다른 파일의 함수를 호출하여 표시하는 방법으로 연관된 다중 파일의 실행 흐름을 분석하는, 연관된 다중 파일 정적 분석 장치.
The method of claim 1,
The assembly code extracting unit displays a forward or reverse call chain of a specific function among the plurality of function lists, and selects a function of the other file selected by the static analysis unit when selecting a function of another file included in the call chain. An associated multi-file static analysis device that analyzes the flow of execution of the associated multiple files by calling and displaying them.
KR1020180043918A 2017-05-26 2018-04-16 Apparatus for statically analyzing assembly code including assoxiated multi files KR102013657B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020170065636 2017-05-26
KR20170065636 2017-05-26

Publications (2)

Publication Number Publication Date
KR20180129623A KR20180129623A (en) 2018-12-05
KR102013657B1 true KR102013657B1 (en) 2019-08-23

Family

ID=64743835

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180043918A KR102013657B1 (en) 2017-05-26 2018-04-16 Apparatus for statically analyzing assembly code including assoxiated multi files

Country Status (1)

Country Link
KR (1) KR102013657B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220122149A (en) * 2021-02-26 2022-09-02 고려대학교 산학협력단 Apparatus and method for analysing promgram

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032394B (en) * 2019-04-12 2022-05-31 深圳市腾讯信息技术有限公司 Analysis method and device for passive code file and storage medium
CN116501378B (en) * 2023-06-27 2023-09-12 武汉大数据产业发展有限公司 Implementation method and device for reverse engineering reduction source code and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006277206A (en) 2005-03-29 2006-10-12 Nec Corp Source analysis support method and device, and source analysis support program
JP2008293486A (en) 2007-04-25 2008-12-04 Hitachi Ltd Source code analysis device, analysis program, and analysis method
JP2016224579A (en) 2015-05-28 2016-12-28 スタビリティ株式会社 Information processor and information processing method
US9754112B1 (en) 2014-11-24 2017-09-05 Bluerisc, Inc. Detection and healing of vulnerabilities in computer code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006277206A (en) 2005-03-29 2006-10-12 Nec Corp Source analysis support method and device, and source analysis support program
JP2008293486A (en) 2007-04-25 2008-12-04 Hitachi Ltd Source code analysis device, analysis program, and analysis method
US9754112B1 (en) 2014-11-24 2017-09-05 Bluerisc, Inc. Detection and healing of vulnerabilities in computer code
JP2016224579A (en) 2015-05-28 2016-12-28 スタビリティ株式会社 Information processor and information processing method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220122149A (en) * 2021-02-26 2022-09-02 고려대학교 산학협력단 Apparatus and method for analysing promgram
KR102491925B1 (en) * 2021-02-26 2023-01-26 고려대학교 산학협력단 Apparatus and method for analysing promgram

Also Published As

Publication number Publication date
KR20180129623A (en) 2018-12-05

Similar Documents

Publication Publication Date Title
CN110287702B (en) Binary vulnerability clone detection method and device
US8904352B2 (en) Systems and methods for processing source code during debugging operations
US20130007711A1 (en) Unified model for visual component testing
KR102013657B1 (en) Apparatus for statically analyzing assembly code including assoxiated multi files
CN111104335B (en) C language defect detection method and device based on multi-level analysis
US9389852B2 (en) Technique for plagiarism detection in program source code files based on design pattern
CN110474900B (en) Game protocol testing method and device
US9645911B2 (en) System and method for debugging firmware/software by generating trace data
US9965252B2 (en) Method and system for generating stateflow models from software requirements
CN103559123A (en) Function call stack analyzing method and device based on VxWorks operation system
CN104021072A (en) Machine and methods for evaluating failing software programs
US9703683B2 (en) Software testing coverage
CN106021101A (en) Method and device for testing mobile terminal
CN106055343B (en) A kind of object code reverse-engineering system based on program evolution model
US10241957B2 (en) Workload patterns for realistic load recreation in performance testing
US9563541B2 (en) Software defect detection identifying location of diverging paths
JP6310527B1 (en) Object analysis apparatus, object analysis method, and program
US8683494B1 (en) Constructing event sequences in event-driven programs
CN106709335B (en) Vulnerability detection method and device
CN107783867B (en) Gesture testing method and device, computer equipment and storage medium
CN109783837A (en) Emulator, analogue system, emulation mode and simulated program
CN115422865B (en) Simulation method and device, computing equipment and computer readable storage medium
CN108132799B (en) Inter-process static program analysis information extraction method, device and equipment
US10984003B2 (en) Report generation for a digital task
CN107291617B (en) Vulnerability analysis method based on implicit taint propagation

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant