PatchData

By eeew, 5 Years ago (2014-01-15 16:41:16), written in C++, viewed 383 times.
URL https://paste.godclan.hu/view/GcfQulSZ Embed
Download Paste or View RawExpand paste to full width of browser
  1. template <typename T>
  2. void PatchData(DWORD addr, T data){
  3.     DWORD oldprot;
  4.     addr += vcmpaddr;
  5.     VirtualProtect((void*)addr, sizeof(T), PAGE_EXECUTE_READWRITE, &oldprot);
  6.     *(T*)addr = data;
  7.     VirtualProtect((void*)addr, sizeof(T), oldprot, &oldprot);
  8. }

Reply to "PatchData"

Here you can reply to the paste above