.NET: Script examples

Issues related to VMProtect
Post Reply
Admin
Site Admin
Posts: 2687
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

.NET: Script examples

Post by Admin »

.NET: Disable renaming of methods with script

Just change CLASS_NAME to required class name like 'Test':

Code: Select all

function OnBeforeCompilation()
	local heap = vmprotect.core():outputArchitecture():streams()
	local methods = heap:table(TokenType.MethodDef)
	for i = 1, methods:count() do
		local method = methods:item(i)
		if method:declaringType():name() == CLASS_NAME then
			method:setRenameMode(RenameMode.None)
		end
	end
end
Exclude header from CRC checking (for PE only):

Code: Select all

function OnBeforeCompilation()
	local header = vmprotect.core():outputArchitecture():segments():header()
	if header ~= nil then
		header:setExcludedFromMemoryProtection(true)
	end
end
mounirsoltan
Posts: 1
Joined: Sat Jun 22, 2024 1:18 pm

Re: .NET: Script examples

Post by mounirsoltan »

Hi, I have a beginner question. If I only use the GUI VMProtect and I protect the binary file with serial lock, could I write a script to make the protected file read the license key from a text file, like serial.txt?
thanks admin
Admin
Site Admin
Posts: 2687
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: .NET: Script examples

Post by Admin »

Please notice that script works while protection only, so you have to implement required functions in your application by yourself.
Post Reply