yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.54k stars 1.61k forks source link

Run ConfuserEx in MacOSX #611

Open sirfilipef opened 7 years ago

sirfilipef commented 7 years ago

I try to run ConfuserEx to protect Xamarin.iOS dll, however im getting this error.

mono Confuser.CLI.exe -n confuser.crproj

 [INFO] ConfuserEx v1.0.0-17-g2046c23 Copyright (C) Ki 2014
 [INFO] Running on Unix 16.6.0.0, 5.0.1.1 (2017-02/5077205 Thu May 18 16:11:37 EDT 2017), 32 bits
[DEBUG] Discovering plugins...
 [INFO] Discovered 10 protections, 1 packers.
[DEBUG] Resolving component dependency...
 [INFO] Loading input modules...
 [INFO] Loading 'teste.dll'...
 [INFO] Initializing...
[DEBUG] Building pipeline...
 [INFO] Resolving dependencies...
[ERROR] Failed to resolve dependency of 'teste.dll'.
Exception: dnlib.DotNet.AssemblyResolveException: Could not resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  at dnlib.DotNet.Extensions.ResolveThrow (dnlib.DotNet.IAssemblyResolver self, dnlib.DotNet.IAssembly assembly, dnlib.DotNet.ModuleDef sourceModule) [0x00023] in <6a47db71fb214ec99b4d47cc4bd15533>:0 
  at Confuser.Core.ConfuserEngine.Inspection (Confuser.Core.ConfuserContext context) [0x0005b] in <e36479eb24114d36babf562546df8038>:0 
Failed at 3:51 PM, 0:00 elapsed.
<project outputDir="Release/" baseDir="Release/" xmlns="http://confuser.codeplex.com">
  <rule pattern="true" preset="aggressive" />
  <module path="teste.dll">
    <rule pattern="true" preset="aggressive" />
  </module>
<probePath>/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/</probePath>
</project>

Any idea?

sirfilipef commented 7 years ago

i think the probePath doesnt do anything....

tdenniston commented 6 years ago

I faced this same issue and was able to resolve it by specifying one other probe path:

/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Facades

I also was seeing a subsequent crash in the reference proxy protection phase, which I disabled by setting a rule:

  <module path="lib.dll">
    <rule pattern="true" preset="normal" inherit="false">
      <protection action="remove" id="ref proxy" />
    </rule>
  </module>
2urbo commented 6 years ago

The probePath works fine on MacOS. I've resolved this issue by adding the following probe paths (Xamarin.Android):

<probePath>/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1</probePath>
<probePath>/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile259</probePath>