Automaticly generating watermark for each user

Issues related to VMProtect
Post Reply
arturarkowiak
Posts: 4
Joined: Wed Jun 04, 2025 11:43 am

Automaticly generating watermark for each user

Post by arturarkowiak »

Hello. Currently I have exe file that i distribute to every user. But I wanted to take advantage of watermarks feature that would allow me to track which user leaked and cracked the program. I'm wondering is there any way I could modify or add watermark with value that I will specify?

Code: Select all

	local vmp_core = vmprotect.core()
	local watermark_name = "BUILD_INFO"
	local watermark_data = "12321312"
	
	vmp_core:watermarks():add(watermark_name) --how do i put watermark_data in here
	print("Watermark has been generated!")
Admin
Site Admin
Posts: 2703
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Automaticly generating watermark for each user

Post by Admin »

Are you a registered user?
arturarkowiak
Posts: 4
Joined: Wed Jun 04, 2025 11:43 am

Re: Automaticly generating watermark for each user

Post by arturarkowiak »

Yes, I bought pro version
Admin
Site Admin
Posts: 2703
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Automaticly generating watermark for each user

Post by Admin »

What is your registered email?
arturarkowiak
Posts: 4
Joined: Wed Jun 04, 2025 11:43 am

Re: Automaticly generating watermark for each user

Post by arturarkowiak »

I sent in PM
Admin
Site Admin
Posts: 2703
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Automaticly generating watermark for each user

Post by Admin »

Try the following code:

Code: Select all

	local vmp_core = vmprotect.core()
	local watermark_name = "BUILD_INFO"
	local watermark_data = "12321312"
	
	vmp_core:watermarks():add(watermark_name, watermark_data)
	print("Watermark has been generated!")
arturarkowiak
Posts: 4
Joined: Wed Jun 04, 2025 11:43 am

Re: Automaticly generating watermark for each user

Post by arturarkowiak »

I have been playing around with watermarks and I'm not sure how they work. Because there is a list of watermarks where each can be blocked, but there is option to select one. What is the difference between not blocking and selecting?
I saw that Watermark class has setBlocked(bool) function, but i see that whether i set it to true or false, it always unblocks the watermark. I tested it with following script, comments reflect what is happening for me during tests

Code: Select all

function OnBeforeCompilation()	
	local vmp_core = vmprotect.core()
	
	for i = 1, vmp_core:watermarks():count() do
		local found_watermark = vmp_core:watermarks():item(i)
		local found_watermark_name = found_watermark:name()
		
		-- now there are listed correct states that are set manually by user
		print(found_watermark_name .. " first state: " .. (found_watermark:blocked() and "" or "not ") .. "blocked")
		
		found_watermark:setBlocked(true)

		-- they all should be locked, but everything is getting unlocked
		print(found_watermark_name .. " second state: " .. (found_watermark:blocked() and "" or "not ") .. "blocked")
		
		found_watermark:setBlocked(false)
	
		-- for test, they still remain unlocked
		print(found_watermark_name .. " third state: " .. (found_watermark:blocked() and "" or "not ") .. "blocked")
	end
end
Admin
Site Admin
Posts: 2703
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Automaticly generating watermark for each user

Post by Admin »

I saw that Watermark class has setBlocked(bool) function, but i see that whether i set it to true or false, it always unblocks the watermark.
Fixed in the 2372 build.
Post Reply