Closed ivan-danilov closed 8 years ago
Hi, I tried the example code provided in the question and it passes peverify:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
[assembly: Obfuscation(Feature = "rename(mode=sequential,renPublic=true,flatten=true)", Exclude = false)]
namespace ClassLibrary1 {
public interface IX { void M(); }
public class Class1 : IX {
void IX.M() { Console.WriteLine("IX.M()"); }
public void M() { Console.WriteLine("M()"); }
}
public class Class2 {
public static void Main(string[] args) {
var x = new Class1();
x.M();
((IX)x).M();
}
}
}
It was a code to check whether PEVerify reports correct error rather than to reproduce ConfuserEx issue... again, I have a case where it is reproduced perfectly, but can't share due to legal reasons, and don't know how to make a minimal repro (yet).
That's not a question, that's a bug lurking somewhere. Can share an assembly produced by ConfuserEx that does not pass PEVerify.
@yck1509 Got a permission and sent you an email (to the address you have in your commits). Both this issue and #413's repro is there. If it's not the correct one - contact me at van dot danilov at Gmail.
See this question. If Rename protection is applied with flattening, and class have both
IX.M()
andM()
methods - compiler generates former asNamespace.IX.M()
, not justM()
. But that discretion was lost during obfuscation, leading to invalid IL (PEVerify produces error about duplicate methods). It is being executed just fine though - probably current CLR implementation is forgiving here.