CodeExplorer Posted January 27, 2019 Share Posted January 27, 2019 Dnlib cant find nested type! Nested type name: Confuser_Methods_Decryptor.MetadataReader/TableSize public TypeDef FindTypeFullName(string typeFullName) { if (assemblies==null||assemblies.Count<=0) return null; for (int i=0;i<assemblies.Count;i++) { TypeDef foundtype = assemblies.Find(typeFullName, false); // is a slah '/' if (foundtype!=null) return foundtype; } return null; } So I've used AssemblyDef Find method, anyway this doesn't find nested types! What I do wrong? How to fix it? Link to comment
CodeExplorer Posted January 27, 2019 Author Share Posted January 27, 2019 Seems the string is malformed: string toFindType = "Confuser_Methods_Decryptor.MetadataReader"; string WrongStr = "Confuser_Met hods_Decryptor.MetadataRead e r"; int Len1 = toFindType.Length; // 41 int Len2 = WrongStr.Length; // 44 WTF??? toFindType - when I enter that all is ok. Confuser_Methods_Decryptor.MetadataReader "Confuser_Met hods_Decryptor.MetadataRead e r" This board really helps for seeing the malformed string! Link to comment
CodeExplorer Posted January 27, 2019 Author Share Posted January 27, 2019 The solution was to trim spaces and NewLines like this: operand_str = operand_str.TrimEnd(' '); operand_str = operand_str.TrimEnd( '\r', '\n' ); Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now