waliedassar

SystemFunction0035

Jan 14th, 2013
207
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //http://waleedassar.blogspot.com
  2. //http://www.twitter.com/waleedassar
  3.  
  4. //On windows 7, the cryptsp.dll exports a function called "SystemFunction035"
  5. //This function Silently detects kernel debuggers. It wraps up call to the
  6. //"ZwQuerySystemInformation" function with the "SystemInformationClass" parameter set
  7. //to SystemKernelDebuggerInformation (0x23).
  8. //If a kernel debugger is detected, the function returns 1.
  9.  
  10.  
  11. typedef unsigned long(__stdcall *SysFunc0035)(wchar_t*);
  12.  
  13. void main()
  14. {
  15.     HMODULE hM=LoadLibrary("cryptsp.dll");
  16.     if(hM)
  17.     {
  18.           SysFunc0035 SystemFunction035=(SysFunc0035)GetProcAddress(hM,"SystemFunction035");
  19.           if(SystemFunction035)
  20.           {
  21.               //This silently wraps up a call to the "ZwQuerySystemInformation" function.
  22.               unsigned long ret=SystemFunction035(L"xxxsxxxx::AnyThing::xxxxxxxxxd");
  23.               if(ret==1)
  24.               {
  25.                   printf("Kernel debugger detected!!\r\n");
  26.                   ExitProcess(-1);
  27.               }
  28.               else printf("Expected\r\n");
  29.           }
  30.           FreeLibrary(hM);
  31.     }
  32.     return;
  33. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×