
printf("Enter process ID: ");
std::cin >> processID;
printf("PID=%d\n",processID);
processHandle = OpenProcess(PROCESS_ALL_ACCESS,FALSE,processID);
if(processHandle == NULL)
{
printf("Error unable to open process. Error code: %d", GetLastError());
std::cin.get();
return 0;
}
baseAddress = VirtualAllocEx(
processHandle,
NULL,
256,
MEM_COMMIT|MEM_RESERVE,
PAGE_READWRITE);
if(baseAddress == NULL)
{
printf("Error unable to alocate memmory in remote process. Error code: %d. Press any key to exit", GetLastError());
std::cin.get();
return 0;
}