.NET: Script examples

Issues related to VMProtect
Post Reply
Admin
Site Admin
Posts: 2586
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
Post Reply