aboutsummaryrefslogtreecommitdiff
path: root/examples/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scripts')
-rw-r--r--examples/scripts/Delphi Resources/Project1.exe.vmp31
-rw-r--r--examples/scripts/Environment Variables/Project1.exe.vmp20
-rw-r--r--examples/scripts/External DLL/Project1.exe.vmp26
-rw-r--r--examples/scripts/Random Section Names/Project1.exe.vmp32
-rw-r--r--examples/scripts/Script Events/Project1.exe.vmp26
5 files changed, 135 insertions, 0 deletions
diff --git a/examples/scripts/Delphi Resources/Project1.exe.vmp b/examples/scripts/Delphi Resources/Project1.exe.vmp
new file mode 100644
index 0000000..8045223
--- /dev/null
+++ b/examples/scripts/Delphi Resources/Project1.exe.vmp
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Document>
+ <Protection InputFileName="Project1.exe" Options="32768" RunParameters="">
+ <Folders />
+ <Procedures>
+ <Procedure MapAddress='VMProtectMarker &quot;Test marker&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Correct password&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Incorrect password&quot;' Options="1" />
+ </Procedures>
+ <Messages />
+ </Protection>
+ <DLLBox />
+ <Script>
+ <![CDATA[function OnBeforeSaveFile()
+ local file = vmprotect:core():outputArchitecture()
+ local rc_data = file:resources():itemByType(PE.RT_RCDATA)
+ if (rc_data) then
+ local names = {}
+ table.insert(names, "PACKAGEINFO")
+ table.insert(names, "DVCLAL")
+ for _, line in ipairs(names) do
+ local resource = rc_data:itemByName(line)
+ if (resource) then
+ print(string.format("Resource \"%s\" is deleted", line))
+ resource:destroy()
+ end
+ end
+ end
+end]]>
+</Script>
+</Document>
diff --git a/examples/scripts/Environment Variables/Project1.exe.vmp b/examples/scripts/Environment Variables/Project1.exe.vmp
new file mode 100644
index 0000000..03de3d0
--- /dev/null
+++ b/examples/scripts/Environment Variables/Project1.exe.vmp
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Document Version="2">
+ <Protection InputFileName="Project1.exe" Options="819200" RunParameters="" OutputFileName="%MYVAR%.exe">
+ <Folders />
+ <Procedures>
+ <Procedure MapAddress='VMProtectMarker &quot;Test marker&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Correct password&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Incorrect password&quot;' Options="1" />
+ </Procedures>
+ <Messages />
+ <Objects />
+ </Protection>
+ <DLLBox>
+ <Folders />
+ </DLLBox>
+ <Script>
+ <![CDATA[vmprotect.setEnvironmentVariable("MYVAR", "output")]]>
+</Script>
+ <LicenseManager />
+</Document>
diff --git a/examples/scripts/External DLL/Project1.exe.vmp b/examples/scripts/External DLL/Project1.exe.vmp
new file mode 100644
index 0000000..365e56a
--- /dev/null
+++ b/examples/scripts/External DLL/Project1.exe.vmp
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Document>
+ <Protection InputFileName="Project1.exe" Options="32768" RunParameters="">
+ <Folders />
+ <Procedures>
+ <Procedure MapAddress='VMProtectMarker &quot;Test marker&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Correct password&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Incorrect password&quot;' Options="1" />
+ </Procedures>
+ <Messages />
+ </Protection>
+ <DLLBox />
+ <Script>
+ <![CDATA[function OnBeforeCompilation()
+ MessageBox(0, 'OnBeforeCompilation', 'MessageBox from user32.dll', 0x40)
+end
+
+function OnAfterCompilation()
+ MessageBox(0, 'OnAfterCompilation', 'MessageBox from user32.dll', 0x40)
+end
+
+user32 = vmprotect.openLib('user32.dll')
+MessageBox = user32:getFunction('MessageBoxA', {ret = 'int', 'size_t', 'string', 'string', 'uint'})]]>
+</Script>
+ <LicenseManager />
+</Document>
diff --git a/examples/scripts/Random Section Names/Project1.exe.vmp b/examples/scripts/Random Section Names/Project1.exe.vmp
new file mode 100644
index 0000000..bb0c9e2
--- /dev/null
+++ b/examples/scripts/Random Section Names/Project1.exe.vmp
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Document>
+ <Protection InputFileName="Project1.exe" Options="32768" RunParameters="">
+ <Folders />
+ <Procedures>
+ <Procedure MapAddress='VMProtectMarker &quot;Test marker&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Correct password&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Incorrect password&quot;' Options="1" />
+ </Procedures>
+ <Messages />
+ </Protection>
+ <DLLBox />
+ <Script>
+ <![CDATA[function GetRandomSectionName()
+ local res = ""
+ for i = 1, 8 do
+ res = res .. string.char(32 + math.random(string.byte("z") - 32))
+ end
+ return res
+end
+
+function OnAfterSaveFile()
+ local file = vmprotect.core():outputArchitecture()
+ for i = 1, file:segments():count() do
+ segment = file:segments():item(i)
+ name = GetRandomSectionName()
+ print(string.format("Section \"%s\" is renamed to \"%s\"", segment:name(), name))
+ segment:setName(name)
+ end
+end]]>
+</Script>
+</Document>
diff --git a/examples/scripts/Script Events/Project1.exe.vmp b/examples/scripts/Script Events/Project1.exe.vmp
new file mode 100644
index 0000000..f09e93f
--- /dev/null
+++ b/examples/scripts/Script Events/Project1.exe.vmp
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Document>
+ <Protection InputFileName="Project1.exe" Options="32768" RunParameters="">
+ <Folders />
+ <Procedures>
+ <Procedure MapAddress='VMProtectMarker &quot;Test marker&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Correct password&quot;' Options="1" />
+ <Procedure MapAddress='string &quot;Incorrect password&quot;' Options="1" />
+ </Procedures>
+ <Messages />
+ </Protection>
+ <DLLBox />
+ <Script>
+ <![CDATA[function OnBeforeCompilation()
+ print("OnBeforeCompilation")
+end
+
+function OnAfterCompilation()
+ print("OnAfterCompilation")
+end
+
+function OnAfterSaveFile()
+ print("OnAfterSaveFile")
+end]]>
+</Script>
+</Document>