Get Demo
  • Windows
  • MacOS
  • Linux

Events


The built-in script language is an efficient way to automate the creation of protected applications with VMProtect. Procedures and functions required at various stages of building the protected file are invoked through specific events processed by the VMProtect core. You can define your own handlers for five events that are called by the VMProtect core in the following order:

function OnBeforeCompilation()
end

This event is invoked when the list of protection objects is created. In the OnBeforeCompilation handler, you can add new procedures to the project, or modify or remove existing ones.

function OnBeforeSaveFile()
end

This event is invoked before all objects created during compilation are written to the output file. In the OnBeforeSaveFile event handler, you can modify the file and its properties (such as the list of resources, the list of exported functions, section names, etc.) that will be written to the output file.

function OnBeforePackFile()
end

This event is invoked before packing the protected application file. With OnBeforePackFile, you can modify the file that is about to be packed. This event is only invoked if the “Pack output file” option is enabled.

function OnAfterSaveFile()
end

This event is invoked after all objects created during compilation have been written to the output file. The event handler can add new data to the output file or modify previously written data.

function OnAfterCompilation()
end

This event is invoked after compiling all project objects. At this stage, the user has access to the compiled project and can perform any actions on it, such as adding a digital signature (certificate).

When writing event handlers, you can create your own procedures and functions. Event names are highlighted in bold in the script editor.

Last updated 11 days ago