fancycode/MemoryModule — pull request #21 by progmboy (2014-12-22 05:21:03+00:00)
Title: fix memory-module crash with dll align with 512

if dll align with 512 the section->VirtualAddress will lower than a page size. and virtualalloc will return the page base but not the next page..

eg. section->VirtualAddress = 0x200, codebase = 0x1000000
dest = (unsigned char *)VirtualAlloc(codeBase + section->VirtualAddress,
section->SizeOfRawData,
MEM_COMMIT,
PAGE_READWRITE);
the dest will be 0x1000000..
so the memory-module will crash