Created
June 18, 2015 08:33
-
-
Save evernick/3a7b3f82e0de54ca1064 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<windows.h> | |
#include<stdio.h> | |
typedef DWORD (WINAPI *PFZWSETINFORMATIONTHREAD) ( | |
HANDLE ThreadHandle, | |
DWORD ThreadInformationClass, // Original : _THREAD_INFORMATION_CLASS | |
PVOID ThreadInformation, | |
ULONG ThreadInformationLength | |
); | |
void anti_debug() | |
{ | |
PFZWSETINFORMATIONTHREAD pfZwSetInformationThread; | |
HMODULE h_ntdll = GetModuleHandle("ntdll.dll"); | |
pfZwSetInformationThread = (PFZWSETINFORMATIONTHREAD)GetProcAddress(h_ntdll, "ZwSetInformationThread"); | |
pfZwSetInformationThread(GetCurrentThread(), 0x11, 0, 0); // 0x11 : ThreadHideFromDebugger | |
printf("Debugger Dettached\n"); | |
} | |
int main(int argc, char **argv) | |
{ | |
anti_debug(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment