KR100949949B1 - Method and Apparatus for prevention an debugging using call stack - Google Patents

Method and Apparatus for prevention an debugging using call stack Download PDF

Info

Publication number
KR100949949B1
KR100949949B1 KR1020080018163A KR20080018163A KR100949949B1 KR 100949949 B1 KR100949949 B1 KR 100949949B1 KR 1020080018163 A KR1020080018163 A KR 1020080018163A KR 20080018163 A KR20080018163 A KR 20080018163A KR 100949949 B1 KR100949949 B1 KR 100949949B1
Authority
KR
South Korea
Prior art keywords
stack
debugging
function
call
information
Prior art date
Application number
KR1020080018163A
Other languages
Korean (ko)
Other versions
KR20090092922A (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 KR1020080018163A priority Critical patent/KR100949949B1/en
Publication of KR20090092922A publication Critical patent/KR20090092922A/en
Application granted granted Critical
Publication of KR100949949B1 publication Critical patent/KR100949949B1/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
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Abstract

본 발명은 콜 스택(call stack)을 이용한 디버깅 방지 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for preventing debugging using a call stack.

본 발명의 실시예에 따른 콜 스택을 이용한 디버깅 방지 방법은 함수 간의 호출 관계를 나타내는 콜 스택(Call Stack)에 있어서, 콜 스택 상의 특정 함수 중 디버깅 방지 대상 함수를 선택하는 단계, 선택된 디버깅 방지 대상 함수에 대한 콜 스택 상의 위치 정보를 포함하고 있는 스택 정보를 소정의 값으로 변경하는 단계, 및 디버깅 방지 대상 함수의 스택 정보를 변경 전의 값으로 복원하는 단계를 포함한다.In the debugging prevention method using a call stack according to an embodiment of the present invention, in the call stack indicating a call relationship between functions, selecting a debugging prevention function among specific functions on the call stack, the selected debugging prevention function Changing the stack information including the position information on the call stack with respect to a predetermined value, and restoring the stack information of the function to be debugged to the value before the change.

본 발명에 따르면, 어플리케이션의 실행에는 영향을 주지 않으면서도 콜 스택 정보를 변경하여 특정 기능의 호출 여부를 숨기거나 수행 과정의 확인을 차단할 수 있기 때문에, 디버거 등과 같은 해킹 툴을 통해 콜 스택 정보를 확인함으로써 프로그램을 해킹하려 하는 것을 방지하는 것이 가능해진다.According to the present invention, since the call stack information can be changed without affecting the execution of the application, the call stack information can be checked through a hacking tool such as a debugger, so as to hide whether or not a specific function is called or block the confirmation of the execution process. This makes it possible to prevent the program from being hacked.

콜 스택, 베이스포인터, 복귀주소, EBP, RET, 디버깅 방지 Call Stack, Base Pointer, Return Address, EBP, RET, Debugging Prevention

Description

콜 스택을 이용한 디버깅 방지 방법 및 장치{Method and Apparatus for prevention an debugging using call stack}Method and Apparatus for prevention an debugging using call stack}

본 발명은 콜 스택을 이용한 디버깅 방지 방법 및 장치에 관한 것으로서, 더욱 상세하게는 디버거를 이용하여 특정 어플리케이션에 대한 콜 스택 정보를 확인하고 함수 수행 과정을 분석하는 디버깅을 방지하는 방법 및 장치 관한 것이다. The present invention relates to a method and apparatus for preventing debugging using a call stack. More particularly, the present invention relates to a method and apparatus for preventing debugging using a debugger to check call stack information for a specific application and analyze a function execution process.

컴퓨터 과학에서, 콜 스택은 실행되는 프로그램의 서브루틴(subroutine)에 관한 정보, 즉 함수 간의 호출 관계에 관한 정보를 동적으로 저장하고 있는 스택 데이터 구조이다. 콜 스택은 다양한 목적으로 사용되며, 중요한 목적 중 하나는 함수 실행 중 각 서브 루틴이 종료될 시에 돌아올 지점에 관한 정보(예컨대, 인스트럭션 주소)를 저장하는 것이다. In computer science, a call stack is a stack data structure that dynamically stores information about subroutines of a program being executed, that is, information about call relationships between functions. The call stack is used for a variety of purposes, and one of the important purposes is to store information (eg, instruction addresses) about where to return when each subroutine terminates during function execution.

하나의 프로그램이 진행될 때에는 하나의 함수 내에서도 여러 서브 함수가 실행되게 된다. 이 때, 상위 호출 함수의 스택 참조 위치와 인스트럭션 처리를 위한 상위 호출 함수의 복귀주소를 스택에 저장하게 되고 서브 함수, 즉 피호출 함수의 종료시점에 스택에 저장된 값을 참조하여 상위 호출 함수의 상태로 복귀하는 일련의 과정을 수행한다. 콜 스택은 스택 메모리로서 구성되기 때문에, 호출 함수가 복귀 주소 등을 스택에 입력(push)하고, 피호출 함수가 종료 시점에 스택으로부터 저장된 복귀 주소 등을 출력(pop)하는 동작이 이루어진다.When a program runs, several subfunctions are executed within a function. At this time, the stack reference position of the upper calling function and the return address of the upper calling function for the instruction processing are stored on the stack, and the state of the upper calling function is referred to by referring to the value stored in the stack at the end of the sub function, that is, the called function. Perform a series of steps to return to. Since the call stack is configured as a stack memory, an operation is performed in which the calling function pushes a return address or the like onto the stack, and the called function pops up a return address or the like stored from the stack at the end of the call.

도 1은 일반적인 콜 스택 메모리의 구조(100)를 도시한다.1 illustrates a structure 100 of a typical call stack memory.

스택은 LIFO(Last In First Out) 방식을 사용하며 상위 주소부터 하위 주소로 데이터를 채워 넣는 형식을 취하게 된다. 스택에는 파라미터(Parameter: PARAM)(110), 복귀 주소(Return Address: RET)(120), 베이스포인터(Base Pointer: BP)(130), 지역 변수(Local Variable: LOCAL)(140) 등이 저장되게 된다. 파라미터(110)는 함수의 파라미터에 관한 정보를 저장하는 공간이다. 복귀 주소(120)는 피호출 함수가 종료한 뒤에 CPU의 인스트럭션이 돌아가야 할 주소를 저장하는 공간이다. 즉, 특정 함수가 수행 중에 서브 루틴으로서 피호출 함수를 수행하게 되는 경우에 피호출 함수의 수행이 종료된 후 다시 피호출 함수에 대하여 상위 함수인 상기 특정 함수로 CPU의 인스트럭션이 옮겨갈 주소가 저장되는 곳으로서, 특정 함수가 피호출 함수를 호출할 시에 복귀 주소(120)를 스택에 저장하게 된다. 베이스 포인터(130)는 스택의 기준점 역할을 담당하며 일반적으로 CPU가 스택 메모리를 검색할 시에는 베이스 포인터(130)를 기준으로 하여 복귀 주소(120)나 파라미터(110) 등이 저장되어 있는 위치를 검색하게 된다. 예컨대, 스택 상에 복귀 주소(120)가 저장되어 있는 위치는 베이스 포인터(130)의 주소 + 4 바이트(byte)에 해당하는 위치가 된다. 또한, 베이스 포인터(130) 상에 저장되어 있는 정보는 베이스 포인터(130)가 저장되어 있는 스택에 대응되는 함수의 상위 호출 함수의 베이스 포인터(130)의 주소이다. 다시 말해, 베이스 포인터(130)는 자신과 관련된 스택 메모 리 상에서는 기준점이 되며, 베이스 포인터(130) 내에 저장되어 있는 정보는 상위 호출 함수의 베이스 포인터(130)의 주소로서 함수의 호출 관계를 파악하는 정보가 된다. 지역 변수(140)는 함수 실행 중에 필요한 여러 지역 변수의 값을 저장하고 있다.The stack uses the Last In First Out (LIFO) method and takes the form of filling data from upper address to lower address. The parameter stores a parameter 110 (PARAM) 110, a return address (RET) 120, a base pointer 130 (BP) 130, a local variable LOCAL 140, and the like. Will be. The parameter 110 is a space for storing information about a parameter of a function. The return address 120 is a space for storing an address to which the instruction of the CPU should return after the called function ends. That is, when a specific function executes the called function as a subroutine during execution, after the execution of the called function is finished, the address to which the instruction of the CPU is to be transferred to the specific function which is a higher function to the called function is stored. As a result, when a particular function calls a called function, the return address 120 is stored on the stack. The base pointer 130 serves as a reference point of the stack. In general, when the CPU searches the stack memory, the base pointer 130 refers to a location where the return address 120 or the parameter 110 is stored based on the base pointer 130. Search. For example, the location where the return address 120 is stored on the stack becomes a location corresponding to the address of the base pointer 130 + 4 bytes. In addition, the information stored on the base pointer 130 is the address of the base pointer 130 of the higher call function of the function corresponding to the stack in which the base pointer 130 is stored. In other words, the base pointer 130 becomes a reference point on the stack memory associated with the base pointer 130, and the information stored in the base pointer 130 identifies the call relation of the function as the address of the base pointer 130 of the higher calling function. It is information. The local variable 140 stores values of various local variables required during function execution.

위와 같이, 콜 스택에는 함수들의 호출 위치, 실행 순서 등의 정보가 담겨 있기 때문에 콜 스택에 저장된 복귀 주소(120)와 베이스 포인터(130) 등의 정보를 역으로 추적해서 프로그램이 현재까지 수행한 전체적인 흐름을 파악할 수 있고 어떠한 기능들이 수행되었는지 여부를 파악할 수 있다. 디버거와 같은 툴은 이러한 콜 스택을 일목요연하게 모니터링할 수 있도록 해준다. 따라서, 디버거 등의 해킹 툴을 사용하여 프로그램의 수행 중에 브레이크 포인트 설정 등으로 프로그램을 정지시키고 콜 스택 정보를 파악하면, 특정 프로그램의 내용 및 정보를 해킹할 수 있게 된다. 해커들은 위와 같은 해킹 방식을 통해서 특정 프로그램의 동작 방식을 파악하고 이를 모방하여 유사 프로그램을 개발하거나, 사용자의 정보를 훔쳐내는 것과 같은 불법 행위를 하는 등 여라가지 문제들이 있었다. As shown above, since the call stack contains information such as the call position and execution order of functions, the call stack traces back information such as the return address 120 and the base pointer 130 stored in the call stack, and the overall execution of the program to date. You can see the flow and see what functions have been performed. Tools such as debuggers allow you to monitor these call stacks at a glance. Therefore, if a program is stopped using a hacking tool such as a debugger and the program is stopped by setting a breakpoint, and the call stack information is grasped, the contents and information of the specific program can be hacked. Hackers have a variety of problems, such as the development of similar programs or by stealing user's information by identifying the behavior of a particular program through the above hacking method.

위와 같이 디버깅 툴에 의한 노출되는 콜스택 정보를 이용한 해킹 피해를 막기 위한 해결책이 필요하게 되었다. As above, a solution for preventing hacking damage using the call stack information exposed by the debugging tool has been needed.

본 발명은 디버깅 행위 자체를 차단하여 콜스택의 정보가 해커에게 노출되지 않도록 한다. 즉, 본 발명은 상기와 같은 문제점을 해결하기 위한 것으로 본 발명이 이루고자 하는 기술적 과제는 디버깅 툴(디버거)을 이용하여 특정 어플리케이션에 대한 콜 스택 정보를 확인하고 함수 수행 과정을 분석하는 것을 방지하는 방법 및 장치를 제공하고자 하는 것이다.The present invention blocks the debugging behavior itself so that the information of the call stack is not exposed to hackers. That is, the present invention is to solve the above problems, and the technical problem to be achieved by the present invention is a method for preventing the analysis of the process of checking the call stack information and the function execution process for a specific application using a debugging tool (debugger) And to provide a device.

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

상기 목적을 달성하기 위하여 본 발명의 실시예에 따른 콜 스택을 이용한 디버깅 방지 방법은 함수 간의 호출 관계를 나타내는 콜 스택에 있어서, 콜 스택 상의 함수 중 디버깅 방지 대상 함수를 선택하는 단계, 선택된 디버깅 방지 대상 함수의 콜 스택 상에서의 상대적 위치를 나타내는 스택 정보를 소정의 값으로 변경하는 단계, 및 디버깅 방지 대상 함수의 스택 정보를 변경 전의 값으로 복원하는 단계를 포함한다.In order to achieve the above object, a method for preventing debugging using a call stack according to an embodiment of the present invention includes selecting a function to be prevented from debugging on a call stack in a call stack indicating a call relationship between functions, and selecting the selected debugging prevention object. Changing the stack information indicating the relative position of the function on the call stack to a predetermined value, and restoring the stack information of the function to be debugged to the value before the change.

바람직하게는 스택 정보는 상기 디버깅 방지 대상 함수를 호출하는 상위 호 출 함수의 스택위치정보를 포함하는 베이스 포인터를 포함한다. 또한, 더욱 바람직하게는, 상기 스택 정보는 상기 디버깅 방지 대상 함수 실행 종료 후 CPU 인스트럭션이 복귀할 주소를 포함하는 함수 복귀 주소를 포함한다.Preferably, the stack information includes a base pointer including stack position information of the upper call function that calls the debugging prevention function. Also, more preferably, the stack information may include a function return address including an address to which a CPU instruction returns after completion of execution of the anti-debugging function.

바람직하게는 변경하는 단계는 디버깅 방지 대상 함수의 스택 정보를 동일한 디지트 수(digit number)를 갖는 임의의 데이터와 배타적 논리합 연산(XOR)을 수행하는 단계를 포함하고, 복원하는 단계는 배타적 논리합 연산이 수행된 후, 디버깅 방지 대상 함수의 스택 정보를 임의의 데이터와 다시 배타적 논리합 연산을 수행하는 단계를 포함한다.Preferably, the step of modifying the stack information of the function to be debugged includes performing an exclusive OR operation with any data having the same digit number and restoring the exclusive OR operation. After the execution, the stack information of the function to be prevented to be debugged is performed with the arbitrary data and the exclusive OR operation.

바람직하게는 변경하는 단계는 디버깅 방지 대상 함수가 호출된 직후에 수행된다.Preferably, the changing step is performed immediately after the debugging prevention function is called.

바람직하게는 변경하는 단계는 디버깅 방지 대상 함수의 실행 중 임의의 시점에서 실행된다.Preferably, the changing step is executed at any point in the execution of the function to be debugged.

바람직하게는 복원하는 단계는 디버깅 방지 대상 함수가 종료되기 직전에 실행된다.Preferably, the restoring step is executed just before the debugging prevention function ends.

바람직하게는 복원하는 단계는 디버깅 방지 대상 함수의 스택 정보가 CPU에 의해서 참조되기 이전에 실행된다.Preferably, the restoring step is executed before the stack information of the function to be debugged is referred to by the CPU.

바람직하게는 변경하는 단계는 디버깅 방지 대상 함수의 스택 정보를 백업하는 단계를 포함하며, 복원하는 단계는 백업한 스택 정보로 디버깅 방지 대상 함수의 스택 정보를 복원하는 단계를 포함한다.Preferably, the step of changing includes backing up stack information of the debugging target function, and the step of restoring includes restoring stack information of the debugging target function with the backed up stack information.

바람직하게는 변경하는 단계는 디버깅 방지 대상 함수에 대한 상위 호출 함 수의 스택 정보로 디버깅 방지 대상 함수의 스택 정보를 변경한다.Preferably, the changing step changes the stack information of the anti-debugging function to the stack information of the parent call function for the anti-debugging function.

바람직하게는 변경하는 단계는 임의의 값으로 디버깅 방지 대상 함수의 스택 정보를 변경한다.Preferably, the changing step changes the stack information of the function to be prevented to debug to an arbitrary value.

바람직하게는 백업하는 단계는 별도의 메모리 공간에 디버깅 방지 대상 함수의 스택 정보를 백업한다.Preferably, the step of backing up backs up the stack information of the function to be debugged in a separate memory space.

상기 목적을 달성하기 위하여 본 발명의 일 실시예에 따른 콜 스택을 이용한 디버깅 방지 장치는 함수 간의 호출 관계를 나타내는 콜 스택에 있어서, 콜 스택 상의 함수 중 디버깅 방지 대상 함수를 선택하는 수단, 선택된 디버깅 방지 대상 함수의 콜 스택 상에서의 상대적 위치를 나타내는 스택 정보를 소정의 값으로 변경하는 수단, 및 디버깅 방지 대상 함수의 스택 정보를 변경 전의 값으로 복원하는 수단을 포함한다In order to achieve the above object, an apparatus for preventing debugging using a call stack according to an embodiment of the present invention includes a means for selecting a function to be prevented from debugging on a call stack in a call stack indicating a call relation between functions, selected debugging prevention Means for changing the stack information indicating the relative position of the target function on the call stack to a predetermined value, and means for restoring the stack information of the debugging prevention target function to the value before the change.

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

상기한 바와 같은 본 발명의 콜 스택을 이용한 디버깅 방지 장치 및 방법에 따르면 다음과 같은 효과가 있다. According to the debugging prevention apparatus and method using the call stack of the present invention as described above has the following effects.

본 발명에 따르면, 어플리케이션의 실행에는 영향을 주지 않으면서도 콜 스택 정보를 변경하여 특정 기능의 호출 여부를 숨기거나 수행 과정의 확인을 차단할 수 있기 때문에, 디버거 등과 같은 해킹 툴을 통해 콜 스택 정보를 확인함으로써 프로그램을 해킹하려 하는 것을 방지할 수 있다는 장점이 있다.According to the present invention, since the call stack information can be changed without affecting the execution of the application, the call stack information can be checked through a hacking tool such as a debugger, so as to hide whether or not a specific function is called or block the confirmation of the execution process. This has the advantage of preventing you from trying to hack your program.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다 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 the specification.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수 있음을 이해할 수 있을 것이다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다. 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 flow chart 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 performing 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.

도 2는 통상적인 프로그램 내부의 함수의 실행을 보여주는 도면이다.2 shows the execution of a function within a typical program.

프로그램에서 특정 함수가 수행하는 도중에 다른 함수를 호출하여 특정 기능을 수행하는 경우가 빈번하게 발생한다. 예컨대, 함수 C가 시작되고(200) 수행되는 도중 함수 B의 기능을 수행하여야 하는 경우, 함수 B를 호출(210)한다. 이 경우 함수 B의 수행 중에 또는 수행 후에 참조할 스택 정보를 생성하여 스택(260)에 저장하게 된다. 이후 함수 B는 자신의 실행 중에 함수 A를 호출(220)하고 이에 따 라 관련 스택 정보가 생성되어 저장된다. 함수 A가 종료하게 되면, 스택에 저장되어 있는 복귀 주소를 이용하여 CPU의 인스트럭션은 함수 B의 수행 지점으로 돌아오게 되고, 함수 A의 베이스 포인터에 저장되어 있는 주소, 즉 함수 B의 베이스 포인터의 주소를 이용하여 함수 B의 스택을 참조할 수 있게 된다.In a program, a function is frequently called to perform a specific function while another function is being executed. For example, if function C needs to be performed while function C starts and is performed, function B is called 210. In this case, stack information to be referred to during or after the execution of function B is generated and stored in the stack 260. Thereafter, the function B calls the function A 220 during its execution and accordingly, related stack information is generated and stored. When function A terminates, the instruction of the CPU returns to the execution point of function B using the return address stored on the stack, and the address stored in the function pointer's base pointer, that is, the address of the function pointer's base pointer. You can refer to the stack of function B using.

따라서, 프로그램을 특정 시점에 정지시키고 콜 스택, 즉 호출 스택을 역으로 확인하면 프로그램의 수행 순서 및 호출된 함수 등을 파악할 수 있게 되며, 이와 같은 방법을 통해 프로그램을 해킹할 수 있다는 문제점이 있었다.Therefore, if the program is stopped at a specific point in time and the call stack, ie, the call stack, is checked in reverse, the execution order of the program, the called functions, and the like can be identified.

도 3은 본 발명의 일 실시예에 따른 콜 스택을 이용한 디버깅 방지 방법의 흐름도이다.3 is a flowchart illustrating a debugging prevention method using a call stack according to an embodiment of the present invention.

먼저, 콜 스택 상의 함수 중 감추고자 하는 함수, 즉 디버깅 방지 대상 함수를 선택하는 단계(S310)를 포함한다. 다음으로, 디버깅 방지 대상 함수의 콜 스택 상에서의 상대적 위치에 대한 정보를 포함하고 있는 스택 정보를 소정의 값으로 변경하는 단계(S320)를 포함한다. 예컨대 함수 B가 수행된다는 사실을 감추어서 프로그램의 동작 과정에 대한 디버깅을 방지하고자 하는 경우, 함수 B로의 복귀 주소 및 베이스 포인터 등의 스택 정보를 갖고 있는 스택에 기록된 정보를 변경시킨다. 만약 함수 B와 관련된 스택 정보를 함수 C에 관한 스택 정보로 변경시킬 경우, 콜 스택을 통하여 함수의 수행 과정을 디버깅 하게 될 경우 함수 C가 바로 함수 A를 호출하고 이후 다시 함수 C로 복귀한 것으로 보이게 된다. 즉, 함수 B가 수행되었다는 사실은 콜 스택 상에서는 확인되지 않는다. 이후, 디버깅 방지 대상 함수의 스택 정보를 변경시키기 전의 스택 정보로 복원하여(S330) 프로그램이 정상적으로 동작할 수 있도록 한다. 즉, 디버깅을 방지하기 위하여 특정 기간 동안 스택 정보를 변경하여 두지만, 실제로 프로그램이 스택 정보를 참조하여 동작하여야 하는 시기에는 정상적인 스택 정보를 참조할 수 있도록 하는 것이다. First, a step S310 of selecting a function to be hidden, that is, a function to be prevented from debugging, among functions on the call stack is included. Next, a step (S320) of changing stack information including information about a relative position on the call stack of the debugging prevention function to a predetermined value is included. For example, if you want to hide the fact that function B is being executed to prevent debugging of the program's operation, change the information recorded on the stack containing stack information such as return address and base pointer to function B. If you change the stack information for function B to the stack information for function C, if you debug the execution of the function through the call stack, it will appear that function C calls function A immediately and then returns to function C. do. In other words, the fact that function B is executed is not confirmed on the call stack. Thereafter, the stack is restored to the stack information before changing the stack information of the debugging prevention target function (S330) so that the program can operate normally. In other words, the stack information is changed for a certain period to prevent debugging, but when the program needs to operate by referring to the stack information, it can refer to the normal stack information.

이하에서는 스택 정보 변경 방법, 변경 시점 및 복원 시점 등에 대한 보다 구체적인 실시예를 살펴본다.Hereinafter, a detailed embodiment of a stack information change method, a change point, and a restore point will be described.

보다 구체적으로, 변경시킬 스택 정보는 앞서 설명한 바와 같이, CPU의 인스트럭션이 복귀할 주소를 저장하는 복귀 주소 또는 스택의 위치 정보를 저장하며 스택 참조의 기준이 되는 베이스 포인터가 될 수 있으며, 또는 복귀 주소와 베이스 포인터 모두를 변경시킬 수도 있으며 이는 디버거 등과 같은 해킹 툴이 콜 스택을 이용한 디버깅을 시도할 경우에 참조하는 정보에 따라 결정될 수 있을 것이다.More specifically, as described above, the stack information to be changed may be a return address storing an address to which the instruction of the CPU returns, or a base pointer that stores stack position information and is a reference of a stack reference, or a return address. You can also change both the and the base pointers, which may be determined by the information referenced by hacking tools such as debuggers when attempting to debug using the call stack.

스택 정보를 변경시키는 방법의 일 실시예로는 배타적 논리합(XOR)을 사용하는 방법이 있다. 변경시키고자 하는 스택 정보를 임의의 데이터와 배타적 논리합 연산을 취하여 변경시킨 후 다시 원래의 데이터로 복원시킬 시에 동일한 데이터와 배타적 논리합 연산을 취하면 변경 전의 스택 정보를 복원시킬 수 있다.One embodiment of a method for changing stack information is using an exclusive OR. When the stack information to be changed is taken by using an exclusive OR operation with arbitrary data and then restored to original data, the stack information before the change can be restored by performing the exclusive OR operation with the same data.

스택 정보를 변경시키는 또 다른 실시예로는 디버깅을 방지하고자 하는 함수의 스택 정보를 상위의 호출 함수의 스택 정보로 변경시키는 방법이 있다. 예컨대 자신의 하위 호출 함수의 복귀 주소를 자신의 주소가 아닌 자신을 호출하는 상위 호출 함수의 복귀 주소로 변경시킨다면, 콜 스택 상에서는 상위 호출 함수가 바로 하위 호출 함수를 호출한 것으로 보이게 되며 자신이 프로그램에서 수행되었다는 사실은 콜 스택 상에서는 나타나지 않게 된다.Another embodiment of changing the stack information is a method of changing the stack information of a function to be prevented from debugging into stack information of a higher calling function. For example, if you change the return address of your subcall function to the return address of the calling function that calls you, not your own address, the calling function will appear to be calling the lower call function directly on the call stack and you The fact that it is done will not appear on the call stack.

스택 정보를 변경시키는 또 다른 예로는 디버깅을 방지하고자 하는 함수의 스택 정보를 임의의 값으로 변경시키는 방법이 있다. 이와 경우 디버거를 통해 프로그램의 수행 과정을 확인하려 해도 참조되는 정보가 정확하지 않은 값으로 보이기 때문에 콜 스택을 확인하는 것이 불가능하게 된다.Another example of changing the stack information is to change the stack information of a function to be prevented from debugging to an arbitrary value. In this case, even if you try to verify the execution of the program through the debugger, it becomes impossible to check the call stack because the referenced information appears to be inaccurate.

바람직하게는 스택 정보를 변경하는 단계는, 디버깅 방지 대상 함수의 스택 정보를 변경시키기 전에 원래의 스택 정보를 백업하는 단계를 포함한다. 전술한 바와 같이 스택 정보를 변경시킨 후 보호하고자 하는 프로그램이 정상적으로 동작하기 위해서는 정상적인 스택으로 복원시키는 단계가 필요하게 되며 이를 위해 변경 전의 스택 정보를 백업해야 할 필요가 있을 수 있다. 스택 정보의 백업은 별도의 메모리 공간에 스택 정보를 백업하여 저장하는 방법을 포함하여, 본 기술분야에서 통상적으로 사용되는 데이터 백업 방법으로 수행될 수 있다.Preferably, changing the stack information includes backing up the original stack information before changing the stack information of the function to be debugged. As described above, in order for a program to be protected after changing the stack information to operate normally, a step of restoring to the normal stack is required, and for this purpose, it may be necessary to back up the stack information before the change. The backup of the stack information may be performed by a data backup method commonly used in the art, including a method of backing up and storing stack information in a separate memory space.

전술한 바와 같이 스택 정보를 변경하는 시점은 다양하게 선택될 수 있다. 바람직하게는, 함수가 호출된 직후에 스택 정보를 변경할 수 있다. 이와 같은 경우, 해당 함수는 가장 오랜 시간 동안 스택 정보가 숨겨진 채로 수행되며 따라서 콜 스택을 이용하여 디버깅을 시도하려는 동작을 효과적을 방지할 수 있게 된다. 그러나, 필요에 따라, 변경 시점은 함수가 호출된 이후 실행 중의 임의의 시점에 변경될 수도 있다.As described above, a time point for changing the stack information may be variously selected. Preferably, the stack information can be changed immediately after the function is called. In such a case, the function is executed with the stack information hidden for the longest time, thus effectively preventing the attempt to debug using the call stack. However, if desired, the change point may change at any point during execution after the function is called.

또한, 변경된 스택 정보는 디버깅 방지 대상 프로그램이 실행되면서 실제로 그 스택 정보를 참조하기 전에 실제 프로그램의 동작이 비정상적으로 동작하지 않도록 변경 전의 값으로 복원하는 것이 필요하다. 바람직하게는, 해당 함수의 스택 이 CPU에 의해서 참조되기 바로 전에 복원하는 방법이 있다. 이를 통해 스택 정보를 가장 오랜 시간 동안 숨길 수 있게 된다. 또한, 함수가 종료되기 직전에 복원하는 것도 한 방법이며, 그 이외에도 복원 시점은 디버깅 대상 방지 함수가 종료되기 이전의 임의의 시점이 될 수도 있다.In addition, it is necessary to restore the changed stack information to the value before the change so that the operation of the actual program does not operate abnormally before the program to be debugged is actually executed while the program to be debugged is executed. Preferably, there is a way to restore the stack of functions just before they are referenced by the CPU. This allows the stack information to be hidden for the longest time. In addition, restoring the function just before the function ends is another method. In addition, the restoring time may be any point before the debugging target prevention function ends.

도 4는 본 발명의 일 실시예에 따른 콜 스택을 이용한 디버깅 방지 장치의 구성을 나타내는 블록도이다.4 is a block diagram illustrating a configuration of an apparatus for preventing debugging using a call stack according to an embodiment of the present invention.

콜 스택을 이용한 디버깅 장치는 스택 메모리부(410), 스택 정보 백업부(420), 스택 정보 선택부(430), 스택 정보 변경부(440) 및 스택 정보 복원부(450)로 구성된다.The debugging apparatus using the call stack includes a stack memory unit 410, a stack information backup unit 420, a stack information selecting unit 430, a stack information changing unit 440, and a stack information restoring unit 450.

스택 메모리부(410)는 콜 스택을 구성하는 스택 메모리를 포함한다. 각 함수의 스택 정보가 이 스택 메모리부에 저장되며 이를 참조하여 콜 스택을 구성하고 프로그램이 동작하게 된다.The stack memory unit 410 includes a stack memory constituting the call stack. The stack information of each function is stored in this stack memory section, and this is used to construct a call stack and to run a program.

스택 정보 백업부(420)는 스택 정보의 백업이 필요한 경우, 해당 스택 정보를 백업하고 저장하는 역할을 담당한다. 백업되는 공간은 별도의 메모리 등 본 기술분야에서 통상적으로 사용할 수 있는 백업 수단 및 방법을 모두 포함한다.When the stack information backup unit 420 needs to back up the stack information, the stack information backup unit 420 is responsible for backing up and storing the stack information. The space to be backed up includes all the backup means and methods commonly available in the art, such as a separate memory.

스택 정보 선택부(430)는 디버깅 방지 대상 함수의 상위 또는 하위 호출 함수의 스택 등 스택 메모리부 상에서 접근 가능한 스택으로 디버깅 방지 대상 함수의 스택을 변경하는 경우 스택을 선택하고 저장하는 역할을 담당한다. 이는 스택 정보를 다른 스택 정보로 변경하는 경우에 동작하는 구성요소이다.The stack information selector 430 plays a role of selecting and storing a stack when a stack of an anti-debugging function is changed to a stack accessible on a stack memory unit such as a stack of an upper or lower calling function of an anti-debugging function. This is a component that operates when changing stack information to other stack information.

스택 정보 변경부(440)는 감추고자 하는 함수의 스택 정보를 변경하는 부분 이며, 이는 전술한 바와 같이 논리적 배타합을 통한 변경, 다른 스택 정보로의 변경, 임의의 값으로의 변경 등의 동작으로 스택 정보를 변경하는 역할을 담당한다.The stack information changing unit 440 is a part for changing stack information of a function to be hidden, and as described above, the stack information changing unit 440 changes the data through logical exclusive sum, changes to other stack information, and changes to an arbitrary value. It is responsible for changing the stack information.

스택 정보 복원부(45)는 스택 정보 변경부(440)에서 변경된 스택 정보가 다시 프로그램에 의해서 참조되기 이전에 복원하는 역할을 담당하는 부분이다. 스택 정보 백업부(420)에 백업되어 있는 정보를 참조하여 복원할 수도 있고, 스택 정보 변경부(440)에서 행한 논리적 배타합에서 사용된 데이터와 동일한 데이터로 다시 한 번 논리적 배타합을 수행하여 스택 정보를 복원할 수도 있다.The stack information restoring unit 45 is a part that restores the stack information changed by the stack information changing unit 440 before being referred to by the program again. The information backed up by the stack information backup unit 420 may be restored, or the stack may be performed once again with the same data as the data used in the logical exclusive sum performed by the stack information changing unit 440. You can also restore the information.

지금까지 도 4의 각 구성요소는 소프트웨어(software) 또는, FPGA(field-programmable gate array)나 ASIC(application-specific integrated circuit)과 같은 하드웨어(hardware)를 의미할 수 있다.  그렇지만 상기 구성요소들은 소프트웨어 또는 하드웨어에 한정되는 의미는 아니며, 어드레싱(addressing)할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 실행시키도록 구성될 수도 있다.  상기 구성요소들 안에서 제공되는 기능은 더 세분화된 구성요소에 의하여 구현될 수 있으며, 복수의 구성요소들을 합하여 특정한 기능을 수행하는 것으로 구현할 수도 있다.  뿐만 아니라, 상기 구성요소들은 시스템 내의 하나 또는 그 이상의 컴퓨터들을 실행시키도록 구현될 수 있다. 또한, 모든 구성요소가 필수 구성요소이지는 않으며, 본 발명의 기술적 사상을 벗어나지 않는 범위에서 포함되지 않거나 복수로 포함될 수도 있다.Until now, each component of FIG. 4 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. In addition, not all components are essential components and may not be included or included in a plurality without departing from the spirit of the present invention.

본 발명은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CO-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있으며, 또한 캐리어 웨이브(예를 들어 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.The present invention can be embodied as computer readable codes on a computer readable recording medium. The computer-readable recording medium includes all kinds of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable recording media include ROM, RAM, CO-ROM, magnetic tape, floppy disks, optical data storage devices, and the like, which may also be implemented in the form of carrier waves (for example, transmission over the Internet). Include. The computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.

이상 첨부된 도면을 참조하여 본 발명의 실시예를 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 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. It is therefore to be understood that the above-described embodiments are illustrative in all aspects and not restrictive.

도 1은 통상적인 컴퓨터에서의 콜 스택 메모리의 구조이다. 1 is a structure of a call stack memory in a typical computer.

도 2는 통상적인 프로그램 내부의 함수의 실행을 보여주는 도면이다.2 shows the execution of a function within a typical program.

도 3은 본 발명의 일 실시예에 따른 콜 스택을 이용한 디버깅 방지 방법의 흐름도이다. 3 is a flowchart illustrating a debugging prevention method using a call stack according to an embodiment of the present invention.

도 4는 본 발명의 일 실시예에 따른 콜 스택을 이용한 디버깅 방지 장치의 구성을 나타내는 블록도이다.4 is a block diagram illustrating a configuration of an apparatus for preventing debugging using a call stack according to an embodiment of the present invention.

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

400: 콜 스택을 이용한 디버깅 방지 장치 410: 스택 메모리부400: debugging prevention device using a call stack 410: stack memory unit

420: 스택 정보 백업부 430: 스택 정보 선택부420: stack information backup unit 430: stack information selection unit

440: 스택 정보 변경부 450: 스택 정보 복원부440: stack information changing unit 450: stack information restoring unit

Claims (15)

함수 간의 호출 관계를 나타내는 콜 스택(Call Stack)에 있어서,In a call stack that shows the call relationship between functions, 상기 콜 스택 상의 함수 중 디버깅 방지 대상 함수를 선택하는 단계;Selecting a function to be prevented from debugging among the functions on the call stack; 상기 선택된 디버깅 방지 대상 함수의 콜 스택 상에서의 상대적 위치를 나타내는 스택 정보를 소정의 값으로 변경하는 단계; 및Changing stack information indicating a relative position on a call stack of the selected debugging prevention function to a predetermined value; And 상기 디버깅 방지 대상 함수의 상기 스택 정보를 상기 변경 전의 값으로 복원하는 단계를 포함하는Restoring the stack information of the debugging prevention target function to a value before the change; 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 1 항에 있어서,The method of claim 1, 상기 스택 정보는 상기 디버깅 방지 대상 함수를 호출하는 상위 호출 함수의 스택위치정보를 포함하는 베이스 포인터(BP)를 포함하는 것을 특징으로 는 The stack information may include a base pointer (BP) including stack position information of an upper call function that calls the debugging prevention target function. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 1 항에 있어서,The method of claim 1, 상기 디버깅 방지 대상 함수의 실행 종료 후 CPU 인스트럭션이 복귀할 주소를 포함하는 함수 복귀 주소(RET)를 포함하는 것을 특징으로 하는And a function return address (RET) including an address to which the CPU instruction returns after the execution of the debugging prevention target function ends. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 1 항에 있어서,The method of claim 1, 상기 변경하는 단계는 상기 디버깅 방지 대상 함수의 스택 정보를 동일한 디지트 수(digit number)를 갖는 임의의 데이터와 배타적 논리합 연산(XOR)을 수행하는 단계를 포함하고,The changing may include performing exclusive OR operation (XOR) with arbitrary data having the same digit number in the stack information of the function to be debugged, 상기 복원하는 단계는 상기 배타적 논리합 연산이 수행된 후, 상기 디버깅 방지 대상 함수의 스택 정보를 상기 임의의 데이터와 다시 배타적 논리합 연산을 수행하는 단계를 포함하는The restoring may include, after the exclusive OR operation is performed, performing exclusive OR operation on the stack information of the function to be debugged again with the arbitrary data. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 4 항에 있어서,The method of claim 4, wherein 상기 변경하는 단계는 상기 디버깅 방지 대상 함수가 호출된 직후에 수행되는The changing may be performed immediately after the debugging prevention target function is called. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 4 항에 있어서,The method of claim 4, wherein 상기 변경하는 단계는 상기 디버깅 방지 대상 함수의 실행 중 임의의 시점에서 실행되는The changing may be performed at any point during execution of the debugging prevention target function. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 4 항에 있어서,The method of claim 4, wherein 상기 복원하는 단계는 상기 디버깅 방지 대상 함수가 종료되기 직전에 실행되거나는The restoring may be performed immediately before the debugging prevention target function ends. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 4 항에 있어서,The method of claim 4, wherein 상기 복원하는 단계는 상기 디버깅 방지 대상 함수의 스택 정보가 CPU에 의해서 참조되기 이전에 실행되는The restoring may be performed before the stack information of the function to be debugged is referenced by the CPU. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 1 항에 있어서,The method of claim 1, 상기 변경하는 단계는 상기 디버깅 방지 대상 함수의 스택 정보를 백업하는 단계를 포함하며,The changing may include backing up stack information of the function to be prevented from debugging, 상기 복원하는 단계는 상기 백업한 스택 정보로 상기 디버깅 방지 대상 함수의 스택 정보를 복원하는 단계를 포함하는The restoring may include restoring stack information of the debugging prevention function to the backed up stack information. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 9 항에 있어서,The method of claim 9, 상기 변경하는 단계는 상기 디버깅 방지 대상 함수를 호출하는 상위 호출 함수의 스택 정보로 상기 디버깅 방지 대상 함수의 스택 정보를 변경하는 것을 특징으로 하는 The changing may include changing stack information of the anti-debugging function into stack information of an upper call function that calls the anti-debugging function. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 9 항에 있어서,The method of claim 9, 상기 변경하는 단계는 임의의 값으로 상기 디버깅 방지 대상 함수의 스택 정보를 변경하는The changing may include changing stack information of the debugging prevention target function to an arbitrary value. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 9 항에 있어서,The method of claim 9, 상기 백업하는 단계는 별도의 메모리 공간에 상기 디버깅 방지 대상 함수의 스택 정보를 백업하는The backing up may include stacking stack information of the debugging prevention target function in a separate memory space. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 제 1 항에 있어서,The method of claim 1, 상기 변경하는 단계는 상기 디버깅 방지 대상 함수의 스택 정보를 일정한 법칙에 의해 암호화하는 단계를 포함하고,The changing may include encrypting stack information of the function to be debugged by a certain law, 상기 복원하는 단계는 상기 암호화 하는 단계가 수행된 후, 상기 암호화된 디버깅 방지 대상 함수의 스택 정보를 상기 일정한 법칙에 따라 다시 복호화하는 단계를 포함하는The restoring may include decrypting the stack information of the encrypted debugging prevention function according to the predetermined rule after the encrypting is performed. 콜 스택을 이용한 디버깅 방지 방법.How to prevent debugging using the call stack. 함수 간의 호출 관계를 나타내는 콜 스택에 있어서,In the call stack that represents the call relationship between functions, 상기 콜 스택 상의 함수 중 디버깅 방지 대상 함수를 선택하는 수단;Means for selecting a function to be prevented from debugging among the functions on the call stack; 상기 선택된 디버깅 방지 대상 함수의 콜 스택 상에서의 상대적 위치를 나타내는 스택 정보를 소정의 값으로 변경하는 수단; 및Means for changing stack information indicating a relative position on a call stack of the selected debugging prevention function to a predetermined value; And 상기 디버깅 방지 대상 함수의 상기 스택 정보를 상기 변경 전의 값으로 복원하는 수단을 포함하는Means for restoring the stack information of the anti-debugging function to a value before the change; 콜 스택을 이용한 디버깅 방지 수단.Means to prevent debugging using call stack. 제 1 항 내지 제 13 항 중 어느 한 항에 의한 방법을 컴퓨터 상에서 실행하기 위한 컴퓨터로 읽을 수 있는 프로그램을 기록한 기록매체.A recording medium having recorded thereon a computer readable program for executing the method according to any one of claims 1 to 13 on a computer.
KR1020080018163A 2008-02-28 2008-02-28 Method and Apparatus for prevention an debugging using call stack KR100949949B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020080018163A KR100949949B1 (en) 2008-02-28 2008-02-28 Method and Apparatus for prevention an debugging using call stack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020080018163A KR100949949B1 (en) 2008-02-28 2008-02-28 Method and Apparatus for prevention an debugging using call stack

Publications (2)

Publication Number Publication Date
KR20090092922A KR20090092922A (en) 2009-09-02
KR100949949B1 true KR100949949B1 (en) 2010-03-30

Family

ID=41301454

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020080018163A KR100949949B1 (en) 2008-02-28 2008-02-28 Method and Apparatus for prevention an debugging using call stack

Country Status (1)

Country Link
KR (1) KR100949949B1 (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

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010040981A (en) * 1998-02-26 2001-05-15 케네쓰 올센 Stack-based security requirements
KR20070109539A (en) * 2006-05-11 2007-11-15 주식회사 팬택앤큐리텔 Debuging method for output call stack information in runtime

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010040981A (en) * 1998-02-26 2001-05-15 케네쓰 올센 Stack-based security requirements
KR20070109539A (en) * 2006-05-11 2007-11-15 주식회사 팬택앤큐리텔 Debuging method for output call stack information in runtime

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
KR20090092922A (en) 2009-09-02

Similar Documents

Publication Publication Date Title
US9465717B2 (en) Native code profiler framework
CN105843741B (en) Information processing method and device for application program
US6634020B1 (en) Uninitialized memory watch
CN109643345B (en) Techniques for deterministic code stream integrity protection
US9465721B2 (en) Snapshotting executing code with a modifiable snapshot definition
US10050797B2 (en) Inserting snapshot code into an application
US8997056B2 (en) Directed graphs pertaining to read/write operations
US8997059B2 (en) Reverse debugging
JP7154365B2 (en) Methods for securing software code
US9459991B2 (en) Heap dump object identification in a heap dump analysis tool
US8683448B2 (en) Protecting integrity of breakpoints in a software debugger
CN108021791B (en) Data protection method and device
US20110029953A1 (en) System and Method for Scalable Handling of Debug Information
CN113467981A (en) Exception handling method and device
CN109582542B (en) Method for dumping core of embedded system
KR100949949B1 (en) Method and Apparatus for prevention an debugging using call stack
WO2007071615A1 (en) Methods, apparatus and computer programs for handling parameters associated with call statements
CN111897559B (en) Hot update code detection method and device, electronic equipment and storage medium
KR101685299B1 (en) Automated testing method and apparatus for program processable non-deterministic events
CN108334351A (en) A kind of method and device of modification boot sequence
WO2019114812A1 (en) Method for preventing malicious code compilation, storage medium and electronic device
US10802715B2 (en) Mounting a drive to multiple computing systems
CN111682991B (en) Bus error message processing method and device
CN110046004B (en) Method and device for adapting automatic reference counting ARC (ARC resistance) characteristics and electronic equipment
US9575831B2 (en) Detecting the use of stale data values due to weak consistency

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130322

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20140324

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20160322

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20170322

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20180322

Year of fee payment: 9