View Single Post
epzminion
AlliedModders Donor
Join Date: Jan 2011
Old 06-16-2019 , 03:13   Re: [L4D2] Ladder Rambos -- Shoot from ladders!
Reply With Quote #11

Quote:
Originally Posted by spumer View Post
You can try recompile with https://github.com/spumer/Left4Fix/b...rhelpers.h#L61
My ProtectMemory version take into account multiple memory pages.
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);

Last edited by epzminion; 06-16-2019 at 03:18.
epzminion is offline