KR100927974B1 - Source code generation system of executable image and its method - Google Patents
Source code generation system of executable image and its method Download PDFInfo
- Publication number
- KR100927974B1 KR100927974B1 KR1020070101463A KR20070101463A KR100927974B1 KR 100927974 B1 KR100927974 B1 KR 100927974B1 KR 1020070101463 A KR1020070101463 A KR 1020070101463A KR 20070101463 A KR20070101463 A KR 20070101463A KR 100927974 B1 KR100927974 B1 KR 100927974B1
- Authority
- KR
- South Korea
- Prior art keywords
- address
- loaded
- memory
- file
- image
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/06—Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
- G06F12/0646—Configuration or reconfiguration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
- G06F16/152—File search processing using file content signatures, e.g. hash values
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
본 발명은 실행 이미지의 원본 코드 생성 시스템을 개시한다. 즉, 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지에 대해 맵핑된 파일을 검색하는 파일 검색 모듈; 상기 검색된 파일의 헤더(Header) 정보를 분석하는 정보 분석 모듈; 및 상기 분석된 헤더 정보를 토대로 상기 검색된 파일의 실행 이미지를 상기 메모리 상의 별도의 주소인 제 2 주소에 로딩하며, 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 상기 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시키는 영역 할당 모듈;을 포함함으로써, 실행 이미지의 재배치(location) 여부에 상관없이 어떠한 실행 이미지에 대해서도 변조되지 않은 원본 코드를 만들어 낼 수 있으므로 악성 프로그램에 의해 변조된 코드들을 찾아내거나 변조 이전의 코드로 복원하는데 사용될 수 있다.The present invention discloses an original code generation system of an executable image. That is, a file retrieval module for retrieving a file mapped to an execution image loaded at a first address on a memory; An information analysis module for analyzing header information of the retrieved file; And loading the execution image of the searched file into a second address, which is a separate address in the memory, based on the analyzed header information, and among the plurality of sections included in the specific file when loading the execution image of the specific file into the memory. The relocation target section includes a code section on an execution image loaded at the second address, based on an area allocation information table that specifies a relocation target section that is mapped based on an actually loaded address. By including a region allocation module for mapping by reference, it is possible to generate the original code unmodified for any executable image, regardless of the location of the execution image location to find the code modulated by malicious programs or before Can be used to restore the code of.
Description
본 발명은 실행 이미지의 원본 코드 생성 시스템 및 그 방법에 관한 것으로, 더욱 상세하게는, 메모리에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 섹션의 속성에 따라, 메모리의 특정 주소를 기준으로 재배치(Relocation)시켜 변조된 실행 이미지의 코드 부분을 변조 이전의 원본 실행 코드로 전환하기 위한 실행 이미지의 원본 코드 생성 시스템 및 그 방법에 관한 것이다.The present invention relates to a system for generating an original image of an executable image and a method thereof, and more particularly, to a relocation target section including a code section on an executable image loaded in a memory, according to attributes of a section, A source code generation system and method for executing an image for relocation based on an address to convert a code portion of a modulated executable image into original executable code before modulation.
일반적으로, 메모리 상에서의 실행 이미지 코드에 대한 변조 행위는 많은 경우 후킹(Hooking)이라는 행위로 일어나게 되며, 일부 해킹 툴(Hacking Tool)에서는 실행 이미지의 원래 동작과 다른 동작을 만들어 내기 위해 임의로 특정 코드를 수정함에 따라 발생된다.In general, tampering with executable image code in memory occurs in many cases as hooking, and some hacking tools use arbitrary code to randomly generate different behavior than the original behavior of the executable image. Occurs upon modification.
이러한 변조 행위는 실행 이미지가 실제 수행하려는 동작을 불가능하게 함으로써, 많은 보안상의 문제를 유발시키게 된다. 예컨대, 악성 프로그램의 경우 특정 실행 이미지에 대한 후킹(Hooking)을 통해 자신을 찾지 못하도록 하는 루트 킷(Rootkit)을 형성시킴으로써 실행 이미지에 대한 지속적인 오동작을 유발시킬 수 있다. 또한, 인증과 관련한 코드 부분을 수정함으로써 접속 권한이 없는 사용자가 인증절차를 거치지 않더라도 해당 프로그램을 사용할 수 있도록 하는 크랙(Crack)에 적용될 수 있다.This tampering behavior causes many security problems by making the executable image impossible to perform. For example, a malicious program can cause a continuous malfunction of an executable image by forming a rootkit that prevents itself from being found by hooking a specific executable image. In addition, by modifying the code part related to authentication, it can be applied to a crack that allows a user without access authority to use the corresponding program even if the user does not go through the authentication procedure.
특히, 온라인 게임에서는 게임 실행 이미지의 특정 코드를 변조하거나 일부 모듈을 후킹하여 정상적인 경우보다 훨씬 유리하게 동작하도록 함으로써 게임의 형평성을 무너뜨리는데 많이 사용되고 있는 실정이다.In particular, in online games, a certain code of a game execution image is tampered with, or some modules are hooked so that they operate much more advantageously than normal.
이와 관련하여, 상술한 바와 같은 실행 이미지의 코드 변조에 대한 기존의 방어법으로 파일에서 코드 데이터를 읽어 들여 변경된 코드를 감지 및 복원시켜 주는 방법 및 원본 코드에 대한 시그니처(Signature) 정보를 이용하여 주기적으로 메모리에 로딩된 코드에 대해 시그니처 정보를 비교함으로써, 변경된 코드를 감지하는 방법 등이 제안되고 있다.In this regard, as a conventional defense against code tampering of the execution image as described above, the code data is read from the file to detect and restore the changed code and the signature information on the original code is periodically used. A method of detecting changed code by comparing signature information with code loaded in a memory has been proposed.
그러나, 상기 코드 변조에 대한 기존의 방어법의 경우, 파일에서 원본을 그대로 복사하기 때문에 해당 모듈이 재배치(Relocation)되면 감지 및 복원이 불가하며 더욱이, 복원이 이루어졌다 하더라도 악성 코드가 동일한 코드에 대해 반복해서 재후킹하거나 재변조할 수 있다는 문제점을 가지고 있다.However, in the case of the existing defense against code tampering, since the original copy is copied from the file, detection and restoration are impossible when the module is relocated. Moreover, even if the restoration is made, the malicious code repeats the same code. There is a problem that can be rehooked or remodulated.
본 발명은 상기한 바와 같이 선행 기술에 내재되었던 문제점을 해결하기 위해 창작된 것으로, 본 발명의 목적은, 메모리 상에서 실행 이미지의 코드가 후킹이나 변조될 경우 재배치(Relocation)가 발생하는 실행 이미지에 대해서도 변조된 코드를 찾거나 복구시켜주고 재후킹이나 재변조에 영향을 받지 않는 실행 가능한 원본 코드를 만들어 내는 실행 이미지의 원본 코드 생성 시스템 및 그 방법을 제공함에 있다. The present invention was created to solve the problems inherent in the prior art as described above, and an object of the present invention is to provide an execution image in which relocation occurs when a code of an execution image is hooked or modulated in memory. The present invention provides a system and method for generating an original image of an executable image that finds and recovers a modified code, and generates an executable original code that is not affected by rehooking or remodulation.
상술한 목적을 달성하기 위한 본 발명의 일면에 따라, 실행 이미지의 원본 코드 생성 시스템이 제공되며: 이 시스템은, 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지에 대해 맵핑된 파일을 검색하는 파일 검색 모듈; 상기 검색된 파일의 헤더(Header) 정보를 분석하는 정보 분석 모듈; 및 상기 분석된 헤더 정보를 토대로 상기 검색된 파일의 실행 이미지를 상기 메모리 상의 별도의 주소인 제 2 주소에 로딩하며, 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 상기 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시키는 영역 할당 모듈;을 포함하는 것을 특징으로 한다.In accordance with an aspect of the present invention for achieving the above object, there is provided a system for generating an original code of an executable image: the system retrieves a file mapped to an executable image loaded at a first address in memory. A file search module; An information analysis module for analyzing header information of the retrieved file; And loading the execution image of the searched file into a second address, which is a separate address in the memory, based on the analyzed header information, and among the plurality of sections included in the specific file when loading the execution image of the specific file into the memory. The relocation target section includes a code section on an execution image loaded at the second address, based on an area allocation information table that specifies a relocation target section that is mapped based on an actually loaded address. And an area allocation module that maps to a reference.
바람직하게는, 상기 영역 할당 모듈은, 상기 메모리의 제 2 주소에 로딩된 상기 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 상기 제 2 주소를 기준으로 상기 재배치 대상 섹션을 맵핑시키는 것을 특징으로 한다.Preferably, when the relocation target section loaded to the second address of the memory has an Execute attribute, the area allocation module maps the relocation target section based on the second address. do.
바람직하게는, 상기 영역 할당 모듈은, 상기 메모리의 제 2 주소에 로딩된 실행 이미지와 상기 제 1 주소에 로딩된 실행 이미지를 비교하여, 상기 제 1 주소 및 제 2 주소에 로딩된 실행 이미지상의 특정 섹션이 상이할 경우, 상기 제 1 주소에 로딩된 상이한 섹션을 상기 제 2 주소에 로딩된 섹션으로 대체하는 것을 특징으로 한다.Advantageously, the area allocation module compares the execution image loaded at the second address of the memory with the execution image loaded at the first address, thereby specifying a particular on the execution image loaded at the first address and the second address. If the sections are different, the different sections loaded at the first address are replaced with the sections loaded at the second address.
본 발명의 다른 일면에 따라, 실행 이미지의 원본 코드 생성 시스템이 제공되며: 이 시스템은, 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지를 메모리 상의 별도의 주소인 제 2 주소에 복사하는 이미지 복사 모듈; 상기 메모리 상의 제 2 주소에 복사된 상기 실행 이미지에 대해 맵핑된 파일을 검색하는 파일 검색 모듈; 상기 검색된 파일의 헤더(Header) 정보를 분석하는 정보 분석 모듈; 및 상기 분석된 헤더 정보를 토대로 상기 제 2 주소에 복사된 실행 이미지에 포함된 특정 섹션을 로딩하여 오버랩(Overlap)시키며, 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 복사되어 특정 섹션이 오버랩된 상기 실행 이미지상의 다수의 섹션 중 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시키는 영역 할당 모듈;을 포함하는 것을 특징으로 한다.According to another aspect of the present invention, a system for generating an original code of an execution image is provided: The system copies an execution image loaded at a first address in a memory to a second address, which is a separate address in a memory. An image copy module; A file retrieval module for retrieving a file mapped to the execution image copied to a second address on the memory; An information analysis module for analyzing header information of the retrieved file; And overlapping by loading a specific section included in the execution image copied to the second address based on the analyzed header information, and when the execution image of the specific file is loaded into the memory, a plurality of sections included in the specific file. Wherein the relocation target section is selected from among a plurality of sections on the execution image copied to the second address and overlapping a specific section, based on an area allocation information table that specifies a relocation target section mapped based on an actually loaded address. And an area allocation module for mapping based on one address.
바람직하게는, 상기 영역 할당 모듈은, 상기 메모리의 제 2 주소에 로딩된 상기 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 상기 제 2 주소를 기준으로 상기 재배치 대상 섹션을 맵핑시키는 것을 특징으로 한다.Preferably, when the relocation target section loaded to the second address of the memory has an Execute attribute, the area allocation module maps the relocation target section based on the second address. do.
본 발명의 다른 일면에 따라, 실행 이미지의 원본 코드 생성 방법이 제공되며: 이 방법은, a) 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지에 대해 맵핑된 파일을 검색하는 단계; b) 정보 분석 모듈이 상기 검색된 파일의 헤더(Header) 정보를 분석하는 단계; 및 c) 상기 분석된 헤더 정보를 토대로 상기 검색된 파일의 실행 이미지를 상기 메모리 상의 별도의 주소인 제 2 주소에 로딩하는 단계;를 포함하는 것을 특징으로 한다.According to another aspect of the present invention, a method of generating an original code of an executable image is provided, the method comprising: a) retrieving a file mapped to an executable image loaded at a first address on a memory; b) analyzing, by the information analysis module, header information of the retrieved file; And c) loading an execution image of the retrieved file into a second address, which is a separate address in the memory, based on the analyzed header information.
바람직하게는, 상기 c) 단계는, 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 상기 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시키는 것을 특징으로 한다.Preferably, the step c) is a region allocation information table for specifying a relocation target section that is mapped based on the actual loading address of a plurality of sections included in the specific file when loading the execution image of the specific file into the memory Based on the above, the relocation target section including a code section on the execution image loaded at the second address may be mapped based on the first address.
바람직하게는, 상기 c) 단계는, 상기 메모리의 제 2 주소에 로딩된 상기 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 상기 제 2 주소를 기준으로 상기 재배치 대상 섹션을 맵핑시키는 것을 특징으로 한다.Preferably, in step c), when the relocation target section loaded to the second address of the memory has an Execute attribute, the relocation target section is mapped based on the second address. do.
바람직하게는, 상기 방법은, d) 상기 메모리의 제 2 주소에 로딩된 실행 이미지와 상기 제 1 주소에 로딩된 실행 이미지를 비교하는 단계; 및 e) 상기 비교 결과, 상기 제 1 주소 및 제 2 주소에 로딩된 실행 이미지상의 특정 섹션이 상이할 경우, 상기 제 1 주소에 로딩된 상기 상이한 섹션을 상기 제 2 주소에 로딩된 섹션으로 대체하는 단계;를 더 포함하는 것을 특징으로 한다.Advantageously, the method further comprises: d) comparing an execution image loaded at a second address of said memory with an execution image loaded at said first address; And e) if the particular section on the execution image loaded at the first address and the second address is different as a result of the comparison, replacing the different section loaded at the first address with the section loaded at the second address. Step; characterized in that it further comprises.
본 발명의 또 다른 일면에 따라, 실행 이미지의 원본 코드 생성 방법이 제공되며: 이 방법은, a) 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지를 별도의 주소인 제 2 주소에 복사하는 단계; b) 상기 메모리 상의 제 2 주소에 복사된 상기 실행 이미지에 대해 맵핑된 파일을 검색하는 단계; c) 정보 분석 모듈이 상기 검색된 파일의 헤더(Header) 정보를 분석하는 단계; 및 d) 상기 분석된 헤더 정보를 토대로 상기 제 2 주소에 로딩된 이미지 파일에 포함된 특정 섹션을 새롭게 로딩하여 오버랩(Overlap)시키는 단계;를 포함하는 것을 특징으로 한다.According to yet another aspect of the present invention, there is provided a method of generating an original image of an executable image, which method comprises: a) copying an executable image loaded at a first address in memory to a second address, which is a separate address; Making; b) retrieving a mapped file for the executable image copied to a second address on the memory; c) analyzing, by the information analysis module, header information of the retrieved file; And d) newly loading and overlapping a specific section included in the image file loaded at the second address based on the analyzed header information.
바람직하게는, 상기 d) 단계는, 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 복사되어 특정 섹션이 오버랩된 상기 실행 이미지상의 다수의 섹션 중 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시키는 것을 특징으로 한다.Preferably, the step d) is a region allocation information table for specifying the relocation target section that is mapped based on the actual loading address of the plurality of sections included in the specific file when loading the execution image of the specific file into the memory Based on the first address, the retargeting section among the plurality of sections on the execution image copied to the second address and overlapping a specific section.
바람직하게는, 상기 d) 단계는, 상기 메모리의 제 2 주소에 로딩된 상기 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 상기 제 2 주소를 기준으로 상기 재배치 대상 섹션을 맵핑시키는 것을 특징으로 한다.Preferably, the step d), if the relocation target section loaded to the second address of the memory has an Execute attribute, characterized in that for mapping the relocation target section based on the second address. do.
본 발명에 따른 실행 이미지의 원본 코드 생성 시스템 및 그 방법은, 실행 이미지의 재배치(Relocation) 여부에 상관없이 어떠한 실행 이미지에 대해서도 변 조되지 않은 원본 코드를 만들어 낼 수 있으므로 악성 프로그램에 의해 변조된 코드들을 찾아내거나 변조 이전의 코드로 복원하는데 사용될 수 있다.The original code generation system of the execution image and the method thereof according to the present invention can generate an unmodified original code for any execution image regardless of whether or not the execution image is relocated. Can be used to find them or restore them to code prior to modulation.
또한 악성 프로그램에 의한 재후킹이나 재변조에 영향을 받지 않으면서 이미 사용되고 있던 데이터를 공유하면서 코드 독립적인 실행 가능한 원본 코드를 만들어 낼 수 있으므로 프로그램이 동작중에 프로그램 실행에 전혀 영향을 주지 않으면서 후킹(Hooking)이나 변조에 영향을 받지 않는 원래의 목적 그대로의 안전한 작업 수행을 보장할 수 있다.Also, it is possible to create original code independent executable code while sharing the data already used without being affected by re-hooking or re-modulation by malicious program. It can guarantee the safe operation of its original purpose without being affected by hooking or tampering.
이하에서는 첨부한 도면을 참조하여 본 발명의 바람직한 실시예를 상술하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1에는 본 발명의 제 1 실시예에 따른 실행 이미지의 원본 코드 생성 시스템의 개략적인 구성도를 도시한다.1 shows a schematic configuration diagram of a system for generating an original code of an execution image according to a first embodiment of the present invention.
도 1에 도시한 바와 같이, 상기 시스템은 메모리 상에 로딩된 실행 이미지의 특정 코드가 변조되어 있다는 가정하에 상기 메모리에 로딩된 실행 이미지에 대해 맵핑된 파일(File)을 검색하기 위한 파일 검색 모듈(100); 검색된 파일의 헤더(Header) 정보를 분석하기 위한 정보 분석 모듈(200); 메모리에 로딩된 실행 이미지를 기존 주소와는 별도의 주소에 새롭게 로딩하며, 영역 할당 정보 테이블을 참조하여, 새롭게 로딩된 실행 이미지의 특정 섹션을 소정의 메모리 주소를 기준으로 재배치시키기 위한 영역 할당 모듈(300);을 포함하는 구성을 갖는다. 여기서, 영역 할당 정보 테이블은 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 정보를 저장하고 있다.As shown in FIG. 1, the system is provided with a file retrieval module for retrieving a file mapped to an executable image loaded in the memory on the assumption that a specific code of the executable image loaded on the memory is modulated. 100); An
상기 파일 검색 모듈(100)은 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지에 대해 맵핑된 파일을 검색한다. 여기서, 메모리 상의 제 1 주소에 로딩되어 있는 실행 이미지 또한 메모리에 로딩시, 상술한 할당 정보 테이블을 참조하여, 메모리 상의 실제 로딩되는 주소인 상기 제 1 주소를 기준으로 다수의 섹션이 맵핑되어 있다.The
상기 정보 분석 모듈(200)은 파일 검색 모듈(100)을 통해 검색된 파일의 헤더 정보를 분석하여 실제 로딩되는 실행 이미지에 포함되는 다수의 섹션 정보를 파악한다.The
상기 영역 할당 모듈(300)은 정보 분석 모듈(200)을 통해 분석된 헤더 정보를 토대로, 메모리 상의 이전의 실행 이미지가 로딩되었던 제 1 주소와는 별도의 주소인 제 2 주소에 상기 파일 검색 모듈(100)을 통해 검색된 파일에 대한 실행 이미지를 새롭게 로딩한다.The
이때, 영역 할당 모듈(300)은 상술한 바와 같은 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 상기 제 1 주소를 기준으로 재배치(Relocation)시킨다. 참고로, 영역 할당 모듈(300)의 재배치 동작은, 실행 이미지를 제작할 당시 실행 이미지가 메모리에 로딩될 경우, 어는 영역에 로딩되는지를 알지 못함에 따라, 제작 당시에는 임의의 값으로 설정하고, 변경해야 하는 대상들을 영역 할당 정보 테이블로 저장한 후, 실제 사용되기 위해 메모리로 로딩시 상기 영역 할당 정보 테이블을 참고하여 실제 로딩되는 주소를 기준으로 변경시켜주는 과정을 지칭한다.At this time, the
보다 구체적으로, 영역 할당 모듈(300)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 상기 영역 할당 정보 테이블을 참고하여 새롭게 할당된 메모리 주소인 제 2 주소가 아닌 이전에 로딩되어 있던 메모리 주소인 제 1 주소를 기준으로 맵핑시켜 이전에 제 1 주소에 로딩된 효과를 갖도록 함에 따라, 변조되기 전의 실행 이미지를 얻게 된다. 여기서, 상기 재배치 대상 섹션은 섹션 단위로 설정 가능하며, 바람직하게는 하나의 섹션에 포함된 일부 코드에 대한 대상 지정 또한 가능하다.More specifically, the
아울러, 영역 할당 모듈(300)은 상기 메모리의 제 2 주소에 로딩된 실행 이미지와 상기 제 1 주소에 로딩된 실행 이미지를 비교하여, 상기 제 1 주소 및 제 2 주소에 로딩된 실행 이미지상의 특정 섹션이 상이할 경우, 상기 제 1 주소에 로딩된 상이한 섹션을 상기 제 2 주소에 로딩된 섹션으로 대체하는 구성 또한 가능하다.In addition, the
한편, 영역 할당 모듈(300)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 새롭게 할당된 제 2 주소를 기준으로 재배치시킨다. 이때, 재배치 대상 섹션이 데이터 속성과 같이 실행 속성을 갖지 않을 경우, 메모리의 상기 제 1 주소를 기준으로 재배치시킴으로써, 기존에 메모리 상의 제 1 주소에서 사용되던 데이터는 공유하도록 구성한다.Meanwhile, when the relocation target section including the code section has an execute attribute, the
이하, 도 2를 참조하여 본 발명의 제 1 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기로 한다. 여기서, 도 2는 본 발명의 제 1 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기 위한 개략적인 순서도이다.Hereinafter, a method of generating original code of an execution image according to a first embodiment of the present invention will be described with reference to FIG. 2. 2 is a schematic flowchart illustrating a method of generating original code of an execution image according to a first embodiment of the present invention.
먼저, 파일 검색 모듈(100)이 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지에 대해 맵핑된 파일을 검색한다(S110).First, the
다음으로, 정보 분석 모듈(200)은 파일 검색 모듈(100)을 통해 검색된 파일의 헤더 정보를 분석하여 실제 로딩되는 실행 이미지에 포함되는 다수의 섹션 정보를 파악한다(S120).Next, the
그런 다음, 영역 할당 모듈(300)이 상기 분석된 헤더 정보를 토대로 상기 검색된 파일의 실행 이미지를 상기 메모리 상의 별도의 주소인 제 2 주소에 새롭게 로딩한다(S130). 바람직하게는, 영역 할당 모듈(300)은 정보 분석 모듈(200)을 통해 분석된 헤더 정보를 토대로, 메모리 상의 이전의 실행 이미지가 로딩되었던 제 1 주소와는 별도의 주소인 제 2 주소에 상기 파일 검색 모듈(100)을 통해 검색된 파일에 대한 실행 이미지를 새롭게 로딩한다.Then, the
이때, 영역 할당 모듈(300)이 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 상기 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시킨다(S140). 바람직하게는, 영역 할당 모듈(300)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 상기 영역 할당 정 보 테이블을 참고하여 새롭게 할당된 메모리 주소인 제 2 주소가 아닌 이전에 로딩되어 있던 메모리 주소인 제 1 주소를 기준으로 재배치시켜 이전에 제 1 주소에 로딩된 효과를 갖도록 함에 따라, 변조되기 전의 실행 이미지를 얻게 된다.At this time, when the
또한, 영역 할당 모듈(300)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 새롭게 할당된 제 2 주소를 기준으로 재배치시킨다. 이때, 재배치 대상 섹션이 데이터 속성과 같이 실행 속성을 갖지 않을 경우, 메모리의 상기 제 1 주소를 기준으로 재배치시킴으로써, 기존에 메모리 상의 제 1 주소에서 사용되던 데이터는 공유하도록 구성한다.In addition, when the relocation target section including the code section has an execute attribute, the
한편, 영역 할당 모듈(300)은 상기 메모리의 제 2 주소에 로딩된 실행 이미지와 상기 제 1 주소에 로딩된 실행 이미지를 비교하고, 상기 비교 결과, 상기 제 1 주소 및 제 2 주소에 로딩된 실행 이미지상의 특정 섹션이 상이할 경우, 상기 제 1 주소에 로딩된 상이한 섹션을 상기 제 2 주소에 로딩된 섹션으로 대체할 수 있다.Meanwhile, the
도 3에는 본 발명의 제 2 실시예에 따른 실행 이미지의 원본 코드 생성 시스템의 개략적인 구성도를 도시한다.3 is a schematic structural diagram of an original code generation system of an execution image according to a second embodiment of the present invention.
도 3에 도시한 바와 같이, 상기 시스템은, 메모리 상에 로딩된 실행 이미지를 복사하기 위한 이미지 복사 모듈(400); 메모리 상에 로딩된 실행 이미지의 특정 코드가 변조되어 있다는 가정하에 상기 메모리에 로딩된 실행 이미지에 대해 맵핑된 파일(File)을 검색하기 위한 파일 검색 모듈(500); 검색된 파일의 헤 더(Header) 정보를 분석하기 위한 정보 분석 모듈(600); 메모리에 복사된 실행 이미지에 포함된 특정 섹션을 새롭게 로딩하여 오버랩(Overlap)시키며, 영역 할당 정보 테이블을 참조하여, 새롭게 로딩된 실행 이미지의 특정 섹션을 소정의 메모리 주소를 기준으로 재배치시키기 위한 영역 할당 모듈(700);을 포함하는 구성을 갖는다. 여기서, 영역 할당 정보 테이블은 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 정보를 저장하고 있다.As shown in FIG. 3, the system includes an
상기 이미지 복사 모듈(400)은, 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지를 메모리 상의 별도의 주소인 제 2 주소에 복사한다. 여기서, 메모리 상의 제 1 주소에 로딩되어 있는 실행 이미지 또한 메모리에 로딩시, 상술한 할당 정보 테이블을 참조하여, 메모리 상의 실제 로딩되는 주소인 상기 제 1 주소를 기준으로 다수의 섹션이 맵핑되어 있다.The
상기 파일 검색 모듈(500)은 메모리 상의 제 2 주소에 복사된 실행 이미지에 대해 맵핑된 파일을 검색한다. The
상기 정보 분석 모듈(600)은 파일 검색 모듈(500)을 통해 검색된 파일의 헤더 정보를 분석하여 실제 로딩되는 실행 이미지에 포함되는 다수의 섹션 정보를 파악한다.The
상기 영역 할당 모듈(700)은 정보 분석 모듈(600)을 통해 분석된 헤더 정보를 토대로, 파일 검색 모듈(100)을 통해 검색된 파일을 메모리의 제 2 주소에 복사된 이미지 파일에 포함된 특정 섹션 바람직하게는, 변조되었거나, 또는 변조 가능 성이 있는 특정 섹션을 새롭게 로딩하여 오버랩(Overlap)시킨다.The
이때, 영역 할당 모듈(700)은 상술한 바와 같은 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 복사되어 특정 섹션이 오버랩된 상기 실행 이미지상의 다수의 섹션 중 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시킨다.At this time, the
보다 구체적으로, 영역 할당 모듈(700)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 상기 영역 할당 정보 테이블을 참고하여 새롭게 할당된 메모리 주소인 제 2 주소가 아닌 이전에 로딩되어 있던 메모리 주소인 제 1 주소를 기준으로 맵핑시켜 이전에 제 1 주소에 로딩된 효과를 갖도록 함에 따라, 변조되기 전의 실행 이미지를 얻게 된다.More specifically, the
한편, 영역 할당 모듈(700)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 새롭게 할당된 제 2 주소를 기준으로 재배치시킨다. 이때, 재배치 대상 섹션이 데이터 속성과 같이 실행 속성을 갖지 않을 경우, 메모리의 상기 제 1 주소를 기준으로 재배치시킴으로써, 기존에 메모리 상의 제 1 주소에서 사용되던 데이터는 공유하도록 구성한다.Meanwhile, when the relocation target section including the code section has an Execute attribute, the
이하에서는 도 4를 참조하여, 본 발명의 제 2 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기로 한다. 여기서, 도 4는 본 발명의 제 2 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기 위한 개략적인 순서도이다.Hereinafter, a method of generating original code of an execution image according to a second embodiment of the present invention will be described with reference to FIG. 4. 4 is a schematic flowchart illustrating a method of generating original code of an execution image according to a second embodiment of the present invention.
먼저, 이미지 복사 모듈(400)이 메모리 상의 제 1 주소에 로딩(Loading)되어 있는 실행 이미지를 별도의 주소인 제 2 주소에 복사한다(S210).First, the
그리고 나서, 파일 검색 모듈(500)이 상기 메모리 상의 제 2 주소에 복사된 상기 실행 이미지에 대해 맵핑된 파일을 검색한다(S220).Then, the
다음으로, 정보 분석 모듈(600)은 파일 검색 모듈(500)을 통해 검색된 파일의 헤더 정보를 분석하여 실제 로딩되는 실행 이미지에 포함되는 다수의 섹션 정보를 파악한다(S230).Next, the
그런 다음, 영역 할당 모듈(700)이 상기 분석된 헤더 정보를 토대로 상기 제 2 주소에 로딩된 이미지 파일에 포함된 특정 섹션을 새롭게 로딩하여 오버랩(Overlap)시킨다(S240). 바람직하게는, 영역 할당 모듈(700)은 정보 분석 모듈(600)을 통해 분석된 헤더 정보를 토대로, 파일 검색 모듈(100)을 통해 검색된 파일을 메모리의 제 2 주소에 복사된 이미지 파일에 포함된 특정 섹션 즉, 후킹 또는 변조되었거나 내지는 변조 가능성이 있는 특정 섹션을 새롭게 로딩하여 오버랩시킨다.Then, the
이때, 영역 할당 모듈(700)이 특정 파일의 실행 이미지를 메모리에 로딩시 상기 특정 파일에 포함된 다수의 섹션 중, 실제 로딩되는 주소를 기준으로 맵핑되는 재배치 대상 섹션을 특정하는 영역 할당 정보 테이블을 토대로, 상기 제 2 주소에 복사되어 특정 섹션이 오버랩된 상기 실행 이미지상의 다수의 섹션 중 재배치 대상 섹션을 상기 제 1 주소를 기준으로 맵핑시킨다(S250). 바람직하게는, 영역 할당 모듈(700)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 상기 영역 할당 정보 테이블을 참고하여 새롭게 할당된 메모리 주소인 제 2 주소가 아닌 이전 에 로딩되어 있던 메모리 주소인 제 1 주소를 기준으로 재배치시켜 이전에 제 1 주소에 로딩된 효과를 갖도록 함에 따라, 변조되기 전의 실행 이미지를 얻게 된다. 한편, 영역 할당 모듈(700)은 코드 섹션(Section)을 포함하는 재배치 대상 섹션이 실행(Execute) 속성을 가질 경우, 새롭게 할당된 제 2 주소를 기준으로 재배치시킨다. 이때, 재배치 대상 섹션이 데이터 속성과 같이 실행 속성을 갖지 않을 경우, 메모리의 상기 제 1 주소를 기준으로 재배치시킴으로써, 기존에 메모리 상의 제 1 주소에서 사용되던 데이터는 공유하도록 구성한다.At this time, when the
지금까지 본 발명을 바람직한 실시예를 참조하여 상세히 설명하였지만, 본 발명이 상기한 실시예에 한정되는 것은 아니며, 이하의 특허청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변형 또는 수정이 가능한 범위까지 본 발명의 기술적 사상이 미친다 할 것이다.Although the present invention has been described in detail with reference to the preferred embodiments, the present invention is not limited to the above-described embodiments, and the present invention belongs to the present invention without departing from the gist of the present invention as claimed in the following claims. Anyone skilled in the art will have the technical idea of the present invention to the extent that various modifications or changes are possible.
본 발명에 따른 실행 이미지의 원본 코드 생성 시스템 및 그 방법은 메모리에 로딩된 실행 이미지상의 코드 섹션(Section)을 포함하는 재배치 대상 섹션을 섹션의 속성에 따라, 메모리의 특정 주소를 기준으로 재배치(Relocation)시켜 변조된 실행 이미지의 코드 부분을 변조 이전의 원본 실행 코드로 전환함으로써, 악성 코드가 동일한 코드에 대해 반복해서 재후킹하거나 재변조할 수 있다는 문제점을 해결할 수 있다.An original code generation system of an execution image and a method thereof according to the present invention relocate a relocation target section including a code section on an execution image loaded into a memory based on a section attribute, based on a specific address of the memory. By switching the code portion of the modulated executable image to the original executable code before tampering, the malicious code can repeatedly rehook or remodulate the same code.
본 명세서에서 첨부되는 다음의 도면들은 본 발명의 바람직한 실시예를 예시하는 것이며, 후술하는 발명의 상세한 설명과 함께 본 발명의 기술사상을 더욱 이해시키는 역할을 하는 것이므로, 본 발명은 그러한 도면에 기재된 사항에만 한정되어 해석되어서는 아니된다.The following drawings, which are attached in this specification, illustrate preferred embodiments of the present invention, and together with the detailed description of the present invention, serve to further understand the technical spirit of the present invention. It should not be construed as limited to.
도 1은 본 발명의 제 1 실시예에 따른 실행 이미지의 원본 코드 생성 시스템의 개략적인 구성도.1 is a schematic structural diagram of an original code generation system of an execution image according to a first embodiment of the present invention;
도 2는 본 발명의 제 1 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기 위한 개략적인 순서도.2 is a schematic flowchart illustrating a method of generating original code of an execution image according to a first embodiment of the present invention.
도 3은 본 발명의 제 2 실시예에 따른 실행 이미지의 원본 코드 생성 시스템의 개략적인 구성도.3 is a schematic structural diagram of an original code generation system of an execution image according to a second embodiment of the present invention;
도 4는 본 발명의 제 2 실시예에 따른 실행 이미지의 원본 코드 생성 방법을 설명하기 위한 개략적인 순서도.4 is a schematic flowchart illustrating a method of generating original code of an execution image according to a second embodiment of the present invention.
*도면의 주요 부분에 대한 부호의 설명** Description of the symbols for the main parts of the drawings *
100, 500: 파일 검색 모듈100, 500: File Search Module
200, 600: 정보 분석 모듈200, 600: information analysis module
300, 700: 영역 할당 모듈300, 700: zone allocation module
400: 이미지 복사 모듈400: image copy module
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070101463A KR100927974B1 (en) | 2007-10-09 | 2007-10-09 | Source code generation system of executable image and its method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020070101463A KR100927974B1 (en) | 2007-10-09 | 2007-10-09 | Source code generation system of executable image and its method |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20090036339A KR20090036339A (en) | 2009-04-14 |
KR100927974B1 true KR100927974B1 (en) | 2009-11-24 |
Family
ID=40761354
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020070101463A KR100927974B1 (en) | 2007-10-09 | 2007-10-09 | Source code generation system of executable image and its method |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100927974B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101252188B1 (en) | 2011-05-31 | 2013-04-05 | 주식회사 잉카인터넷 | control method of accessing virtual memory data |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101235517B1 (en) * | 2011-03-30 | 2013-02-20 | 주식회사 엔씨소프트 | Method for Detecting Modification of Computer Program Executing in Memory |
KR101642252B1 (en) * | 2016-06-15 | 2016-07-25 | 숭실대학교산학협력단 | Apparatus for tamper detection on mobile application using image resource file and method thereof |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20010092079A (en) * | 2000-03-20 | 2001-10-24 | 권석철 | The method to modify the executable file which is stored in a storage deivce, while it is running under multi-tasking OS |
-
2007
- 2007-10-09 KR KR1020070101463A patent/KR100927974B1/en active IP Right Grant
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20010092079A (en) * | 2000-03-20 | 2001-10-24 | 권석철 | The method to modify the executable file which is stored in a storage deivce, while it is running under multi-tasking OS |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101252188B1 (en) | 2011-05-31 | 2013-04-05 | 주식회사 잉카인터넷 | control method of accessing virtual memory data |
Also Published As
Publication number | Publication date |
---|---|
KR20090036339A (en) | 2009-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7640583B1 (en) | Method and system for protecting anti-malware programs | |
CN102473223B (en) | Information processing device and information processing method | |
US11893114B2 (en) | Memory layout based monitoring | |
CN110096853B (en) | Unity android application reinforcement method based on Mono and storage medium | |
CN109918907B (en) | Method, controller and medium for obtaining evidence of malicious codes in process memory of Linux platform | |
US11175909B2 (en) | Software discovery using exclusion | |
US11593473B2 (en) | Stack pivot exploit detection and mitigation | |
RU2580016C1 (en) | Method for transfer of control between memory areas | |
JP2008225620A (en) | Memory sharing system and method, and program | |
JP2017174373A (en) | System and method for performing antivirus scanning of files on virtual machine | |
US11928206B2 (en) | Selective import/export address table filtering | |
Urbina et al. | Sigpath: A memory graph based approach for program data introspection and modification | |
KR100927974B1 (en) | Source code generation system of executable image and its method | |
Fu et al. | Data correlation‐based analysis methods for automatic memory forensic | |
JP2015527686A (en) | Efficient virtual machine deployment method | |
CN107463513B (en) | System and method for transferring control between storage locations | |
CN106295402B (en) | DLL file hiding method and system | |
CN111625296B (en) | Method for protecting program by constructing code copy | |
KR100876637B1 (en) | Apparatus and method for detecting software attacks on linux | |
US8028142B2 (en) | Controller of storage device, storage device, and control method of storage device | |
US9760623B2 (en) | System for lightweight objects | |
KR101052735B1 (en) | Method for detecting presence of memory operation and device using same | |
CN115422554A (en) | Request processing method, compiling method and trusted computing system | |
Nechta | Robustness analysis for dynamic watermarks | |
TWI715647B (en) | System and method for ip fingerprinting and ip dna analysis |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20121115 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20131118 Year of fee payment: 5 |
|
FPAY | Annual fee payment |
Payment date: 20141117 Year of fee payment: 6 |
|
FPAY | Annual fee payment |
Payment date: 20151116 Year of fee payment: 7 |
|
FPAY | Annual fee payment |
Payment date: 20161116 Year of fee payment: 8 |
|
FPAY | Annual fee payment |
Payment date: 20171116 Year of fee payment: 9 |
|
FPAY | Annual fee payment |
Payment date: 20191118 Year of fee payment: 11 |