-
-
Save spnow/820a7b84f0207130d307ef6cb7564acb 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