How to use SDK to protect. net programs

Issues related to VMProtect
Post Reply
howze
Posts: 11
Joined: Thu Dec 07, 2023 9:55 am

How to use SDK to protect. net programs

Post by howze »

I downloaded the latest version of vmp to try out
Reference VMProtect.SDK
And add [Obfuscation(Feature = "ultra", Exclude = false)] before the method
After compilation, you can still see the source code using ILSpy or dnSpy
Is it because the trial version does not provide protection function?
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: How to use SDK to protect. net programs

Post by Admin »

Reference VMProtect.SDK
Don't need if you don't use functions from SDK.
And add [Obfuscation(Feature = "ultra", Exclude = false)] before the method
After compilation, you can still see the source code using ILSpy or dnSpy
After loading of your application in VMProtect you will see in the section "Functions for Protection" the folder "New markers and strings" with your method inside it. Only in this case this method will be virtualized.
howze
Posts: 11
Joined: Thu Dec 07, 2023 9:55 am

Re: How to use SDK to protect. net programs

Post by howze »

Admin wrote: Sat Dec 16, 2023 12:15 pm
Reference VMProtect.SDK
Don't need if you don't use functions from SDK.
And add [Obfuscation(Feature = "ultra", Exclude = false)] before the method
After compilation, you can still see the source code using ILSpy or dnSpy
After loading of your application in VMProtect you will see in the section "Functions for Protection" the folder "New markers and strings" with your method inside it. Only in this case this method will be virtualized.
Thank you for your answer, but since I want to use the self-contained publishing function of VS, I need to virtualize my dll during the publishing process. If I use vmp gui to virtualize the dll, then I will no longer be able to use the self-contained publishing function of VS.So , is there any solution for this situation?
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: How to use SDK to protect. net programs

Post by Admin »

It seems you still don't understand what I explained in other topic:
viewtopic.php?p=38412#p38412
howze
Posts: 11
Joined: Thu Dec 07, 2023 9:55 am

Re: How to use SDK to protect. net programs

Post by howze »

Admin wrote: Sat Dec 16, 2023 7:51 pm It seems you still don't understand what I explained in other topic:
viewtopic.php?p=38412#p38412
I'm sorry, but I really don't understand how to use vmp to protect my dll file first, and then use vs 2022's built-in publisher to publish as a single file
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: How to use SDK to protect. net programs

Post by Admin »

1. Compile your application with MSVC (for example Test.sln for .NET Core 6.0). MSVC will create "Release\net6.0\Test.dll" and "Release\net6.0\Test.exe"
2. Publish your application with the "dotnet publish" command. It will create the folder "Release\net6.0\publish"
3. Open the file "Release\net6.0\Test.dll" with VMProtect
4. Add requirde "functions for protection", required additional options, select "Options"-"File"-"Output file" = "Release\net6.0\publish\Test.dll"
5. Press "Compile".
howze
Posts: 11
Joined: Thu Dec 07, 2023 9:55 am

Re: How to use SDK to protect. net programs

Post by howze »

Admin wrote: Sun Dec 17, 2023 6:29 pm 1. Compile your application with MSVC (for example Test.sln for .NET Core 6.0). MSVC will create "Release\net6.0\Test.dll" and "Release\net6.0\Test.exe"
2. Publish your application with the "dotnet publish" command. It will create the folder "Release\net6.0\publish"
3. Open the file "Release\net6.0\Test.dll" with VMProtect
4. Add requirde "functions for protection", required additional options, select "Options"-"File"-"Output file" = "Release\net6.0\publish\Test.dll"
5. Press "Compile".
Thank you very much for your patient answer, but there seems to be a problem with my description. According to your steps, the program will be published first, and then the dll will be protected. After that, it seems that the protected dll and exe can no longer be published as a self-contained single-file application through Visual Studio (VMProtect can combine exe and dll into a single file, but the self-contained function cannot be achieved), and what I want is to encrypt the dll first, and then use Visual Studio to publish it as a self-contained single file application.
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: How to use SDK to protect. net programs

Post by Admin »

howze
Posts: 11
Joined: Thu Dec 07, 2023 9:55 am

Re: How to use SDK to protect. net programs

Post by howze »

Admin wrote: Wed Dec 27, 2023 11:20 am viewtopic.php?t=31481
That's exactly the answer I want to know, thank you so much!
Post Reply