KR100939210B1 - Apparatus and method for prevention an debugging in a virtual environment - Google Patents

Apparatus and method for prevention an debugging in a virtual environment Download PDF

Info

Publication number
KR100939210B1
KR100939210B1 KR1020070138641A KR20070138641A KR100939210B1 KR 100939210 B1 KR100939210 B1 KR 100939210B1 KR 1020070138641 A KR1020070138641 A KR 1020070138641A KR 20070138641 A KR20070138641 A KR 20070138641A KR 100939210 B1 KR100939210 B1 KR 100939210B1
Authority
KR
South Korea
Prior art keywords
debugging
interrupt
virtual environment
application
cpu
Prior art date
Application number
KR1020070138641A
Other languages
Korean (ko)
Other versions
KR20090070585A (en
Inventor
정덕영
Original Assignee
주식회사 안철수연구소
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 안철수연구소 filed Critical 주식회사 안철수연구소
Priority to KR1020070138641A priority Critical patent/KR100939210B1/en
Publication of KR20090070585A publication Critical patent/KR20090070585A/en
Application granted granted Critical
Publication of KR100939210B1 publication Critical patent/KR100939210B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/28Error detection; Error correction; Monitoring by checking the correct order of processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

가상 환경에서의 디버깅 방지 장치 및 방법에 관한 것이다.An apparatus and method for preventing debugging in a virtual environment.

본 발명의 실시예에 따른 가상 환경에서의 디버깅 방지 방법은 가상 환경 구축을 위한 초기화를 수행하는 단계, 가상 환경의 커널 레벨로 전환하는 단계, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계, 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 단계, 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 단계 및 디버깅 인터럽트가 발생된 경우 어플리케이션의 디버깅을 방지하도록 디버깅 인터럽트를 처리하는 단계를 포함한다.According to an embodiment of the present invention, a method for preventing debugging in a virtual environment may include performing initialization for building a virtual environment, switching to a kernel level of the virtual environment, and storing first CPU state information that is current CPU state information. Modifying the contents of the current CPU register to a value generated by performing the initialization step after executing the step of storing the first CPU state information, executing the application using the modified CPU register, and generating a debugging interrupt for the application. Detecting whether or not, and processing a debugging interrupt to prevent debugging of the application when a debugging interrupt occurs.

본 발명에 따르면, 가상 환경에서의 디버깅 방지 시스템은 보호하고자 하는 코드를 기존 운영체제의 커널과 격리하여 가상 환경에서 수행되도록 하고 디버깅 관련 인터럽트의 처리를 제어함으로써, 분석 툴들, 예컨대 해킹 툴들이 코드에 대한 분석을 수행하는 것을 방지하는 것이 가능해진다.According to the present invention, an anti-debugging system in a virtual environment isolates the code to be protected from the kernel of an existing operating system so that it is executed in the virtual environment and controls the processing of debugging-related interrupts, thereby analyzing tools such as hacking tools for the code. It becomes possible to prevent performing the analysis.

가상 환경, 가상 커널, 디버깅 인터럽트, 디버깅 방지 Virtual Environment, Virtual Kernel, Debugging Interrupts, Debugging Prevention

Description

가상 환경에서의 디버깅 방지 장치 및 방법{Apparatus and method for prevention an debugging in a virtual environment}Apparatus and method for prevention an debugging in a virtual environment}

본 발명은 가상 환경에서의 디버깅 실행 방지 장치 및 방법에 관한 것으로서, 더욱 상세하게는 특정 어플리케이션에 대한 디버깅을 방지하기 위하여 기존 운영체제의 커널과 격리된 가상 환경을 제공하고 디버깅 관련 인터럽트의 처리를 제어하는 장치 및 방법에 관한 것이다. The present invention relates to an apparatus and method for preventing debugging execution in a virtual environment, and more particularly, to provide a virtual environment isolated from the kernel of an existing operating system in order to prevent debugging for a specific application, and to control debugging related interrupt processing. An apparatus and method are provided.

하나의 어플리케이션이 수행되는 메커니즘을 계층적으로 도시해보면 도 1과 같다. 어플리케이션(4)은 API를 통하여 라이브러리 함수를 호출하고, 라이브러리(3)는 시스템 호출(System Call)을 통해 운영체제(2)에 하드웨어 자원(1)을 요청하고, 운영체제는 ISA를 통해 하드웨어 자원을 제어한다. 가상화 기법은 공통의 하드웨어 자원 상에 복수의 운영체제가 지원되도록 하여 서로 다른 운영체제를 기반으로 하는 어플리케이션들이 실행될 수 있는 환경을 제공하는 기법이다. 이러한 가상화 개념은 그것이 구현되는 레이어에 따라 분류될 수 있다. 이 중 ISA 레벨 가상화는 하나의 하드웨어 상에 복수의 운영체제가 실행될 수 있도록 복수의 운영체제의 ISA를 에뮬레이션하는 기법으로, 복수의 운영체제로부터의 하드웨어에 대한 명령을 모두 전환해주어야 하므로 그 속도가 너무 느리다는 단점이 있었다. 그리하여 하드웨어에 대한 연산 명령은 기존의 코드를 그대로 쓰고 그 외의 상태 변화에 관계된 명령만을 에뮬레이팅하여 ISA의 일부만을 가상화하는 하드웨어 추상화 계층(HAL:Hardware Abstraction Layer) 레벨의 가상화가 등장하였다. 도 2는 HAL 레벨 가상화의 일반적인 개념을 도시하고 있다.A hierarchical illustration of a mechanism in which one application is performed is shown in FIG. 1. The application 4 calls the library function through the API, the library 3 requests the hardware resource 1 from the operating system 2 through a system call, and the operating system controls the hardware resource through the ISA. do. The virtualization technique is a technique for providing an environment in which applications based on different operating systems can be executed by allowing a plurality of operating systems to be supported on common hardware resources. This virtualization concept can be classified according to the layer on which it is implemented. ISA level virtualization is a method that emulates ISA of multiple operating systems so that multiple operating systems can run on a single hardware. The speed is too slow because all instructions for hardware from multiple operating systems must be converted. There was this. Therefore, the hardware abstraction layer (HAL) level virtualization has emerged, which virtualizes only a part of ISA by using the existing code as it is and emulating only the instructions related to other state changes. 2 illustrates a general concept of HAL level virtualization.

HAL 레벨 가상화는 공통의 하드웨어(33) 상에 호스트 운영체제(31)가 탑재된 상태에서 호스트 운영체제와는 다른 게스트 운영체제(12,22)에서 실행되는 어플리케이션들(11,21)이 게스트 운영체제를 기반으로 시스템 호출을 통해 하드웨어를 액세스하게 되고, 가상 머신(13,23) 및 가상 머신 모니터(32)는 이들 호출 중 연산 명령은 호스트 운영체제의 연산 코드를 그대로 쓸 수 있도록 중계하고 그 외 상태 변환 관련 명령의 경우 새로 정의된 코드를 제공함으로써 복수의 운영체제 상의 어플리케이션들(11,21)이 하드웨어를 할당 받을 수 있도록 한다. 그러나 HAL 레벨 가상화도 복수의 운영체제에 대한 인터럽트를 공통의 하드웨어에 매핑시켜줘야 하므로 각기 다른 운영체제에 의한 인터럽트를 핸들링하는데 매우 큰 오버헤드가 있다는 문제가 있었다.HAL level virtualization is based on the guest operating system by the applications (11, 21) running in the guest operating system (12, 22) different from the host operating system with the host operating system (31) mounted on the common hardware 33 The hardware is accessed through system calls, and the virtual machines 13 and 23 and the virtual machine monitor 32 relay the operation instructions during these calls so that the operation codes of the host operating system can be used as they are, and other state transition related instructions In this case, by providing newly defined codes, the applications 11 and 21 on the plurality of operating systems can be allocated hardware. However, HAL-level virtualization also has a problem that there is a very large overhead in handling interrupts by different operating systems because the interrupts for multiple operating systems must be mapped to common hardware.

실행 어플리케이션을 디버깅 하는 기존의 분석 툴들은 대부분 운영체제가 제공하는 커널 코드와 CPU가 제공하는 디버깅 기능을 이용하여 만들어진다. 이러한 분석 툴들에 의한 분석, 예컨대, 해킹을 방지하기 위해, 운영체제가 디버깅 서비스를 제공하기 위하여 사용하는 커널 코드를 조작 감시하거나 디버거 활성화 시에 변경되는 시스템 레지스터를 감시함으로써 디버깅을 방지하는 솔루션이 공지되어 있 다. 하지만, 많은 분석 툴들이 이러한 방지 솔루션에 의하여 영향 받는 코드 혹은 데이터에 대하여 우회 혹은 복원하는 방식을 취하여 이를 회피하고 있다. 이는 보호하고자 하는 어플리케이션과 해킹 프로그램이 동일한 커널 코드와 데이터로 구성된 하나의 운영 체제 환경 내에서 수행되기에 발생되는 문제점이다.Most existing analysis tools for debugging running applications are built using the kernel code provided by the operating system and the debugging capabilities provided by the CPU. In order to prevent analysis by such analysis tools, such as hacking, solutions are known to prevent debugging by manipulating the kernel code used by the operating system to provide debugging services or by monitoring system registers that are changed at debugger activation. have. However, many analysis tools avoid this by circumventing or restoring the code or data affected by this prevention solution. This problem occurs because the application and the hacking program to be protected are executed in one operating system environment composed of the same kernel code and data.

본 발명이 이루고자 하는 기술적 과제는 보호하고자 하는 어플리케이션을 기존 운영체제의 커널과 격리된 가상 환경에서 수행되도록 하고 디버깅 관련 인터럽트가 발생할 경우 그 처리를 제어함으로써, 해킹 툴에 의해 어플리케이션이 디버깅되는 것을 방지할 수 있는 디버깅 방지 장치 및 방법을 제공하고자 하는 것이다.The technical problem of the present invention is to prevent the application from being debugged by the hacking tool by allowing the application to be protected to be executed in a virtual environment isolated from the kernel of the existing operating system and controlling the processing when a debugging related interrupt occurs. It is intended to provide a debugging prevention apparatus and method.

본 발명의 목적은 이상에서 언급한 목적으로 제한되지 않으며, 언급되지 않은 또 다른 목적들은 아래의 기재로부터 당업자에게 명확하게 이해되어질 수 있을 것이다.The object of the present invention is not limited to the above-mentioned object, and other objects not mentioned will be clearly understood by those skilled in the art from the following description.

상기 목적을 달성하기 위하여 본 발명의 실시예에 따른 가상 환경에서의 디버깅 방지 방법은 가상 환경 구축을 위한 초기화를 수행하는 단계, 가상 환경의 커널 레벨로 전환하는 단계, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계, 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 단계, 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 단계 및 디버깅 인터럽트가 발생된 경우 어플리케이션의 디버깅을 방지하도록 디버깅 인터럽트를 처리하는 단계를 포함한다.In order to achieve the above object, a method for preventing debugging in a virtual environment according to an embodiment of the present invention may include performing initialization for building a virtual environment, switching to a kernel level of the virtual environment, and presenting first CPU state information. Storing the CPU state information, modifying the contents of the current CPU register to a value generated by performing the initialization step after performing the first CPU state information storing step, executing the application using the modified CPU register, and the application Detecting whether or not the debugging interrupt for the occurrence of and processing the debugging interrupt to prevent the debugging of the application when the debugging interrupt is generated.

상기 목적을 달성하기 위하여 본 발명의 또 다른 실시예에 따른 가상 환경에서의 디버깅 방지 방법은 가상 환경 구축을 위한 초기화를 수행하는 단계, 가상 환 경의 커널 레벨로 전환하는 단계, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계, 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계, 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 단계, 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 단계, 디버깅 인터럽트가 발생된 경우 어플리케이션에 대한 디버깅 인터럽트의 처리가 금지된 것인지 여부를 판정하는 단계 및 디버깅 인터럽트의 처리가 금지된 경우 어플리케이션의 디버깅을 방지하도록 처리하는 단계를 포함한다.In order to achieve the above object, a method for preventing debugging in a virtual environment according to another embodiment of the present invention includes performing initialization for building a virtual environment, switching to a kernel level of a virtual environment, and present CPU state information. Storing the first CPU state information, modifying the contents of the current CPU register to a value generated by performing the initialization step after performing the first CPU state information storing step, and executing the application using the modified CPU register Detecting whether a debugging interrupt has occurred for the application, determining whether the processing of the debugging interrupt for the application is prohibited when the debugging interrupt is generated, and preventing debugging of the application if the processing of the debugging interrupt is prohibited. Processing to effect.

상기 목적을 달성하기 위하여 본 발명의 실시예에 따른 가상 환경에서의 디버깅 방지 장치는 가상 환경 구축을 위한 초기화를 수행하는 수단, 가상 환경의 커널 레벨로 전환하는 수단, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 수단, 제 1 CPU 상태 정보 저장 수단 수행 후 현재 CPU 레지스터의 내용을 초기화 수행 수단에 의해 생성되는 값으로 수정하는 수단, 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 수단, 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 수단 및 디버깅 인터럽트가 발생된 경우 어플리케이션의 디버깅을 방지하도록 디버깅 인터럽트를 처리하는 수단을 포함한다.In order to achieve the above object, an apparatus for preventing debugging in a virtual environment according to an embodiment of the present invention includes a means for performing initialization for building a virtual environment, a means for switching to a kernel level of a virtual environment, and a current CPU state information. Means for storing CPU state information, means for modifying the contents of the current CPU register to values generated by the initialization performing means after performing the first CPU state information storing means, means for executing the application using the modified CPU register, application Means for detecting whether a debugging interrupt has occurred and means for handling the debugging interrupt to prevent debugging of the application when the debugging interrupt is generated.

상기 목적을 달성하기 위하여 본 발명의 또 다른 실시예에 따른 가상 환경에서의 디버깅 방지 장치는 가상 환경 구축을 위한 초기화를 수행하는 수단, 가상 환경의 커널 레벨로 전환하는 수단, 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 수단, 제 1 CPU 상태 정보 저장 수단 수행 후 현재 CPU 레지스터의 내용 을 초기화 수행 수단에 의해 생성되는 값으로 수정하는 수단, 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 수단, 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 수단, 디버깅 인터럽트가 발생된 경우 어플리케이션에 대한 디버깅 인터럽트의 처리가 금지된 것인지 여부를 판정하는 수단 및 디버깅 인터럽트의 처리가 금지된 경우 어플리케이션의 디버깅을 방지하도록 처리하는 수단을 포함한다.In order to achieve the above object, an apparatus for preventing debugging in a virtual environment according to another embodiment of the present invention is a means for performing initialization for building a virtual environment, a means for switching to a kernel level of a virtual environment, and current CPU state information. Means for storing the first CPU state information, means for modifying the contents of the current CPU register to values generated by the initialization performing means after performing the first CPU state information storage means, means for executing the application using the modified CPU registers Means for detecting whether or not a debugging interrupt has occurred for the application, means for determining whether processing of the debugging interrupt for the application is prohibited when the debugging interrupt is generated, and preventing debugging of the application if processing for the debugging interrupt is prohibited. And means for processing.

기타 실시예들의 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다. Specific details of other embodiments are included in the detailed description and the drawings.

상기한 바와 같은 본 발명의 가상 환경에서의 어플리케이션 실행 장치 및 방법에 따르면 다음과 같은 효과가 있다. According to the application execution apparatus and method in the virtual environment of the present invention as described above has the following advantages.

보호하고자 하는 코드 또는 운영체제에 영향을 미치지 않고 실행하고자 하는 코드를 기존 운영체제의 커널과 격리된 가상 환경에서 수행되도록 하고 가상 환경에서 발생되는 디버깅 관련 인터럽트의 처리를 제어함으로써, 해킹 툴에 의한 코드의 디버깅을 방지할 수 있다는 장점이 있다.Debugging code by hacking tools by allowing code to be executed without affecting the code or operating system to be protected in a virtual environment separate from the kernel of the existing operating system and controlling the handling of debugging-related interrupts generated in the virtual environment. There is an advantage that can be prevented.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다 Advantages and features of the present invention and methods for achieving them will be apparent with reference to the embodiments described below in detail with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but can be implemented in various different forms, and only the embodiments make the disclosure of the present invention complete, and the general knowledge in the art to which the present invention belongs. It is provided to fully inform the person having the scope of the invention, which is defined only by the scope of the claims. Like reference numerals refer to like elements throughout.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수 있음을 이해할 수 있을 것이다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블 록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It will be appreciated that the combination of each block in the accompanying block diagram and each step in the flowchart may be performed by computer program instructions. These computer program instructions may be mounted on a processor of a general purpose computer, special purpose computer, or other programmable data processing equipment such that instructions executed through the processor of the computer or other programmable data processing equipment may not be included in each block or flowchart of the block diagram. It will create means for performing the functions described in each step. These computer program instructions may be stored in a computer usable or computer readable memory that can be directed to a computer or other programmable data processing equipment to implement functionality in a particular manner, and thus the computer usable or computer readable memory. It is also possible for the instructions stored in to produce an article of manufacture containing instruction means for performing the functions described in each block or flowchart of each step of the block diagram. Computer program instructions It can also be mounted on a computer or other programmable data processing equipment, so a series of operating steps are performed on the computer or other programmable data processing equipment to create a computer-implemented process to perform the computer or other programmable data processing equipment. It is also possible for the instructions to provide steps for executing the functions described in each block of the block diagram and in each step of the flowchart.

또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실행예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.In addition, each block or step may represent a portion of a module, segment or code that includes one or more executable instructions for executing a specified logical function (s). It should also be noted that in some alternative implementations, the functions noted in the blocks or steps may occur out of order. For example, the two blocks or steps shown in succession may in fact be executed substantially concurrently or the blocks or steps may sometimes be performed in the reverse order, depending on the functionality involved.

도 3은 본 발명의 일 실시예에 따른 가상 환경 내에서의 디버깅 방지 장치 및 방법에 있어서 어플리케이션이 실행되는 가상 환경을 구축하는 프로그램을 수행한 경우의 계층 구조를 보여주는 도면이다.3 is a diagram illustrating a hierarchical structure when a program for building a virtual environment in which an application is executed is executed in an apparatus and a method for preventing debugging in a virtual environment according to an embodiment of the present invention.

가상 환경 구축 어플리케이션을 실행하면 기존의 운영체제(43)와 격리된 가상 환경 커널(44)이 구축되고, 가상 환경 내에서 실행하고자 하는 어플리케이션(41)은 가상 환경 커널로의 시스템 호출을 지원하는 에뮬레이션 API(42)를 통해 운영체제에 시스템 호출을 하게 된다. 이 때 가상 환경 커널은 가상 환경 내에서 실행되는 어플리케이션을 위한 CPU 레지스터 및 메모리에 관한 운영체제 코드를 제외하고는 기존 운영 체제 커널 코드(43)를 그대로 이용할 수 있게 된다. 예를 들어 이후에 상세하게 설명될 디버깅 관련 인터럽트를 제외한 인터럽트 처리에 있어 기존 운영체제의 인터럽트 처리 코드를 그대로 이용할 수 있다. 가상 환경 커널과 기존 운영체제의 관계 및 가상 환경에서 어플리케이션이 실행되는 메커니즘은 도 4를 참조하여 좀 더 구체적으로 살펴보기로 한다.When the virtual environment building application is executed, the virtual environment kernel 44 is isolated from the existing operating system 43, and the application 41 to be executed in the virtual environment is an emulation API that supports system calls to the virtual environment kernel. At 42, system calls are made to the operating system. At this time, the virtual environment kernel can use the existing operating system kernel code 43 as it is, except for operating system codes related to CPU registers and memory for applications executed in the virtual environment. For example, the interrupt handling code of the existing operating system can be used as it is for interrupt processing except debugging-related interrupts which will be described in detail later. The relationship between the virtual environment kernel and the existing operating system and the mechanism in which the application is executed in the virtual environment will be described in more detail with reference to FIG. 4.

먼저 가상 환경 내 실행 어플리케이션(61)이 수행되기 위한 가상 환경을 만들기 위해 가상 환경 구축 어플리케이션(52)이 실행되면 이는 기존 운영체제, 즉 도 4의 경우 윈도우 운영체제(54)의 입장에서는 다른 어플리케이션(51)과 동등한 하나의 어플리케이션으로 인식되게 된다. 가상 환경 구축 어플리케이션(52)은 미리 정의해 놓은 가상 환경 커널(62)에 대한 최초 진입 경로를 통해 가상 환경 커널 레벨로 전환하게 된다. 가상 환경 커널(62)에 대한 최초 진입 경로는 여러 가지 형태로 구현될 수 있는데, 예를 들어 호출 게이트(CallGate)가 하나의 구현 형태가 될 수 있다. First, when the virtual environment building application 52 is executed to create a virtual environment for the execution application 61 in the virtual environment to be executed, this is an existing operating system, that is, another application 51 from the standpoint of the Windows operating system 54 in FIG. 4. It is recognized as one application that is equivalent to. The virtual environment building application 52 switches to the virtual environment kernel level through the initial entry path to the predefined virtual environment kernel 62. The initial entry path to the virtual environment kernel 62 may be implemented in various forms. For example, a call gate may be one implementation form.

가상 환경 구축 어플리케이션(52)은 호출 게이트에 의해 가상 환경 커널 레벨로 전환한 후 컨텍스트 스위칭 메커니즘에 의하여 기존 운영 체제의 커널(54)과는 격리된 가상 환경 커널(62)을 생성하고 가상 환경 내 실행 어플리케이션(61)이 가상 환경 커널(62)을 통해 하드웨어 자원(55)을 액세스 할 수 있게 한다. The virtual environment building application 52 switches to the virtual environment kernel level by the call gate, and then generates a virtual environment kernel 62 that is isolated from the kernel 54 of the existing operating system by the context switching mechanism and executes in the virtual environment. Allow application 61 to access hardware resources 55 through virtual environment kernel 62.

여기서 컨텍스트 스위칭이란 복수의 프로세스가 하나의 CPU 자원을 공유할 수 있도록 CPU의 상태(컨텍스트)를 저장(storing)하고 복원(restoring)하는 컴퓨팅 프로세스로, 레지스터 컨텍스트 스위치, 태스크 컨텍스트 스위치, 쓰레드 컨텍스트 스위치 또는 프로세스 컨텍스트 스위치 등을 의미할 수 있다. 무엇이 컨텍스트를 구성하는가는 프로세서와 운영체제에 의해 결정된다.Here, context switching is a computing process that stores and restores the state (context) of a CPU so that a plurality of processes can share a single CPU resource, and is a register context switch, a task context switch, a thread context switch, or It can mean a process context switch. What constitutes a context is determined by the processor and operating system.

실제 환경에서 실행되는 어플리케이션(51)과 가상 환경 내 실행 어플리케이 션(52)간에 CPU 할당이 전환되는 과정을 좀 더 자세히 살펴보면 다음과 같다. 멀티태스킹 환경 하에서 어플리케이션(51)과 가상 환경 구축 어플리케이션(52)은 컨텍스트 스위칭 메커니즘에 의해 CPU를 할당받을 수 있다. 가상 환경 구축 어플리케이션(52)이 CPU를 할당받게 되면 가상 환경 구축 어플리케이션(52)은 자신의 CPU 컨텍스트를 저장하고 가상 환경 내 실행 어플리케이션(61)의 CPU 컨텍스트를 복원함으로써 어플리케이션을 기존 운영 체제와는 격리된 가상 환경에서 실행할 수 있게 된다. 그러나, 그 외에는 기존 운영 체제의 커널 코드를 그대로 사용할 수 있게 된다.Looking at the process of the CPU allocation is switched in more detail between the application 51 running in the actual environment and the execution application 52 in the virtual environment as follows. In a multitasking environment, the application 51 and the virtual environment building application 52 may be allocated a CPU by a context switching mechanism. When the virtual environment building application 52 is allocated a CPU, the virtual environment building application 52 isolates the application from the existing operating system by storing its CPU context and restoring the CPU context of the running application 61 in the virtual environment. To run in a virtualized environment. However, other than that, the kernel code of the existing operating system can be used as it is.

도 5는 본 발명의 일 실시예에 따른 가상 환경에서의 디버깅 방지 장치의 구성을 나타내는 블록도이다.5 is a block diagram illustrating a configuration of an anti-debugging device in a virtual environment according to an embodiment of the present invention.

가상 환경에서의 디버깅 장치(70)는 크게 초기화부(71), 작업 관리자(72), 가상 환경 전환부(73), 어플리케이션 실행부(74), 디버깅 인터럽트 처리부(75) 및 실제 환경 복원부(76)로 구성된다.Debugging device 70 in the virtual environment is largely initializer 71, task manager 72, virtual environment switch unit 73, application execution unit 74, debugging interrupt processing unit 75 and the actual environment restoration unit ( 76).

초기화부(71)는 가상 환경 커널 레벨로의 최초 진입 경로를 정의하는 호출 게이트를 구성하고 가상 환경을 위한 초기화 작업을 수행한다. 가상 환경을 위한 초기화 작업은 CPU 레지스터 값을 초기화하고 메모리를 할당하는 작업을 포함한다. 또한, 초기화부(71)에서는 가상 환경 내에서 실행하고자 하는 어플리케이션이 암호화된 상태로 로딩되고 암호화된 어플리케이션 코드의 복호화를 수행하기도 한다. 이때 암호화 및 복호화는 본 발명의 실시예에 따른 가상 환경에서의 디버깅 방지 장치만이 알고 있는 암호화 키 및 복호화 키로 수행함으로써 가상 환경 내에서 실 행되는 어플리케이션의 보호 및 디버깅 방지 효과를 더욱 향상시킬 수 있다The initialization unit 71 configures a call gate defining an initial entry path to the virtual environment kernel level and performs initialization for the virtual environment. Initialization for the virtual environment involves initializing the CPU register values and allocating memory. In addition, the initialization unit 71 may load an application to be executed in a virtual environment in an encrypted state and decrypt the encrypted application code. In this case, encryption and decryption may be performed by using an encryption key and a decryption key known only by the anti-debugging device in the virtual environment according to an embodiment of the present invention to further improve the protection and debugging prevention effect of an application executed in the virtual environment.

작업 관리자(72)는 외부로부터 가상 환경 내 실행 어플리케이션(61)의 실행에 관한 지시를 입력 받고 그 지시에 따라 가상 환경의 사용자 레벨에서 어플리케이션(61)의 동작을 관리한다. 지시는 가상 환경 내 실행 어플리케이션(61)의 실행을 잠시 멈추거나, 잠시 멈춘 어플리케이션의 실행을 재개하거나, 현재 시점의 메모리의 내용을 출력 또는 하드 디스크에 저장하거나, 어플리케이션의 실행을 종료하는 등의 명령이 될 수 있을 것이다.The task manager 72 receives an instruction regarding execution of the execution application 61 in the virtual environment from the outside and manages the operation of the application 61 at the user level of the virtual environment according to the instruction. The instruction may include a command for stopping execution of the execution application 61 in the virtual environment, resuming execution of the paused application, outputting the contents of the memory at the present time to the hard disk, or terminating execution of the application. This could be

가상 환경 전환부(73)는 초기화부에 의해 구성된 호출 게이트에 의해 가상 커널 레벨로 진입하여 기존 운영체제의 사용자 레벨에서 최근까지 실행되었던 CPU의 레지스트리 정보, 즉 현재 실제 환경의 CPU 컨텍스트 정보를 저장한다. 그리고 이후 시스템 퀀텀 타임 아웃(Quantum Time Out)으로 다른 어플리케이션(51)이 수행된 후 가상 환경 구축 어플리케이션(52)이 다시 CPU를 할당받을 때 사용자 레벨의 코드 실행 전 가상 환경 내 실행 어플리케이션의 CPU 컨텍스트를 저장하고 실제 환경의 CPU 컨텍스트, 즉 가상 환경 구축 어플리케이션(52)의 CPU 컨텍스트를 복원하는 단계가 수행될 수 있도록 해당 코드를 APC(Asynchronous Procedure Call)로 등록한다. The virtual environment switching unit 73 enters the virtual kernel level by the call gate configured by the initialization unit and stores the registry information of the CPU which has been executed recently at the user level of the existing operating system, that is, the CPU context information of the current real environment. Then, when another application 51 is executed as a system quantum time out, when the virtual environment building application 52 is allocated CPU, the CPU context of the execution application in the virtual environment is executed before the user level code execution. The code is registered as an Asynchronous Procedure Call (APC) so that the steps of storing and restoring the CPU context of the real environment, that is, the CPU context of the virtual environment building application 52 can be performed.

본 실시예에서는 실제 환경에서 실행되는 어플리케이션으로부터 가상 환경 내 실행 어플리케이션으로의 전환 방법을 APC 등록에 의한 컨텍스트 스위칭 기법을 위주로 설명하였지만 이는 일 실시예에 불과하므로 본 발명의 권리범위는 이에 한정되지 않는다. 본 발명의 권리범위는 가상 환경 구축 어플리케이션(52)이 다시 CPU 타임을 할당받았을 때 기존의 운영체제 입장에서는 인식할 수 없는 가상 환경 내 실행 어플리케이션(61)의 CPU 컨텍스트를 일정한 곳에 저장해놓음으로써 다시 가상 환경으로 전환했을 때 가상 환경 내에서 실행되었던 어플리케이션(61)을 연속하여 실행할 수 있도록 하는 모든 구현 방법을 포함하는 것으로 해석되어야 할 것이다.In the present embodiment, a method of switching from an application executed in a real environment to an executed application in a virtual environment has been described based on a context switching technique by APC registration. However, the scope of the present invention is not limited thereto. According to the scope of the present invention, when the virtual environment building application 52 is allocated CPU time again, the virtual environment is stored again by storing the CPU context of the execution application 61 in the virtual environment that cannot be recognized by the existing operating system. It should be construed to include all implementation methods that enable the continuous execution of the application 61 that was executed in the virtual environment when switching to.

가상 환경 전환부(73)는 APC 등록 단계 수행 후 CPU 시스템 레지스터의 값을 가상 환경을 위한 값으로 수정한다. 즉, 구축하고자 하는 가상 환경에 맞춰 CR3 레지스터 및 IDT(Interrupt Description Table) 레지스터 등의 값을 변경하는 것이다. 그리고 가상 환경 내에서 실행되는 어플리케이션의 CPU 컨텍스트를 복원함으로써 어플리케이션이 실행되는 가상 환경으로의 전환을 완료한다.The virtual environment switching unit 73 modifies the value of the CPU system register to a value for the virtual environment after performing the APC registration step. That is, the values of the CR3 register and the Interrupt Description Table (IDT) register are changed according to the virtual environment to be constructed. The CPU context of the application executed in the virtual environment is restored to complete the switch to the virtual environment in which the application is executed.

어플리케이션 실행부(74)는 가상 환경 전환부(73)에 의해 마련된 가상 환경에서 어플리케이션(61)이 가상 환경 커널을 통해 CPU 자원에 액세스 할 수 있도록 함으로써 기존 운영 체제와 격리된 환경에서 어플리케이션이 실행될 수 있도록 한다. 어플리케이션 실행부(74)는 작업 관리자(72)의 제어에 의해 어플리케이션을 실행하게 된다.The application execution unit 74 allows the application 61 to access CPU resources through the virtual environment kernel in the virtual environment provided by the virtual environment switching unit 73 so that the application can be executed in an environment isolated from the existing operating system. Make sure The application execution unit 74 executes the application under the control of the job manager 72.

디버깅 인터럽트 처리부(75)는 가상 환경 전환부(73)에 의해 마련된 가상 환경에서 어플리케이션에 대하여 발생되는 디버깅 관련 인터럽트의 처리를 제어하여 디버깅을 방지할 수 있도록 한다. 가상 환경 내에서 발생되는 인터럽트 중 어플리케이션을 디버깅하기 위한 인터럽트에 대해서 디버깅 동작이 수행되지 않은 채로 인터럽트 처리가 종료되도록 제어함으로써 해킹 등의 공격을 방지할 수 있게 된다.The debugging interrupt processing unit 75 controls the processing of debugging-related interrupts generated for the application in the virtual environment provided by the virtual environment switching unit 73 so as to prevent debugging. It is possible to prevent an attack such as hacking by controlling interrupt processing to be terminated without performing a debugging operation on an interrupt for debugging an application among the interrupts generated in the virtual environment.

실제 환경 복원부(76)는 가상 환경 구축 어플리케이션(52)이 새로이 CPU 자원을 할당받게 되면 가상 환경 전환부(73)에 의해 APC로 등록된 코드를 수행하여 가상 환경 구축 어플리케이션(52)이 실행되던 실제 환경을 복원한다. 즉, 가상 환경 내에서 실행되었던 어플리케이션의 CPU 컨텍스트 정보를 저장하고 실제 환경의 CPU 컨텍스트 정보를 복원함으로써 가상 환경 구축 어플리케이션의 실행을 재개하고 가상 환경 커널 레벨로 전환될 수 있도록 하는 것이다. 한편, 실제 환경 복원부(76)는 퀀텀 타임 동안 가상 환경 내 실행 어플리케이션의 수행이 완료되면 실제 환경의 CPU 컨텍스트 정보를 복원함으로써 가상 환경 구축 어플리케이션의 실행을 재개하고 가상 환경 커널 레벨로 전환될 수 있도록 한다.When the virtual environment building application 52 is newly allocated CPU resources, the real environment restoration unit 76 executes the code registered as APC by the virtual environment switching unit 73 to execute the virtual environment building application 52. Restore the real environment. That is, by saving the CPU context information of the application executed in the virtual environment and restoring the CPU context information of the real environment, the execution of the virtual environment building application can be resumed and switched to the virtual environment kernel level. Meanwhile, when the execution of the execution application in the virtual environment is completed during the quantum time, the real environment restoration unit 76 restores the CPU context information of the real environment so that the execution of the virtual environment construction application can be resumed and switched to the virtual environment kernel level. do.

지금까지 도 5의 각 구성요소는 소프트웨어(software) 또는, FPGA(field-programmable gate array)나 ASIC(application-specific integrated circuit)과 같은 하드웨어(hardware)를 의미할 수 있다.  그렇지만 상기 구성요소들은 소프트웨어 또는 하드웨어에 한정되는 의미는 아니며, 어드레싱(addressing)할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 실행시키도록 구성될 수도 있다. 상기 구성요소들 안에서 제공되는 기능은 더 세분화된 구성요소에 의하여 구현될 수 있으며, 복수의 구성요소들을 합하여 특정한 기능을 수행하는 것으로 구현할 수도 있다.  뿐만 아니라, 상기 구성요소들은 시스템 내의 하나 또는 그 이상의 컴퓨터들을 실행시키도록 구현될 수 있다.Until now, each component of FIG. 5 may refer to software or hardware such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). However, the components are not limited to software or hardware, and may be configured to be in an addressable storage medium and may be configured to execute one or more processors. The functions provided in the above components may be implemented by more detailed components, or may be implemented by combining a plurality of components to perform a specific function. In addition, the components may be implemented to execute one or more computers in a system.

도 6은 본 발명의 일 실시예에 따른 가상 환경에서의 디버깅 방지 방법을 보여주는 흐름도이다.6 is a flowchart illustrating a debugging prevention method in a virtual environment according to an embodiment of the present invention.

가상 환경 구축 어플리케이션(52)은 가상 환경 커널 레벨로의 진입을 위한 호출 게이트를 생성하고(S1) 가상 환경 구축을 위한 초기화를 수행한다(S2). 가상 환경 구축 초기화 단계에서는 가상 환경에서 사용될 CPU 레지스터 값들이 초기화되고 메모리의 할당 및 초기화가 이루어진다. The virtual environment building application 52 generates a call gate for entering the virtual environment kernel level (S1) and performs initialization for building the virtual environment (S2). In the virtual environment construction initialization phase, CPU register values to be used in the virtual environment are initialized and memory allocation and initialization are performed.

본 발명의 다른 실시예에서는 가상 환경 구축을 위한 초기화 단계에서 가상 환경 내에서 실행하고자 하는 어플리케이션이 암호화된 상태로 로딩되고 암호화된 어플리케이션 코드의 복호화를 수행하기도 한다. 이때 암호화 및 복호화는 본 발명의 실시예에 따른 가상 환경에서의 디버깅 방지 장치만이 알고 있는 암호화 키 및 복호화 키로 수행함으로써 가상 환경 내에서 실행되는 어플리케이션의 보호 및 디버깅 방지 효과를 더욱 향상시킬 수 있다. 즉, 어플리케이션의 로우 데이터를 암호화하고 이를 가상 환경 진입 시에 복호화하여 가상 환경 내에서는 정상적으로 복구된 로우 데이터를 통해 어플리케이션을 수행할 수 있도록 함으로써, 어플리케이션의 실행 코드를 보호할 수 있는 단계를 한 단계 더 설정하는 것을 특징으로 한다. 이러한 과정에서의 암호화는 현재 통상적으로 쓰이는 암호화 방법을 포함하여 컴퓨터 프로그램 상에서 쓰일 수 있는 일반적인 암호화 방법을 모두 포함할 수 있다.In another embodiment of the present invention, an application to be executed in the virtual environment is loaded in an encrypted state and decrypts the encrypted application code in an initialization step for building a virtual environment. In this case, encryption and decryption may be performed by using an encryption key and a decryption key known only by the anti-debugging device in the virtual environment according to an embodiment of the present invention to further improve the protection and debugging prevention effect of an application executed in the virtual environment. In other words, by encrypting the raw data of the application and decrypting it when the virtual environment enters, the application can be executed through the restored raw data in the virtual environment, thereby protecting the execution code of the application. It is characterized by setting. Encryption in this process may include all common encryption methods that can be used on a computer program, including encryption methods currently commonly used.

가상 환경 커널 레벨로 전환하기 전 외부로부터 가상 환경 내 실행 어플리케이션의 실행에 관한 지시를 입력받는다(S3). 가상 환경 내 실행 어플리케이션(61)의 실행에 관한 지시는 도 5에서 상술한 바와 같이 어플리케이션의 실행을 잠시 멈춤, 어플리케이션을 수행하는 동안 특정 시점의 램의 내용을 프린트하거나 기록매 체에 복사는 덤프, 잠시 멈추었던 어플리케이션의 실행을 재개, 어플리케이션의 실행을 종료하는 등의 명령을 포함한다. 가상 환경 구축 어플리케이션은 S1 단계에서 생성한 호출 게이트를 통하여 사용자 레벨에서 가상 환경 커널 레벨로 전환하게 된다(S4).Before switching to the virtual environment kernel level, an instruction regarding execution of an application executed in the virtual environment is received from the outside (S3). Instructions regarding the execution of the execution application 61 in the virtual environment are as described above with reference to FIG. 5. The execution of the application is paused. It includes instructions for resuming execution of an application which has been paused and terminating execution of the application. The virtual environment building application switches from the user level to the virtual environment kernel level through the call gate generated in step S1 (S4).

가상 환경 커널 레벨에서는 기존 운영 체제의 사용자 레벨에서 마지막까지 실행되었던 CPU 컨텍스트 정보를 저장하고(S5), 다음 번 스케줄링시 가상 환경 내 실행 어플리케이션의 CPU 컨텍스트 정보를 보존하고 기존 실제 환경의 CPU 컨텍스트 정보를 복원하기 위한 APC를 등록한다(S6). 이 후, 가상 환경 전환부(73)는 현재 CPU의 시스템 레지스터와 일반 레지스터(General register)들의 값을 S2 단계에서 가상 환경에서 사용되도록 하기 위해 초기화된 값으로 변경(S7)함으로써 CPU를 현재의 운영체제와 분리 시키게 된다(S9). At the virtual environment kernel level, the CPU context information that was executed at the user level of the existing operating system to the last is stored (S5), and the CPU context information of the running application in the virtual environment is preserved at the next scheduling and the CPU context information of the existing physical environment is stored. The APC for restoring is registered (S6). Thereafter, the virtual environment conversion unit 73 changes the values of the system registers and general registers of the current CPU to values initialized to be used in the virtual environment in step S2 (S7), thereby changing the CPU to the current operating system. It is separated from (S9).

가상 환경 내에서 디버깅 인터럽트가 발생하였을 경우(S10의 '예') 가상 환경은 디버깅 인터럽트에 대한 처리를 제어한다(S11). 즉, 가상 환경 내에서 발생하는 디버깅 인터럽트에 대한 처리는 기존의 운영체제의 인터럽트 처리 방법과 별도로 제어하며, 가상 환경 내에서 디버깅을 통하여 어플리케이션을 해킹하려는 동작을 방지하기 위하여 디버깅 인터럽트 발생 시에 기대되는 디버깅 동작이 수행되지 않은 채로 인터럽트 처리가 종료되도록 하여 디버깅을 방지한다.When a debugging interrupt occurs in the virtual environment (YES in S10), the virtual environment controls the processing of the debugging interrupt (S11). That is, the handling of debugging interrupts occurring in the virtual environment is controlled separately from the interrupt handling method of the existing operating system, and the debugging expected when the debugging interrupt occurs in order to prevent an operation to hack an application through debugging in the virtual environment. Prevents debugging by interrupting interrupt processing without performing any action.

가상 환경 사용자 레벨에서의 어플리케이션의 실행이 시스템 퀀텀 타임의 종료로(S12의 '아니오') CPU가 실제 환경의 어플리케이션에 할당된 후 다음 번에 가상 환경 구축 어플리케이션으로의 컨텍스트 스위칭이 일어날 때, S6에서 APC로 등 록된 코드의 수행에 의해 가상 환경 내에서 실행되었던 어플리케이션의 CPU 컨텍스트 정보를 저장하고(S14) 기존 실제 환경의 사용자 레벨에서 최종적으로 실행되었던 어플리케이션의 레지스터들에 대하여 해당 프로세스의 트랩 프레임(Trap Frame)을 수정해줌으로써 컨텍스트 스위칭 단계에서 다시 실제 환경으로의 실행이 가능하도록 만들어 준다(S15).When the execution of the application at the virtual environment user level is the end of the system quantum time (No in S12), the next time the context switch to the virtual environment building application occurs after the CPU has been allocated to the application in the real environment, in S6 By storing the CPU context information of the application executed in the virtual environment by executing the code registered with the APC (S14), the trap frame (Trap) of the process with respect to the registers of the application finally executed at the user level of the existing real environment By modifying the frame), execution of the context back to the actual environment is made possible (S15).

반면, 시스템 퀀텀 타임이 끝나기 전에 가상 환경 내에서의 어플리케이션(61)의 실행이 완료되면(S12의 '예') 가상 환경 사용자 레벨에서의 어플리케이션 실행 전 실제환경의 사용자 레벨에서 최종적으로 실행되었던 CPU 컨텍스트 정보를 복원하고(S13) 외부로부터의 지시를 입력받은 후(S3) 호출 게이트를 통해 다시 가상 환경 커널 레벨로 전환하게 된다(S4).On the other hand, if the execution of the application 61 in the virtual environment is completed before the end of the system quantum time (YES in S12), the CPU context was finally executed at the user level of the real environment before the application execution at the virtual environment user level. After restoring the information (S13) and receiving an instruction from the outside (S3), it switches back to the virtual environment kernel level through the call gate (S4).

도 7은 도 6의 S10 및 S11을 좀 더 구체적으로 보여주는 흐름도이다.FIG. 7 is a flowchart illustrating S10 and S11 of FIG. 6 in more detail.

도 6에서 상술한 바와 같이 가상 환경을 구축한 후 어플리케이션 실행 중에 디버깅 관련 인터럽트가 발생한 경우(S21), 현재 가상 환경이 디버깅 방지 기능이 설정되어 있는지 여부를 판정한다(S22). 이러한 기능 설정 여부에 대한 정보는 어플리케이션을 실행하는 사용자로부터 입력 받을 수도 있고 플래그 변수나 별도의 레지스터를 두어 시스템 관리자로 하여금 필요에 따라 디버깅 방지 기능을 설정하도록 할 수도 있는 등 본 기술 분야에서의 다양한 공지 기술들을 활용하여 디버깅 방지 기능을 설정하고 판정하는 것이 가능하다.As described above with reference to FIG. 6, if a debugging-related interruption occurs during application execution after building the virtual environment (S21), it is determined whether the debugging prevention function is set in the current virtual environment (S22). Information on whether or not to set such a function may be input from a user who runs the application, or a flag variable or a separate register may be set so that a system administrator may set debugging prevention function as necessary. It is possible to use techniques to set and determine anti-debugging features.

디버깅 기능 설정여부 판정 결과 가상 환경 내에서 디버깅 방지 기능이 설정되어 있다면(S22의 '예'), 발생한 디버깅 인터럽트 유형을 판정하고(S23) 해당 유 형에 따라 디버깅을 방지할 수 있도록 하는 가상 환경 내에서의 별도의 처리 과정(S24)을 밟게 된다. 구체적으로는, 후술하는 바와 같이, 가상 환경 내에서 디버깅을 통하여 어플리케이션을 해킹하려는 동작을 방지하기 위하여 디버깅 관련 인터럽트 발생 시에 기대되는 디버깅 동작이 수행되지 않은 채로 인터럽트 처리가 종료되도록 하여 디버깅을 방지한다. 이는 어플리케이션이 기존의 운영 체제와 분리된 커널 내에서 동작하도록 하는 가상 환경을 제공하고 그에 따라 인터럽트 처리의 제어가 가능해짐으로써 얻을 수 있는 본 발명의 효과이다.If the debugging function is determined as a result of the debugging, if the anti-debugging function is set in the virtual environment (Yes in S22), the debugging interrupt type is determined (S23) and the virtual environment is prevented according to the type. In step S24 is a separate process. Specifically, as described below, in order to prevent an operation of hacking an application through debugging in a virtual environment, interrupt processing is terminated without debugging operation expected when debugging related interrupt occurs, thereby preventing debugging. . This is an effect of the present invention that can be obtained by providing a virtual environment that allows an application to operate in a kernel separate from the existing operating system and thereby allow control of interrupt processing.

또한, 디버깅 방지 기능의 설정 여부를 확인하는 과정(S22)을 생략하고 모든 디버깅 관련 인터럽트에 대하여 디버깅 방지 처리를 밟는 것도 가능하며, 각각의 어플리케이션에 대해서도 디버깅 방지 처리를 수행할 것인지 여부를 설정하는 것도 가능하다. 즉, 특정 어플리케이션에 대한 디버깅 관련 인터럽트만을 제어하도록 설정할 수도 있으며, 모든 어플리케이션에 대한 디버깅 관련 인터럽트의 처리를 제어하도록 설정할 수도 있다.In addition, it is possible to skip the step of checking whether or not the debugging prevention function is set (S22) and to perform debugging prevention processing for all debugging-related interrupts, and to set whether or not to perform debugging prevention processing for each application. It is possible. That is, it may be set to control only debugging related interrupts for a specific application, or may be set to control processing of debugging related interrupts for all applications.

이하에서, 디버깅 관련 인터럽트에 따른 보다 구체적인 처리 과정을 도 8 을 참조하여 기술하도록 한다.Hereinafter, a more detailed processing procedure according to the debugging related interrupt will be described with reference to FIG. 8.

디버깅을 위한 방법으로는 디버깅 관련 인터럽트를 발생시켜 실행 중인 어플리케이션에 대하여 브레이크를 걸고 어플리케이션의 동작을 파악하는 방법이 있다. 브레이크는 통상 하드웨어 브레이크와 소프트웨어 브레이크로 나누어 볼 수 있는데, 전자는 디버깅을 수행하고자 하는 특정 메모리 주소를 설정하고 디버깅을 위한 인터럽트를 발생시켜 상기 특정 메모리 주소에 접근하여 디버깅을 수행하는 동작이 며 후자는 어플리케이션 내의 특정 인스트럭션을 지정하여 이에 대하여 디버깅을 수행하는 동작을 의미한다. 통상, CPU에는 255개의 인터럽트가 정의되어 있는데, 특히 인텔 사에서 생산되는 CPU에는 인터럽트 1(Interrupt 1:INT 1) 및 인터럽트 3(Interrupt 3:INT 3)이 각각 하드웨어 디버깅 인터럽트와 소프트웨어 디버깅 인터럽트를 수행할 수 있도록 지정되어 있다.The debugging method is to generate a debugging-related interrupt, break the running application, and grasp the operation of the application. Breaks can be generally classified into hardware breaks and software breaks. The former is to set a specific memory address to be debugged and generate an interrupt for debugging to access the specific memory address for debugging. It refers to the operation of designating specific instructions in the application and performing debugging on them. Typically, 255 interrupts are defined on the CPU, especially for Intel-produced CPUs, Interrupt 1 (Interrupt 1: INT 1) and Interrupt 3 (Interrupt 3: INT 3) respectively perform hardware debugging interrupts and software debugging interrupts. It is specified to be able to.

도 8은 본 발명의 일 실시예에 따른 가상 환경 내에서의 하드웨어 디버깅 인터럽트 및 소프트웨어 디버깅 인터럽트에 대한 처리 방법을 보여주는 흐름도이다.8 is a flowchart illustrating a processing method for hardware debugging interrupts and software debugging interrupts in a virtual environment according to an embodiment of the present invention.

먼저 하드웨어 디버깅 인터럽트가 발생하였을 경우(S31), 싱글 스텝 트레이싱이 설정되어 있는지 여부를 파악한다(S32). 싱글 스텝 트레이싱이란 어플리케이션의 모든 인스트럭션의 실행에 대해 CPU에 의한 인터럽트를 발생시켜 어플리케이션의 흐름을 모든 스텝 별로 파악하는 디버깅 상태를 의미한다. 통상, 싱글 스텝 트레이싱의 설정은 디버깅에 관련된 설정이 저장되어 있는 디버그 레지스터(Debug Register) 중 디버그 상태 레지스터(Debug Status Register)의 비트 설정 값을 읽어 들여 파악할 수 있다. 보다 구체적으로, 인텔 사 계열의 CPU의 경우, 싱글 스텝 트레이싱에 의한 디버깅이 발생되면 컴퓨터 내부적으로 인터럽트 1을 발생시키게 되고, 따라서 인터럽트 1을 확인한 경우 디버그 상태 레지스터(DR6 register)를 확인하여 BS(Break for single-step) 비트가 설정되어 있다면 싱글 스텝에 의한 트레이싱이 발생되었음을 판정할 수 있는 것이다.First, when a hardware debugging interrupt occurs (S31), it is determined whether single step tracing is set (S32). Single-step tracing refers to a debugging state that generates an interrupt by the CPU for execution of all instructions of an application and grasps the flow of the application in every step. In general, the setting of the single step tracing can be grasped by reading the bit setting value of the Debug Status register among the debug registers in which the settings related to debugging are stored. More specifically, in case of the Intel series CPU, when debugging by single step tracing occurs, interrupt 1 is generated internally in the computer. Therefore, when the interrupt 1 is checked, the debug status register (DR6 register) is checked to determine the BS (Break). for single-step) bit, it can be determined that tracing by single step has occurred.

디버그 상태 레지스터 값의 판정 결과 싱글 스텝 트레이싱이 설정 되어 있다면(S32의 '예') 별도의 처리 동작을 거치지 않고 인터럽트 처리를 종료시킨다. 즉, 싱글 스텝 트레이싱을 통하여 어플리케이션의 내용을 파악하려는 동작에 대하여 아무런 동작을 수행하지 않고 인터럽트 처리가 종료되도록 함으로써, 디버깅을 방지하는 효과를 볼 수 있다.If single step tracing is set as a result of the determination of the debug status register value (YES in S32), the interrupt processing is terminated without any separate processing operation. That is, interrupt processing is terminated without performing any operation on the operation to grasp the contents of the application through single step tracing, thereby preventing debugging.

한편, 싱글 스텝 트레이싱으로 설정되어 있지 않은 경우에는(S32의 '아니오') 하드웨어 브레이크가 설정되어 있는지 여부를 판정한다(S33). 하드웨어 브레이크는 어플리케이션의 특정 메모리 주소에 대한 접근이 있을 경우, 어플리케이션을 중지시키고 특정 메모리 주소에 대해서 디버깅을 실시할 수 있도록 하는 디버깅 동작이다. 통상, 하드웨어 브레이크가 설정되어 있는지 여부는 디버그 상태 레지스터의 비트 설정 값을 읽어 들여 파악할 수 있다. 보다 구체적으로, 인텔 사 계열의 CPU의 경우, 인터럽트 1이 발생한 경우 디버그 상태 레지스터(DR6 register)의 B0 내지 B3 비트가 설정되어 있다면 이는 하드웨어 브레이크가 설정되어 있다는 것을 의미한다. 하드웨어 브레이크 시에 디버깅을 수행할 메모리 주소는 디버그 어드레스 레지스터(Debug address register)에 기록되어 있으며, 통상 B0 내지 B3 비트에 대응하여 DR0 내지 DR3 레지스터에 디버깅을 수행할 메모리 주소가 기록되어 있다. On the other hand, when not set to single step tracing (NO in S32), it is determined whether or not the hardware brake is set (S33). A hardware break is a debugging operation that stops the application and allows debugging for that particular memory address when the application has access to a particular memory address. Normally, whether or not the hardware break is set can be determined by reading the bit setting value of the debug status register. More specifically, in the case of an Intel-based CPU, if the B0 to B3 bits of the debug status register (DR6 register) are set when interrupt 1 occurs, this means that a hardware break is set. The memory address to be debugged at the time of hardware break is recorded in the debug address register, and the memory address to be debugged is recorded in the DR0 to DR3 registers corresponding to the B0 to B3 bits.

하드웨어 브레이크 설정 여부 판정 결과 하드웨어 브레이크가 설정되어 있다면(S33의 '예'), 관련된 시스템 레지스터 혹은 디버그 레지스터 정보, 예컨대, 디버깅하고자 하는 메모리 주소(memory address)가 기록되어 있는 디버그 어드레스 레지스터 및 디버깅 조건이 기록되어 있는 디버그 컨트롤 레지스터의 정보를 리셋한다(S34). 이렇게 디버깅이 수행될 메모리 주소 정보를 리셋하고 디버깅 인터럽 트 처리를 종료시킴으로써 해당 메모리 주소에 대한 디버깅 동작이 수행되는 것을 막을 수 있게 된다. 반면, 하드웨어 브레이크가 설정되어 있지 않다면(S33의 '아니오'), 가상 환경 내에서 일반적으로 인터럽트를 처리하는 동작, 예컨대, 기존 운영 체제의 인터럽트 처리 동작을 수행하도록 한다(S35). 상기와 같은 처리 흐름에 따라서, 하드웨어 브레이크가 설정되더라도 이를 처리하지 않은 채로 인터럽트 처리를 정상적으로 종료시킬 수가 있고, 따라서 디버깅을 방지하는 효과를 달성할 수 있다.If the hardware break is set as a result of determining whether the hardware break is set (YES in S33), the debug address register and the debugging condition in which the relevant system register or debug register information, for example, a memory address to be debugged, are recorded. The information on the recorded debug control register is reset (S34). By resetting the memory address information to be debugged and terminating the debugging interrupt processing, it is possible to prevent the debugging operation for the memory address. On the other hand, if the hardware break is not set (No in S33), the operation to process the interrupt in general in the virtual environment, for example, to perform the interrupt processing operation of the existing operating system (S35). According to the processing flow as described above, even if a hardware break is set, interrupt processing can be normally terminated without processing, thereby achieving an effect of preventing debugging.

한편, 소프트웨어 디버깅 인터럽트가 발생했을 경우(S31의 '아니오')는 하드웨어 디버깅 인터럽트가 발생한 경우와는 달리 별도의 시스템 레지스터의 설정을 수정하는 동작 없이, 인터럽트를 무시하고 바로 인터럽트 처리를 종료하도록 하는 동작으로 충분하다.On the other hand, when a software debugging interrupt occurs (No in S31), unlike a hardware debugging interrupt, an operation for ignoring the interrupt and immediately ending the interrupt processing without modifying a separate system register setting is performed. Is enough.

보다 구체적으로, 소프트웨어 디버깅 인터럽트는 어플리케이션의 특정 인스트럭션에 대하여 디버깅을 수행하기 위하여 발생시키는 인터럽트이다. 즉, 소프트웨어 브레이크 포인트가 특정 인스트럭션에 대하여 설정되어 있고 해당하는 인스트럭션이 실행되려 하면, 인터럽트가 발생되게 된다. 인텔 사 계열의 CPU의 경우 소프트웨어 브레이크를 설정하면 인터럽트 3이 발생하게 되어 있다. 이와 같은 소프트웨어 디버깅 인터럽트가 발생한 경우, 즉 소프트웨어 브레이크가 설정되어 있고 이에 따라 인터럽트가 발생한 경우에는 해당 인터럽트에 대해서 별도의 처리 동작을 수행하지 않고 인터럽트를 무시하도록 바로 인터럽트 처리를 종료시킴으로써 디버깅 동작을 방지할 수 있게 된다.More specifically, a software debugging interrupt is an interrupt that is generated to perform debugging for a specific instruction of an application. In other words, if a software breakpoint is set for a particular instruction and the instruction is about to be executed, an interrupt is generated. In the case of Intel's CPUs, setting a software break causes interrupt 3. When such a software debugging interrupt occurs, that is, when a software break is set and an interrupt occurs, the debugging operation can be prevented by immediately terminating the interrupt processing to ignore the interrupt without performing a separate processing operation for the interrupt. It becomes possible.

상술한 바와 같은 디버그 인터럽트 처리의 제어를 통해서 어플리케이션에 대한 디버깅 동작을 방지할 수 있으며, 이는 어플리케이션이 기존의 운영 체제와 분리된 커널 내에서 동작하도록 하는 가상 환경을 제공하고 그에 따라 디버깅 인터럽트 처리의 제어가 가능해짐으로써 얻을 수 있는 본 발명의 효과이다.By controlling the debug interrupt handling as described above, it is possible to prevent the debugging operation for the application, which provides a virtual environment that allows the application to operate in a kernel separate from the existing operating system and thereby control the debugging interrupt processing. The effect of the present invention can be obtained by being possible.

이상 첨부된 도면을 참조하여 본 발명의 실시예를 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. Although embodiments of the present invention have been described above with reference to the accompanying drawings, those skilled in the art to which the present invention pertains may implement the present invention in other specific forms without changing the technical spirit or essential features thereof. I can understand that. Therefore, it should be understood that the embodiments described above are exemplary in all respects and not restrictive.

도 1은 통상적인 컴퓨터에서의 어플리케이션 실행의 계층도이다. 1 is a hierarchical diagram of application execution on a typical computer.

도 2는 종래의 하드웨어 추상화 계층(HAL:Hardware Abstraction Layer) 에서의 가상화 개념을 보여주는 도면이다.FIG. 2 is a diagram illustrating a virtualization concept in a conventional hardware abstraction layer (HAL).

도 3은 본 발명의 일 실시예에 따른 가상 환경 내에서의 디버깅 방지 장치 및 방법에 있어서 어플리케이션이 실행되는 가상 환경을 구축하는 프로그램을 수행한 경우의 계층도이다. 3 is a hierarchical diagram when a program for building a virtual environment in which an application is executed is executed in an apparatus and method for preventing debugging in a virtual environment according to an embodiment of the present invention.

도 4는 본 발명의 일 실시예에 따른 가상 환경에서의 어플리케이션 실행 메커니즘을 보여주는 도면이다.4 illustrates an application execution mechanism in a virtual environment according to an embodiment of the present invention.

도 5는 본 발명의 일 실시예에 따른 가상 환경에서의 디버깅 방지 장치의 구성을 나타내는 블록도이다5 is a block diagram illustrating a configuration of an anti-debugging device in a virtual environment according to an embodiment of the present invention.

도 6은 본 발명의 일 실시예에 따른 가상 환경에서의 디버깅 방지 방법을 보여주는 흐름도이다.6 is a flowchart illustrating a debugging prevention method in a virtual environment according to an embodiment of the present invention.

도 7은 도 6의 디버깅 인터럽트 처리 단계(S10 및 S11)를 좀 더 구체적으로 보여주는 흐름도이다.FIG. 7 is a flowchart illustrating the debugging interrupt processing steps S10 and S11 of FIG. 6 in more detail.

도 8은 본 발명의 일 실시예에 따른 가상 환경 내에서의 하드웨어 디버깅 인터럽트 및 소프트웨어 디버깅 인터럽트에 대한 처리 방법을 보여주는 흐름도이다.8 is a flowchart illustrating a processing method for hardware debugging interrupts and software debugging interrupts in a virtual environment according to an embodiment of the present invention.

<도면의 주요 부분에 관한 부호의 설명> <Explanation of symbols on main parts of the drawings>

70 : 가상 환경 내 디버깅 방지 장치 71: 초기화부70: anti-debugging device in a virtual environment 71: initialization unit

72: 작업 관리자 73: 가상 환경 전환부72: Task Manager 73: Virtual Environment Switcher

74: 어플리케이션 실행부 75: 디버깅 인터럽트 처리부74: application execution unit 75: debugging interrupt processing unit

76: 실제 환경 복원부76: real environment restore unit

Claims (23)

가상 환경 구축을 위한 초기화를 수행하는 단계;Performing initialization to establish a virtual environment; 상기 가상 환경의 커널 레벨로 전환하는 단계;Switching to a kernel level of the virtual environment; 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계;Storing first CPU state information which is current CPU state information; 상기 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 상기 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계;Modifying the contents of the current CPU register to a value generated by performing the initialization step after performing the first CPU state information storing step; 상기 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 단계;Executing an application using the modified CPU register; 상기 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 단계; 및Detecting whether a debugging interrupt for the application occurs; And 상기 디버깅 인터럽트가 발생된 경우 상기 어플리케이션의 디버깅을 방지하도록 상기 디버깅 인터럽트를 처리하는 단계를 포함하는 Processing the debugging interrupt to prevent debugging of the application when the debugging interrupt is generated; 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 1 항에 있어서,The method of claim 1, 상기 초기화를 수행하는 단계는 Performing the initialization is 상기 어플리케이션의 암호화된 이미지를 로딩하는 단계; 및 Loading an encrypted image of the application; And 상기 암호화된 이미지를 복호화하는 단계를 포함하는Decrypting the encrypted image 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 1 항에 있어서,The method of claim 1, 상기 디버깅 인터럽트 처리 단계는The debugging interrupt processing step 상기 발생된 디버깅 인터럽트의 유형을 판정하는 단계; 및Determining the type of debugging interrupt generated; And 상기 발생된 디버깅 인터럽트의 유형에 따라 해당하는 디버깅 인터럽트 처리를 수행하는 단계를 포함하는 And performing corresponding debugging interrupt processing according to the type of the generated debugging interrupt. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 3 항에 있어서,The method of claim 3, wherein 상기 발생된 디버깅 인터럽트의 유형은 하드웨어 디버깅 인터럽트 또는 소프트웨어 디버깅 인터럽트 중 적어도 하나인The type of debugging interrupt generated is at least one of a hardware debugging interrupt or a software debugging interrupt. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 3 항에 있어서,The method of claim 3, wherein 상기 디버깅 인터럽트가 소프트웨어 디버깅 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는 If the debugging interrupt is a software debugging interrupt, the debugging interrupt processing step 상기 소프트웨어 디버깅 인터럽트를 처리하지 않고 인터럽트 처리를 종료하 는Terminates interrupt processing without processing the software debugging interrupt. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 3 항에 있어서,The method of claim 3, wherein 상기 디버깅 인터럽트가 상기 어플리케이션의 모든 인스트럭션에 대한 디버깅을 요청하는 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는If the debugging interrupt is an interrupt requesting debugging for all instructions of the application, the debugging interrupt processing step 상기 디버깅 인터럽트를 처리하지 않고 인터럽트 처리를 종료하는Terminating interrupt processing without processing the debugging interrupt 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 3 항에 있어서,The method of claim 3, wherein 상기 디버깅 인터럽트가 상기 어플리케이션이 특정 메모리 주소 접근하는 경우 디버깅을 하도록 요청하는 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는If the debugging interrupt is an interrupt requesting debugging when the application approaches a specific memory address, the debugging interrupt processing step 디버깅을 위한 시스템 레지스터의 값을 리셋하는To reset the value of the system register for debugging. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 4 항에 있어서,The method of claim 4, wherein 상기 CPU가 인텔 사 계열의 CPU인 경우,If the CPU is an Intel series CPU, 상기 하드웨어 디버깅 인터럽트는 인터럽트 1(Interrupt 1)이고 상기 소프트웨어 디버깅 인터럽트는 인터럽트 3(Interrupt 3)인The hardware debugging interrupt is Interrupt 1 and the software debugging interrupt is Interrupt 3 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 1 항에 있어서,The method of claim 1, 상기 어플리케이션의 실행이 완료되지 않고 중단되는 경우 상기 어플리케이션의 CPU 상태 정보인 제 2 CPU 상태 정보를 저장하는 단계;Storing second CPU state information which is CPU state information of the application when the execution of the application is stopped without completing; 상기 제 2 CPU 상태 정보 저장 단계 수행 후 상기 제 1 CPU 상태 정보를 복원하는 단계; 및Restoring the first CPU state information after performing the storing of the second CPU state information; And 상기 실행이 중단되었던 어플리케이션의 실행이 재개(resume)되는 경우 상기 제 2 CPU 상태 정보를 복원하는 단계를 더 포함하는Restoring the second CPU state information when the execution of the application where the execution was interrupted is resumed; 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 1 항에 있어서,The method of claim 1, 상기 초기화 단계는The initialization step 기존의 운영 체제를 통하지 않고 가상 환경 커널 레벨로 진입하는 경로를 생성하는 단계; 및Creating a path to a virtual environment kernel level without passing through an existing operating system; And 상기 가상 환경에서 사용될 CPU 레지스터 및 메모리를 초기화하는 단계를 포 함하는Initializing the CPU registers and the memory to be used in the virtual environment. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 가상 환경 구축을 위한 초기화를 수행하는 단계;Performing initialization to establish a virtual environment; 상기 가상 환경의 커널 레벨로 전환하는 단계;Switching to a kernel level of the virtual environment; 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 단계;Storing first CPU state information which is current CPU state information; 상기 제 1 CPU 상태 정보 저장 단계 수행 후 현재 CPU 레지스터의 내용을 상기 초기화 단계 수행에 의해 생성되는 값으로 수정하는 단계;Modifying the contents of the current CPU register to a value generated by performing the initialization step after performing the first CPU state information storing step; 상기 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 단계;Executing an application using the modified CPU register; 상기 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 단계;Detecting whether a debugging interrupt for the application occurs; 상기 디버깅 인터럽트가 발생된 경우 상기 어플리케이션에 대한 상기 디버깅 인터럽트의 처리가 금지된 것인지 여부를 판정하는 단계; 및Determining whether processing of the debugging interrupt for the application is prohibited when the debugging interrupt is generated; And 상기 디버깅 인터럽트의 처리가 금지된 경우 상기 어플리케이션의 디버깅을 방지하도록 처리하는 단계를 포함하는 And processing to prevent debugging of the application when processing of the debugging interrupt is prohibited. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 11 항에 있어서,The method of claim 11, 상기 초기화를 수행하는 단계는 Performing the initialization is 상기 어플리케이션의 암호화된 이미지를 로딩하는 단계; 및 Loading an encrypted image of the application; And 상기 암호화된 이미지를 복호화하는 단계를 포함하는Decrypting the encrypted image 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 11 항에 있어서,The method of claim 11, 상기 디버깅 인터럽트 처리 단계는The debugging interrupt processing step 상기 발생된 디버깅 인터럽트의 유형을 판정하는 단계; 및Determining the type of debugging interrupt generated; And 상기 발생된 디버깅 인터럽트의 유형에 따라 해당하는 디버깅 인터럽트 처리를 수행하는 단계를 포함하는 And performing corresponding debugging interrupt processing according to the type of the generated debugging interrupt. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 13 항에 있어서,The method of claim 13, 상기 발생된 디버깅 인터럽트의 유형은 하드웨어 디버깅 인터럽트 또는 소프트웨어 디버깅 인터럽트 중 적어도 하나인The type of debugging interrupt generated is at least one of a hardware debugging interrupt or a software debugging interrupt. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 13 항에 있어서,The method of claim 13, 상기 디버깅 인터럽트가 소프트웨어 디버깅 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는 If the debugging interrupt is a software debugging interrupt, the debugging interrupt processing step 상기 소프트웨어 디버깅 인터럽트를 처리하지 않고 인터럽트 처리를 종료하는Terminating interrupt processing without processing the software debugging interrupt 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 13 항에 있어서,The method of claim 13, 상기 디버깅 인터럽트가 상기 어플리케이션의 모든 인스트럭션에 대한 디버깅을 요청하는 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는If the debugging interrupt is an interrupt requesting debugging for all instructions of the application, the debugging interrupt processing step 상기 디버깅 인터럽트를 처리하지 않고 인터럽트 처리를 종료하는Terminating interrupt processing without processing the debugging interrupt 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 13 항에 있어서,The method of claim 13, 상기 디버깅 인터럽트가 상기 어플리케이션이 특정 메모리 주소 접근하는 경우 디버깅을 하도록 요청하는 인터럽트인 경우 상기 디버깅 인터럽트 처리 단계는If the debugging interrupt is an interrupt requesting debugging when the application approaches a specific memory address, the debugging interrupt processing step 디버깅을 위한 시스템 레지스터의 값을 리셋하는To reset the value of the system register for debugging. 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 14 항에 있어서,The method of claim 14, 상기 CPU가 인텔 사 계열의 CPU인 경우,If the CPU is an Intel series CPU, 상기 하드웨어 디버깅 인터럽트는 인터럽트 1(Interrupt 1)이고 상기 소프트웨어 디버깅 인터럽트는 인터럽트 3(Interrupt 3)인The hardware debugging interrupt is Interrupt 1 and the software debugging interrupt is Interrupt 3 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 11 항에 있어서,The method of claim 11, 상기 어플리케이션의 실행이 완료되지 않고 중단되는 경우 상기 어플리케이션의 CPU 상태 정보인 제 2 CPU 상태 정보를 저장하는 단계;Storing second CPU state information which is CPU state information of the application when the execution of the application is stopped without completing; 상기 제 2 CPU 상태 정보 저장 단계 수행 후 상기 제 1 CPU 상태 정보를 복원하는 단계; 및Restoring the first CPU state information after performing the storing of the second CPU state information; And 상기 실행이 중단되었던 어플리케이션의 실행이 재개(resume)되는 경우 상기 제 2 CPU 상태 정보를 복원하는 단계를 더 포함하는Restoring the second CPU state information when the execution of the application where the execution was interrupted is resumed; 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 제 11 항에 있어서,The method of claim 11, 상기 초기화 단계는The initialization step 기존의 운영 체제를 통하지 않고 가상 환경 커널 레벨로 진입하는 경로를 생성하는 단계; 및Creating a path to a virtual environment kernel level without passing through an existing operating system; And 상기 가상 환경에서 사용될 CPU 레지스터 및 메모리를 초기화하는 단계를 포함하는Initializing a CPU register and a memory to be used in the virtual environment; 가상환경에서 디버깅 방지 방법.How to avoid debugging in a virtual environment. 가상 환경 구축을 위한 초기화를 수행하는 수단;Means for performing initialization for building a virtual environment; 상기 가상 환경의 커널 레벨로 전환하는 수단;Means for switching to a kernel level of the virtual environment; 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 수단;Means for storing first CPU state information that is current CPU state information; 상기 제 1 CPU 상태 정보 저장 수단 수행 후 현재 CPU 레지스터의 내용을 상기 초기화 수행 수단에 의해 생성되는 값으로 수정하는 수단;Means for modifying a content of a current CPU register to a value generated by said initialization performing means after performing said first CPU state information storing means; 상기 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 수단;Means for executing an application using the modified CPU register; 상기 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 수단; 및Means for detecting whether a debugging interrupt for the application has occurred; And 상기 디버깅 인터럽트가 발생된 경우 상기 어플리케이션의 디버깅을 방지하도록 상기 디버깅 인터럽트를 처리하는 수단을 포함하는 Means for processing said debugging interrupt to prevent debugging of said application when said debugging interrupt is generated; 가상환경에서 디버깅 방지 장치.Debugging prevention device in virtual environment. 가상 환경 구축을 위한 초기화를 수행하는 수단;Means for performing initialization for building a virtual environment; 상기 가상 환경의 커널 레벨로 전환하는 수단;Means for switching to a kernel level of the virtual environment; 현재의 CPU 상태 정보인 제 1 CPU 상태 정보를 저장하는 수단;Means for storing first CPU state information that is current CPU state information; 상기 제 1 CPU 상태 정보 저장 수단 수행 후 현재 CPU 레지스터의 내용을 상기 초기화 수행 수단에 의해 생성되는 값으로 수정하는 수단;Means for modifying a content of a current CPU register to a value generated by said initialization performing means after performing said first CPU state information storing means; 상기 수정된 CPU 레지스터를 사용하여 어플리케이션을 실행하는 수단;Means for executing an application using the modified CPU register; 상기 어플리케이션에 대한 디버깅 인터럽트의 발생 여부를 감지하는 수단;Means for detecting whether a debugging interrupt for the application has occurred; 상기 디버깅 인터럽트가 발생된 경우 상기 어플리케이션에 대한 상기 디버깅 인터럽트의 처리가 금지된 것인지 여부를 판정하는 수단; 및Means for determining whether processing of the debugging interrupt for the application is prohibited when the debugging interrupt is generated; And 상기 디버깅 인터럽트의 처리가 금지된 경우 상기 어플리케이션의 디버깅을 방지하도록 처리하는 수단을 포함하는 Means for processing to prevent debugging of said application if processing of said debugging interrupt is prohibited; 가상환경에서 디버깅 방지 장치.Debugging prevention device in virtual environment. 제 1 항 내지 제 20 항 중 어느 한 항에 의한 방법을 실행하기 위한 컴퓨터로 읽을 수 있는 프로그램을 기록한 기록매체.21. A recording medium having recorded thereon a computer readable program for executing the method according to any one of claims 1 to 20.
KR1020070138641A 2007-12-27 2007-12-27 Apparatus and method for prevention an debugging in a virtual environment KR100939210B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020070138641A KR100939210B1 (en) 2007-12-27 2007-12-27 Apparatus and method for prevention an debugging in a virtual environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020070138641A KR100939210B1 (en) 2007-12-27 2007-12-27 Apparatus and method for prevention an debugging in a virtual environment

Publications (2)

Publication Number Publication Date
KR20090070585A KR20090070585A (en) 2009-07-01
KR100939210B1 true KR100939210B1 (en) 2010-01-28

Family

ID=41322102

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020070138641A KR100939210B1 (en) 2007-12-27 2007-12-27 Apparatus and method for prevention an debugging in a virtual environment

Country Status (1)

Country Link
KR (1) KR100939210B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11409635B2 (en) 2019-08-23 2022-08-09 Raytheon Company Hacker-resistant anti-debug system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101292572B1 (en) * 2012-03-16 2013-08-09 국방과학연구소 File system management apparatus using virtual machine and method thereof
KR101861952B1 (en) * 2017-01-25 2018-05-28 한양대학교 에리카산학협력단 Anti-debugging method for preventing software break point and apparatus therefor
WO2019235664A1 (en) * 2018-06-08 2019-12-12 라인플러스 주식회사 Debugger blocking method and system for program protection

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064712A1 (en) 2002-09-27 2004-04-01 Intel Corporation Systems and methods for protecting media content
KR20060059792A (en) * 2004-11-29 2006-06-02 주식회사 안철수연구소 Method for preventing from debugging computer program in real time and recording material thereof
KR20070001893A (en) * 2003-11-26 2007-01-04 인터내셔널 비지네스 머신즈 코포레이션 Tamper-resistant trusted virtual machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064712A1 (en) 2002-09-27 2004-04-01 Intel Corporation Systems and methods for protecting media content
KR20070001893A (en) * 2003-11-26 2007-01-04 인터내셔널 비지네스 머신즈 코포레이션 Tamper-resistant trusted virtual machine
KR20060059792A (en) * 2004-11-29 2006-06-02 주식회사 안철수연구소 Method for preventing from debugging computer program in real time and recording material thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11409635B2 (en) 2019-08-23 2022-08-09 Raytheon Company Hacker-resistant anti-debug system

Also Published As

Publication number Publication date
KR20090070585A (en) 2009-07-01

Similar Documents

Publication Publication Date Title
Agache et al. Firecracker: Lightweight virtualization for serverless applications
EP3281146B1 (en) Isolating guest code and data using multiple nested page tables
US10152602B2 (en) Protecting state information for virtual machines
RU2723668C1 (en) Event filtering for security applications of virtual machines
KR100602157B1 (en) New processor mode for limiting the operation of guest software running on a virtual machine supported by a virtual machine monitor
US9430642B2 (en) Providing virtual secure mode with different virtual trust levels each having separate memory access protections, interrupt subsystems and private processor states
US10095862B2 (en) System for executing code with blind hypervision mechanism
KR20080094952A (en) Secure operating system switching
US10120738B2 (en) Hypervisor techniques for performing non-faulting reads in virtual machines
Bazargan et al. State-of-the-art of virtualization, its security threats and deployment models
US11379385B2 (en) Techniques for protecting memory pages of a virtual computing instance
US8798267B2 (en) Virtualization of cryptographic keys
KR100939210B1 (en) Apparatus and method for prevention an debugging in a virtual environment
WO2016164424A1 (en) Isolating guest code and data using multiple nested page tables
Williams et al. Enabling efficient hypervisor-as-a-service clouds with ephemeral virtualization
US10430223B2 (en) Selective monitoring of writes to protected memory pages through page table switching
EP3314502B1 (en) Protecting state information for virtual machines
KR100928866B1 (en) Apparatus and method for running an application in a virtual environment
KR101467877B1 (en) System and method for securing process memory using Hypervisor
US20170123800A1 (en) Selective resource activation based on privilege level
US20240220297A1 (en) Interrupt control using a guest owned backing page
CN114868126A (en) Hypervisor security event handling at a processor
Hartman Virtual Memory in Today's Operating Systems
表祐志 Computer Systems Management with a Para Pass-through Virtual Machine Monitor

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: 20130121

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20140121

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20150121

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20160121

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20170123

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20180122

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20190121

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20200121

Year of fee payment: 11