Giter Club home page Giter Club logo

Comments (15)

mkaring avatar mkaring commented on July 16, 2024 1

@jaymarvels Find the new build here: https://ci.appveyor.com/project/mkaring/confuserex/builds/23321904/artifacts

Could you please try if that version is able to properly handle your assembly?

from confuserex.

mkaring avatar mkaring commented on July 16, 2024

What version of ConfuserEx are you using?
What protections are you using (you can also share the *.crproj file you are using, make sure to remove any passwords for private keys if there are any)
Do you have a minimal working example that produces the error?

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring

Latest release (1.1.0).
Normal preset out of the box
I've worked out its just one single project library its failing on with the above error. It doesn't contain any passwords for private keys.

Not sure how I can create a minimal working example to be fair. But the project in question is only full of interface abstractions, methods along with some automapper mappings

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring I am going to guess its something around lines 272 and 276 of VTable.cs?

from confuserex.

mkaring avatar mkaring commented on July 16, 2024

@jaymarvels I tried to find the issue without anything to go on but the stacktrace. The problem points to some issue with the interfaces. It seems it's trying to add two methods with identical signatures to the internal structures, but I am not sure how such a thing could happen, because that would mean that a single interface contains the same method twice.

Could you try to disable the "normal" preset and only enable the renaming? To see if the renamer causes the issue on it's own or if the issue is just a side effect of an error in another protection.

The problem is related to interfaces. Are there any strange interface constructions in the assembly that come to mind? Any indication is helpful. I tried different structures of inheriting the interfaces different way, but there was no way to get it to populate a slot twice.

Is there any chance that you can share the affected assembly so I can research the issue using it? You can send it to me at [email protected] if that is possible. I'll treat it as confidential obviously.

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring I will give it a try. There is some polymorphism/overloading going on in some of the interfaces too, but this is just normal OOP practices.

I'll let you know the results of renaming only

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring Renaming fails too:

[INFO] Initializing... [DEBUG] Building pipeline... [INFO] Resolving dependencies... [DEBUG] Checking Strong Name... [DEBUG] Creating global .cctors... [DEBUG] Watermarking... [DEBUG] Executing 'Name analysis' phase... [DEBUG] Building VTables & identifier list... [ERROR] Unknown error occurred. Exception: System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at Confuser.Renamer.VTable.Implements(VTableConstruction vTbl, Dictionary2 virtualMethods, VTable ifaceVTbl, TypeSig iface) at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) at Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action1 func, Func1 targets, ConfuserContext context) at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) Failed at 12:20, 0:01 elapsed.

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring

Think I've found the interface in question:

public interface IModelRepository<T>
{
    FileReadResults<T> Create(string path);

    SaveFileReadResults<T> Create(BinaryReader reader);

    void Write(BinaryWriter binaryWriter, long objectIndex, List<T> objectList, List<T> objectAltList);

    void Write(string path, List<Club> objectList, List<Club> objectAltList, long objectIndex);

    void Write(string path, List<T> objectList, List<T> objectAltList, long objectIndex);

}

Looks like as I have a mix of generic and strongly typed with the same signature it doesn't like it.

from confuserex.

mkaring avatar mkaring commented on July 16, 2024

Is there an class implementing this interface or another interface extending this interface with Club as generic type for T?

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring I removed

void Write(string path, List<Club> objectList, List<Club> objectAltList, long objectIndex);

as these 2 signatures are the same:

from the interface and obviously all the implementations, and this all seems to have fixed it and its working, I am thinking this is some weird R# thing when I did a Pull Up to the interface.

` void Write(string path, List objectList, List objectAltList, long objectIndex);

void Write(string path, List<T> objectList, List<T> objectAltList, long objectIndex);`

Unless you think this is a legit bug and you want to fix it?

Thanks for your help

from confuserex.

mkaring avatar mkaring commented on July 16, 2024

It is a legit bug. It is possible that a single method overrides multiple interface method signatures. That is a valid case and it will be fixed in the next release. It would be great if you could keep an affected version of your assembly around a couple of days, so you can test the new version of ConfuserEx and verify that the issue is fixed.

from confuserex.

jaymarvels avatar jaymarvels commented on July 16, 2024

@mkaring I tested against my pre modified assembly and now its functioning correctly.

Thanks

from confuserex.

mkaring avatar mkaring commented on July 16, 2024

Very good. Thank you. The patch will be included in the next release.

from confuserex.

Gwindalmir avatar Gwindalmir commented on July 16, 2024

Was this fix included in the 2.0.0 build on appveyor?
I used this package, but get the same error: https://ci.appveyor.com/api/buildjobs/hugwqwjv3avids2r/artifacts/Release%2FConfuserEx.zip

I have the same error, reproducible with the following code:

    public class Class1
    {
        internal void Method()
        {
        }

        [Obfuscation(Exclude = false, Feature = "preset(maximum);-anti tamper;+rename(mode=decodable)")]
        internal void Method(bool argument)
        {
        }
    }

This worked in Confuser 1.0.0.

I can submit the entire repro case, and/or open a separate issue if needed.

from confuserex.

github-actions avatar github-actions commented on July 16, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from confuserex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.