ConfuserEx icon indicating copy to clipboard operation
ConfuserEx copied to clipboard

Problems with use of DLL after obfuscation.

Open SatFiscalLib opened this issue 9 years ago • 12 comments
trafficstars

First I would like to thank and congratulate the project, which undoubtedly is amazing. I have a dll that is used in several programming languages. When I use the ConfuserEx (0.6.0 or 0.5.0), I can use the dll usually overshadowed in vb6 but in vb.net/c#.net(vsto 2010) accuses error Pinvoke and COM-Interop, I can see the methods, functions and properties, but the above error occurs. I decided to use the VSTO2015, and is the VSTO2015 can not open / use the obfuscated dll, it does not appear the methods, functions and prorpriedades and you can not use it using using XXXX; for me does not appear the referenced DLL.

If I just compile the DLL without overshadowing, you can use it normally both VSTO2010 as the VSTO2015.

I use Windows 10 64bit, compiling for X86.

I need a help and I thank everyone who can help me.

translated by Google.

SatFiscalLib avatar Mar 08 '16 14:03 SatFiscalLib

Hi, Please try the latest version at the CI Server first.

yck1509 avatar Mar 18 '16 08:03 yck1509

I am getting a similar problem. I was using v0.6.0 with VS 2013. When I upgraded solution to VS 2015 and .NET 4.6 (required by RestSharp 105.2.3 for my NuGet package) I get error "Metadata file 'my.dll' could not be opened -- Invalid public key" this is even after updating to use the latest build of confuserEx from AppVeyor.

Is there a particular protection I can remove to avoid this error?

Currently my crproj file is:

<?xml version="1.0" encoding="utf-8"?>
  <project baseDir="." outputDir="Confused" xmlns="http://confuser.codeplex.com">
    <rule preset="none" 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="my.dll" />
</project>

Thank you.

fullcirclesolutions avatar Mar 21 '16 14:03 fullcirclesolutions

@fullcirclesolutions Is your dll strong name signed? If it is, you need to supply the private key to ConfuserEx.

yck1509 avatar Mar 27 '16 07:03 yck1509

Hi @yck1509, My dll is NOT currently strong name signed.

fullcirclesolutions avatar Mar 28 '16 01:03 fullcirclesolutions

Dear yck1509, Same problem Here. After obfuscating my DLL with latest version of confuser causing VS2008 window to crash, when I use the DLL in a ASP.net web application. Also, packer doesn't work for DLL. Please look into it. My crproj:

<project outputDir="P:\BeAtFront\Test\Dang\bin\Release\Confused" baseDir="P:\BeAtFront\Test\Dang\bin\Release" xmlns="http://confuser.codeplex.com">
  <module path="Dang.dll">
    <rule pattern="true" preset="normal" inherit="false" />
  </module>
</project>

My project targets .net framework 3.5

uniqmr avatar Apr 01 '16 18:04 uniqmr

@yck1509 , I've done it, including the two versions (0.5.0 and 0.6.0). Another thing is that I use DLL strong name, going to Confuser the private key, but unfortunately, the DLL does not work with .net (vb.net or c # .net) after obfuscated. if I use the project without obfuscating the dll I do not have this error

The runtime has encountered a fatal error. The error address is 0x0073e902 in thread 0x1264. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or unverifiable the user code parts. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may damage the battery.

http://www.satfiscal.net/downloads/errodll.jpg

SatFiscalLib avatar Apr 07 '16 20:04 SatFiscalLib

I've having the same issue, as I reported in #419, I was able to prevent VS from crashing by removing 'constants' and 'resources' protections. However VB projects still will not compile. C# still works fine.

EDIT: My compile issue was my error. I have ExtensionAttribute defined in my own assembly, which conflicts with the .NET runtime one. Changing it to 'internal' resolved the issue.

Gwindalmir avatar Apr 13 '16 00:04 Gwindalmir

After I installed VS 2015 Update 2 last night and targeted 4.6.1 to get it to work I have to reduce the rule clause in my crproj file to:

<rule preset="none" pattern="true">
        <protection id="anti debug" />
        <protection id="anti dump" />
        <protection id="anti ildasm" />
        <protection id="anti tamper" />
        <protection id="ctrl flow" />
        <protection id="ref proxy" />
        <protection id="rename" />
        <!--<protection id="invalid metadata" />-->
        <!--<protection id="constants" />-->
        <!--<protection id="resources" />-->
</rule>

This feels like ConfuserEx's capabilities are degrading and lessening as .NET moves forward. This does not feel right and would be disappointing if I could not add these protections back at some stage or replace them with something analogous to maintain functionality.

What are other's thoughts on this?

agray avatar Apr 16 '16 13:04 agray

This feels like ConfuserEx's capabilities are degrading and lessening as .NET moves forward.

My thought is that you rise a valid issue which is good for the project. At the same time being open source this project might really benefit from code contributions as well.

a-stankevich avatar Jun 01 '16 10:06 a-stankevich

Preset --> None Add = anti-ildasm Add = anti-temper Add = contants

solve my issue for now

Sourcephy avatar May 14 '18 20:05 Sourcephy

I removed resources and constants from maximum obfuscation which allowed me to add the reference to the dll and build the project successfully in VS2017. Although I could not run the project in Visual studio without a fatal error exception, the exe file in bin\release folder ran fine.

damozaz avatar May 31 '18 21:05 damozaz

Help me plzzzzzzzzz!

[ERROR] Failed to resolve dependency of 'WpfApp1.exe'. 1> Exception: dnlib.DotNet.AssemblyResolveException: Could not resolve assembly: Microsoft.AspNetCore.SignalR.Client.Core, Version=1.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 1> عند dnlib.DotNet.Extensions.ResolveThrow(IAssemblyResolver self, IAssembly assembly, ModuleDef sourceModule) في E:\Source\Public\Confuser2\dnlib\src\DotNet\IAssemblyResolver.cs:السطر 113 1> عند Confuser.Core.ConfuserEngine.Inspection(ConfuserContext context) في e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:السطر 264 1> Failed at 06:30 م, 0:00 elapsed.

I need a help and I thank everyone who can help me

waelshamiri avatar Jul 12 '18 15:07 waelshamiri