/ Published in: C++
Expand |
Embed | Plain Text
void edit_memory(int address, BYTE *data, int length) { int protection; // memory protection information variable VirtualProtect((void *)address, length, PAGE_READWRITE, (PDWORD)&protection); // set READ WRITE access to memory, and save previous protection information memcpy((void *)address, (const void *)data, length); // copy length byte of data to address VirtualProtect((void *)address, length, protection, 0); // restore previously changed memory protection }
You need to login to post a comment.
