Enable/Disable MemoryProtection in code

Feature Request:

Being able to turn on/off MemoryProtection with in code. like in following pseudoe code:

begin
  memory_protection_off;
  patch_memory;
  memory_protection_on; // << this should also generate a new hash over the memory
  .. go on with patched code ..
end

Background:
I am still using an older Delphi version to code some tools and inside it using FastMM4as memory manager and some other libraries that would patch certain memory locations at startup to make faster functions availabe for all other routines used later on.

This however is not working together with the MemoryProtection from VMP as it would see this as a cracking/hacking attempts. It would be nice to have something in VMP that would let me turn on MemoryProtection after I have finished my patching in the hope that some kind of new HASH is generated that the function would check against it.

Actually I have no details on how this HASH is generated (maybe when applying the protection) but if it is done on startup, it would be optimal to reinit this to make use of this very important function after all.

Sorry my English is not that good and I hope I could express myself in a way you could understand it.

In your case you have to disable “Memory protection” for the “.text” segment like this:

Thanks, this is something Im doing already but of course it is not much more vulnerable to silly attacks using CheatEngine or Loaders to manipulate the program’s code.

I guess there is nothing planned to reinitialize this Memory Protection from program code right?

We are not going to add anything for it because an application that verifies own integrity should not change itself.

Do you have information about modified regions at the protection time? I mean if you know that your code modifies part of itself you will provide this regions to VMProtect via script and VMProtect will exclude these regions from the memory protection.