Can't protect .Net assembly on Linux
Posted: Thu Nov 20, 2025 12:47 pm
The same assembly .dll, built on Linux (Ubuntu or WSL2) and targeting either .net 6.0 or .net 8.0 (haven't tried other versions) is protected just fine using VMProtect for Windows, while VMProtect for Linux (v3.10.2 build 2510) exits with an error "Can't resolve assembly System.Runtime..."
This behavior can be reproduced even for a generic console .net app:
then publish and try to protect:
exits with:
[Error] Can't resolve assembly "System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Also notice the System.Runtime version 4.2.1.0 when using --self-contained true. When building with --self-contained false - it shows the correct target version 6.0.0.0 or 8.0.0.0 but still can't resolve it.
I tried disabling "Strip Debug Information" in the project file and then calling with no difference.
This behavior can be reproduced even for a generic console .net app:
Code: Select all
dotnet new console -f net6.0Code: Select all
namespace test;
using System.Reflection;
[Obfuscation(Feature = "virtualization", Exclude = false)]
public class Test {
[Obfuscation(Feature = "virtualization", Exclude = false)]
public void Foo(){
Console.WriteLine("Foo");
}
}
class Program
{
public static void Main(string[] args){
var obj = new Test();
obj.Foo();
}
}
Code: Select all
dotnet publish -c Release -r linux-x64 --self-contained true -o pub
cd pub
vmprotect_con test.dll test.vmp.dll
[Error] Can't resolve assembly "System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Also notice the System.Runtime version 4.2.1.0 when using --self-contained true. When building with --self-contained false - it shows the correct target version 6.0.0.0 or 8.0.0.0 but still can't resolve it.
I tried disabling "Strip Debug Information" in the project file and then calling
Code: Select all
vmprotect_con test.dll.vmp