Advertisement
shekohex

WriteToMemory

Aug 17th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. void WriteToMemory(DWORD pAddress, void* pBuffer, int iSize)
  2.     {
  3.         DWORD Protect = NULL;
  4.         VirtualProtect((void*)pAddress, iSize, PAGE_EXECUTE_READWRITE, &Protect);
  5.         WriteProcessMemory(GetCurrentProcess(), (void*)pAddress, pBuffer, iSize, NULL );
  6.         VirtualProtect((void*)pAddress, iSize, Protect, &Protect);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement