ModPhuserEx icon indicating copy to clipboard operation
ModPhuserEx copied to clipboard

Obfuscation Throws Exception w/ .NET 5 Assemblies

Open KatDevsGames opened this issue 4 years ago • 1 comments

Using the following:

<?xml version="1.0" encoding="utf-8"?>
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
  <rule preset="minimum" pattern="true">
    <protection id="anti debug" />
    <!--<protection id="anti dump" />-->
    <protection id="anti ildasm" />
    <!--<protection id="anti tamper" />-->
    <protection id="constants" />
    <protection id="ctrl flow" />
    <!--<protection id="invalid metadata" />-->
    <!--<protection id="ref proxy" />-->
    <protection id="rename" />
    <protection id="resources" />
  </rule>
  <module path="ConnectorLib.dll" />
  <probePath>C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.1\</probePath>
</project>

Expectation: It works. It used to when the target was .NET Framework.

Result:

1>Exception: dnlib.DotNet.TypeResolveException: Could not resolve type: System.Runtime.CompilerServices.IAsyncStateMachine (System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
1>   at dnlib.DotNet.TypeRef.ResolveThrow(ModuleDef sourceModule) in C:\Users\KatDevsGames\source\repos\ModPhuserEx\dnlib\src\DotNet\TypeRef.cs:line 334

It's not finding some classes that get used implicitly by the async/await keywords. The probePath path definitely contains System.Runtime.dll.

KatDevsGames avatar Jan 12 '21 19:01 KatDevsGames

I'm hitting the same problem. I even added (Without luck): <module path="System.Private.CoreLib.dll" external="true" />

The error also throws: [ERROR] ---BEGIN DEBUG INFO--- [ERROR] Installed Framework Versions: [ERROR] v4 [ERROR] Client 4.8.03752 [ERROR] Full 4.8.03752 [ERROR] v4.0 [ERROR] Client 4.0.0.0 [ERROR] v4.5 528040

Do we need to recompile the client with Dot Net 5 framework?

juanpfry avatar Feb 17 '21 22:02 juanpfry