본문 바로가기

Programming

IsDebuggerPresent

반응형

어제 CodeEngn 문제를 풀다가 IsDebuggerPresent를 만나게 되었는데

우회는 할 줄 알지만 어떤 구조로 되어있는지 몰라 궁금하여 공부한걸 한번 끄적여 봅니다 :)


IsDebuggerPresent() 란

유저모드 디버거 탐지 함수이며, 커널모드 디버거는 탐지가 불가하며

디버거가 탐지되는 경우에는 1을 반환하며, 탐지되지 않는 경우에는 0을 반환한다.

(정확하게 말하면 탐지되는 경우에는 zero, 탐지되지 않는 경우에는 nonzero가 반환된다)


MSDN 내용

Return value

If the current process is running in the context of a debugger, the return value is nonzero.

If the current process is not running in the context of a debugger, the return value is zero.


유저모드 디버거 탐지 Source code


반응형