waliedassar

VirtualPC Reset Trick

Oct 8th, 2012
1,446
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //http://waleedassar.blogspot.com (@waleedassar)
  2. //Executing "\x0F\xC7\xC8\x05\x00" in VirtualPC 2007 triggers a reset error.
  3. #include "stdafx.h"
  4. #include "windows.h"
  5. #include "stdio.h"
  6.  
  7. bool flag=false;
  8.  
  9. int __cdecl Handler(EXCEPTION_RECORD* pRec,void* est,unsigned char* pContext,void* disp)
  10. {
  11.     if(pRec->ExceptionCode==0xC000001D  || pRec->ExceptionCode==0xC000001E || pRec->ExceptionCode==0xC0000005)
  12.     {
  13.         flag=true;
  14.         (*(unsigned long*)(pContext+0xB8))+=5;
  15.         return ExceptionContinueExecution;
  16.     }
  17.     return ExceptionContinueSearch;
  18. }
  19.  
  20.  
  21.  
  22. int main(int argc, char* argv[])
  23. {
  24.     __asm
  25.     {
  26.         push offset Handler
  27.         push dword ptr fs:[0x0]
  28.         mov dword ptr fs:[0x0],esp
  29.     }
  30.     flag=false;
  31.     __asm
  32.     {
  33.         __emit 0x0F
  34.         __emit 0xC7
  35.         __emit 0xC8
  36.         __emit 0x05
  37.         __emit 0x00
  38.     }
  39.     if(flag==false)
  40.     {
  41.           MessageBox(0,"VirtualPC detected","waliedassar",0);
  42.     }
  43.     __asm
  44.     {
  45.         pop dword ptr fs:[0x0]
  46.         pop eax
  47.     }
  48.     return 0;
  49. }
RAW Paste Data