Initialization Error 4

Issues related to VMProtect
tripleh
Posts: 4
Joined: Tue Nov 17, 2015 6:34 pm

Initialization Error 4

Postby tripleh » Tue Nov 17, 2015 6:40 pm

Hi,

I am currently updating my software to support VMP3.
I need to strip out the "Name" field in the Export Directory of my DLL which worked fine in VMP2, in VMP3 I get an error message:
Image

Is there any way to make the dll work with modified export directory? Memory protection is not enabled.

Regards.

Admin
Site Admin
Posts: 1716
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Initialization Error 4

Postby Admin » Wed Nov 18, 2015 7:51 am

"Initialiation error 4" means that the last VMProtect's segment is modified. We recommend to use the script for deleting of export functions. For example:

Code: Select all

function OnBeforeSaveFile()
   local exports = vmprotect.core():outputArchitecture():exports()
   exports:clear()
end

tripleh
Posts: 4
Joined: Tue Nov 17, 2015 6:34 pm

Re: Initialization Error 4

Postby tripleh » Wed Nov 18, 2015 6:25 pm

Hello, thanks for your response.

I don't want to remove all exports I just want to
  • Rename one exported function
  • Change the "name" field in the export directory

Is there any way to accomplish that with VMP Scripts? As far as I understood the Script functions only allow you to read and clear the export directory but not to change certain fields.

Admin
Site Admin
Posts: 1716
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Initialization Error 4

Postby Admin » Thu Nov 19, 2015 1:30 pm

We have added these features in 3.0.6.548.

Rename one exported function:

Code: Select all

function OnBeforeSaveFile()
   local exports = vmprotect.core():outputArchitecture():exports()
   local export =  exports:itemByName("old_name")
   if (export) then
      export:setName("new_name")
   else
      print("old_name not found!")
   end
end

Change the "name" field in the export directory:

Code: Select all

function OnBeforeSaveFile()
   local exports = vmprotect.core():outputArchitecture():exports()
   exports:setName("")
end

tripleh
Posts: 4
Joined: Tue Nov 17, 2015 6:34 pm

Re: Initialization Error 4

Postby tripleh » Fri Nov 20, 2015 1:38 pm

Thank you very much, keep up the great work!

tripleh
Posts: 4
Joined: Tue Nov 17, 2015 6:34 pm

Re: Initialization Error 4

Postby tripleh » Thu Aug 18, 2016 6:14 pm

Hello,

could you please also add functions to change
  • NtHeader->FileHeader.TimeDateStamp
  • NtHeader->OptionalHeader.MinorLinkerVersion
  • IMAGE_EXPORT_DIRECTORY->TimeDateStamp

Regards