diff options
author | jmpoep <OriginalEntryPoint@qq.com> | 2023-12-07 16:51:07 +0800 |
---|---|---|
committer | jmpoep <OriginalEntryPoint@qq.com> | 2023-12-07 16:51:07 +0800 |
commit | 28008a746a31abb7909dd86cb0cd413ac8943b0b (patch) | |
tree | a30b74b8cad548048c3c1551d652828ab76fa9bd /examples/scripts | |
download | vmprotect-3.5.1-master.tar vmprotect-3.5.1-master.tar.gz vmprotect-3.5.1-master.tar.bz2 vmprotect-3.5.1-master.zip |
Diffstat (limited to 'examples/scripts')
-rw-r--r-- | examples/scripts/Delphi Resources/Project1.exe.vmp | 31 | ||||
-rw-r--r-- | examples/scripts/Environment Variables/Project1.exe.vmp | 20 | ||||
-rw-r--r-- | examples/scripts/External DLL/Project1.exe.vmp | 26 | ||||
-rw-r--r-- | examples/scripts/Random Section Names/Project1.exe.vmp | 32 | ||||
-rw-r--r-- | examples/scripts/Script Events/Project1.exe.vmp | 26 |
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 "Test marker"' Options="1" /> + <Procedure MapAddress='string "Correct password"' Options="1" /> + <Procedure MapAddress='string "Incorrect password"' 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 "Test marker"' Options="1" /> + <Procedure MapAddress='string "Correct password"' Options="1" /> + <Procedure MapAddress='string "Incorrect password"' 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 "Test marker"' Options="1" /> + <Procedure MapAddress='string "Correct password"' Options="1" /> + <Procedure MapAddress='string "Incorrect password"' 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 "Test marker"' Options="1" /> + <Procedure MapAddress='string "Correct password"' Options="1" /> + <Procedure MapAddress='string "Incorrect password"' 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 "Test marker"' Options="1" /> + <Procedure MapAddress='string "Correct password"' Options="1" /> + <Procedure MapAddress='string "Incorrect password"' 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> |