Page 1 of 1

Enable/Disable MemoryProtection in code

Posted: Fri May 27, 2016 8:47 am
by GMerg
Feature Request:

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

Code: Select all

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.

Re: Enable/Disable MemoryProtection in code

Posted: Mon May 30, 2016 1:26 pm
by Admin
In your case you have to disable "Memory protection" for the ".text" segment like this:
Image

Re: Enable/Disable MemoryProtection in code

Posted: Tue Jun 14, 2016 7:23 am
by GMerg
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?

Re: Enable/Disable MemoryProtection in code

Posted: Thu Jun 16, 2016 7:28 am
by Admin
We are not going to add anything for it because an application that verifies own integrity should not change itself.

Re: Enable/Disable MemoryProtection in code

Posted: Tue Oct 25, 2016 8:05 am
by Admin
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.