Quote:
Originally Posted by spumer
|
This would also crash in this case because it isn't taking into account the offset when it
calls ProtectMemory in ApplyPatch.
You would need this change also to make the page(s) at the patch location writable:
Code:
inline void ApplyPatch(void *address, int offset, const patch_t *patch, patch_t *restore)
{
unsigned char *addr = (unsigned char *)address + offset;
ProtectMemory((void *)addr, 20, PAGE_EXECUTE_READWRITE);