Page 1 of 1
How to use SDK to protect. net programs
Posted: Sat Dec 16, 2023 11:05 am
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?
Re: How to use SDK to protect. net programs
Posted: Sat Dec 16, 2023 12:15 pm
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.
Re: How to use SDK to protect. net programs
Posted: Sat Dec 16, 2023 12:36 pm
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?
Re: How to use SDK to protect. net programs
Posted: Sat Dec 16, 2023 7:51 pm
by Admin
It seems you still don't understand what I explained in other topic:
viewtopic.php?p=38412#p38412
Re: How to use SDK to protect. net programs
Posted: Sun Dec 17, 2023 3:30 pm
by howze
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
Re: How to use SDK to protect. net programs
Posted: Sun Dec 17, 2023 6:29 pm
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".
Re: How to use SDK to protect. net programs
Posted: Mon Dec 18, 2023 1:33 am
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.
Re: How to use SDK to protect. net programs
Posted: Wed Dec 27, 2023 11:20 am
by Admin
Re: How to use SDK to protect. net programs
Posted: Fri Dec 29, 2023 7:32 am
by howze
That's exactly the answer I want to know, thank you so much!