DLL: Output explicit interface implementation names correctly

This commit is contained in:
Katy Coe
2021-01-09 21:50:31 +01:00
parent 900b690d36
commit d4db6666d9

View File

@@ -223,7 +223,12 @@ namespace Il2CppInspector.Outputs
else else
s = PropertySig.CreateInstance(GetTypeSig(module, prop.PropertyType)); s = PropertySig.CreateInstance(GetTypeSig(module, prop.PropertyType));
var mProp = new PropertyDefUser(prop.Name, s, (PropertyAttributes) prop.Attributes); // Unmangle name of explicit interface instantiations
var name = prop.Name;
if (name.IndexOf('.') != -1)
name = name.Substring(name.LastIndexOf('.') + 1);
var mProp = new PropertyDefUser(name, s, (PropertyAttributes) prop.Attributes);
mProp.GetMethod = AddMethod(module, mType, prop.GetMethod); mProp.GetMethod = AddMethod(module, mType, prop.GetMethod);
mProp.SetMethod = AddMethod(module, mType, prop.SetMethod); mProp.SetMethod = AddMethod(module, mType, prop.SetMethod);
@@ -273,8 +278,13 @@ namespace Il2CppInspector.Outputs
method.DeclaredParameters.Select(p => GetTypeSig(module, p.ParameterType)) method.DeclaredParameters.Select(p => GetTypeSig(module, p.ParameterType))
.ToArray()); .ToArray());
// Unmangle name of explicit interface instantiations - don't touch .ctor or .cctor
var name = method.Name;
if (name.IndexOf('.') != -1 && !method.IsSpecialName)
name = name.Substring(name.LastIndexOf('.') + 1);
// Definition // Definition
var mMethod = new MethodDefUser(method.Name, s, (MethodImplAttributes) method.MethodImplementationFlags, (MethodAttributes) method.Attributes); var mMethod = new MethodDefUser(name, s, (MethodImplAttributes) method.MethodImplementationFlags, (MethodAttributes) method.Attributes);
// Generic type parameters // Generic type parameters
foreach (var gp in method.GetGenericArguments()) { foreach (var gp in method.GetGenericArguments()) {