How to protect .NET (Core) application?
How to protect .NET (Core) application?
On main site it says it supports .NET (Core) but I cannot get a protected app to run. A .NET 6 (former known as .NET Core) application, just like on .NET Core 3.1, has
[*]the .NET DLL file
[*]a native host executable
If I protect the .NET dll file the native host executable cannot launch it, because its no longer .NET. Protecting the native host executable is kinda useless since all the code is within the .NET dll file. I can also publish my .NET app as a single file + self contained which generates a large 130mb single executable. But after protecting it its only a 5mb large executable, it seems that it has removed all the bundled .NET files from the single file.
So my question since there is nothing about this in the documentation: How to protect a .NET (6 / 5 / Core 3.1) application?
[*]the .NET DLL file
[*]a native host executable
If I protect the .NET dll file the native host executable cannot launch it, because its no longer .NET. Protecting the native host executable is kinda useless since all the code is within the .NET dll file. I can also publish my .NET app as a single file + self contained which generates a large 130mb single executable. But after protecting it its only a 5mb large executable, it seems that it has removed all the bundled .NET files from the single file.
So my question since there is nothing about this in the documentation: How to protect a .NET (6 / 5 / Core 3.1) application?
Re: How to protect .NET (Core) application?
Could you send us a test example (original EXE/DLL/CGF/VMP binaries) that shows this problem?If I protect the .NET dll file the native host executable cannot launch it, because its no longer .NET.
Re: How to protect .NET (Core) application?
Yes, I've attached a .NET 6 app. Because of file size this is not published as self contained so you must install .NET 6 Runtime: https://dotnet.microsoft.com/download/d ... -installer
As you can see my .NET test application is the WpfApp10.dll file. WpfApp10.exe is the native host which checks for .NET 6 runtime, then host and launch the dll file. I need to basically protect the WpfApp10.dll file and it should still get launched via WpfApp10.exe but its not. With .NET 3.1 Core and still with .NET 6 there are no .NET executables anymore. Its always the bundle of .NET dll and native host executable. As I said before I can publish as single file (this sadly requires to also publish as self contained so I cannot attach it as it would be 130mb large but I can share project files and tell you how to generate this single file). As far as I know single file just embeds all the .NET files into the native host application and then load them from memory on start. Protecting such a single file however removes all the embedded .NET files. So this doesn't work as well.
As you can see my .NET test application is the WpfApp10.dll file. WpfApp10.exe is the native host which checks for .NET 6 runtime, then host and launch the dll file. I need to basically protect the WpfApp10.dll file and it should still get launched via WpfApp10.exe but its not. With .NET 3.1 Core and still with .NET 6 there are no .NET executables anymore. Its always the bundle of .NET dll and native host executable. As I said before I can publish as single file (this sadly requires to also publish as self contained so I cannot attach it as it would be 130mb large but I can share project files and tell you how to generate this single file). As far as I know single file just embeds all the .NET files into the native host application and then load them from memory on start. Protecting such a single file however removes all the embedded .NET files. So this doesn't work as well.
- Attachments
-
- net6.0-windows.zip
- (78.41 KiB) Downloaded 158 times
Re: How to protect .NET (Core) application?
The .NET 6 Runtime was installed, but your application still shows the following error:
---------------------------
WpfApp10.exe
---------------------------
To run this application, you must install .NET Desktop Runtime 6.0.0 (x64).
Would you like to download it now?
---------------------------
Yes No
---------------------------
---------------------------
WpfApp10.exe
---------------------------
To run this application, you must install .NET Desktop Runtime 6.0.0 (x64).
Would you like to download it now?
---------------------------
Yes No
---------------------------
Re: How to protect .NET (Core) application?
Bummer, I don't know what happened. Try with the new attachment.
- Attachments
-
- net6.0-windows.zip
- (78.77 KiB) Downloaded 151 times
Re: How to protect .NET (Core) application?
We tested your latest example and it works fine after protection.
- Attachments
-
- protected.zip
- (337.19 KiB) Downloaded 189 times
Re: How to protect .NET (Core) application?
You are right, now it also works fine here. My main application now also works except of:
Does VMP supports WPF / Mvvm applications?
- "Pack the output file" is checked. In this case I don't even get the demo messagebox of VMP on start. Nothing happens if I double click the executable the process just disappears in task manager
- "Strip debug symbols" is checked. It says: but this file exist in the output directory.
Code: Select all
Can't resolve assembly: System.Security.Cryptography.Algorithms, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Code: Select all
System.Windows.Markup.XamlParseException: The method or operation is not implemented.
---> System.NotImplementedException: The method or operation is not implemented.
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
at System.Windows.Baml2006.Baml2006SchemaContext.GetProperty(Int16 propertyId, XamlType parentType)
at System.Windows.Baml2006.Baml2006Reader.Process_PropertyWithConverter()
at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
at System.Windows.Baml2006.Baml2006Reader.Read()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
Re: How to protect .NET (Core) application?
Are you a registered user of VMProtect?
Re: How to protect .NET (Core) application?
No I am evaluating the demo version of VMP, seeing if it works at all. Because if it doesn't work there is no reason to purchase.
Re: How to protect .NET (Core) application?
Are you sure that you try the latest demo version (3.5.1.1343)? It seems you use 3.5.0 or older version because the latest demo version works with your latest example without any problems.
Re: How to protect .NET (Core) application?
Yes I am using 3.5.1 build 1343. The error from last post comes from my real application, not the sample application I've posted here.
Re: How to protect .NET (Core) application?
So you have to send us new test example.