Comments (15)
@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.
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.
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.
@mkaring I am going to guess its something around lines 272 and 276 of VTable.cs?
from confuserex.
@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.
@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.
@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.Dictionary
2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func
2 keySelector, Func2 elementSelector, IEqualityComparer
1 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, Action
1 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.
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.
Is there an class implementing this interface or another interface extending this interface with Club
as generic type for T
?
from confuserex.
@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.
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.
@mkaring I tested against my pre modified assembly and now its functioning correctly.
Thanks
from confuserex.
Very good. Thank you. The patch will be included in the next release.
from confuserex.
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.
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)
- Abandoned? HOT 2
- Virustotal Community Comments
- The GUI version applies all protections even though I just enabled one in the project config
- DevExpress + ReferenceProxyProtection (strong mode) crashes
- ConfuserEx Error HOT 4
- Adding constants obfuscation causes mscorlib 4.0.0.0 dependency in class libraries that already reference 2.0.0.0
- The project seems dead. Alternatives? HOT 5
- [Feature Request]: I want to pass `snKeyPass` as a command line variable to be used in Dev-Ops secretes etc.
- [Feature Request / Bug]: When a project has been "Delay Signed", I would like it to stay that way
- [Bug] When using `"anti tamper"` on an exe and checking it at "https://www.virustotal.com/gui/home/upload" it reports a virus HOT 3
- Visibility of public members in 1.6.0 changed HOT 2
- class with function pointer produces wrong code
- Support ReadyToRun format HOT 1
- Erroneous and unused assembly referred to in XAML xmlns causes ConfuserEx to crash
- ConfusedBy is seen. HOT 9
- Norton & Windows Defender detect the generated exe as infected by Heur.AdvML.B virus. HOT 1
- Not work on machine where net framework 4 was not installed before HOT 1
- Renaming of Generic.xaml for "ResourceDictionary" and "MergedDictionaries" not right
- System.BadImageFormatException: Invalid DOS signature
- ConfuserEx issue in GUI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from confuserex.