<!-- HTML generated using hilite.me -->
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18using System; using System.Diagnostics; using System.Runtime.InteropServices; public class DetectDebugger { [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] static extern bool CheckRemoteDebuggerPresent(IntPtr hProcess, ref bool isDebuggerPresent); public static void Main() { bool isDebuggerPresent = false; CheckRemoteDebuggerPresent(Process.GetCurrentProcess().Handle, ref isDebuggerPresent); Console.WriteLine("Debugger Attached: " + isDebuggerPresent); Console.ReadLine(); } }

C# 디버거 감지 코드 ( 겉멋용 )


아마 1, 2번은 별 도움 안될듯 질문에 대한 답변이 아니라


1. 실행 코드 암호화 ( 난독화 )


2. 필요 이상으로 메모리에 중요한 정보를 보관하지마라

관련 레퍼런스 https://www.symantec.com/connect/articles/windows-anti-debug-reference

RtlZeroMemory 이용한 방법을 추천함 개인적으로는

Debugger.IsAttached는 사용하지 않는 것을 권장함


-- 도움 안될듯 한 내용 경계선 --


3. 안티 디버그 보호 기술 구현

http://www.codeproject.com/Articles/1090943/Anti-Debug-Protection-Techniques-Implementation-an

링크 내에 항목들 중에 이해 안가는거 있으면 1시 10분 전까지 댓글 달면 설명해드림

근데 워낙 설명이 잘 되어 있어서 상관 없을듯 ^^