本文整理汇总了C#中de4dot.code.renamer.asmmodules.MMethodDef类的典型用法代码示例。如果您正苦于以下问题:C# MMethodDef类的具体用法?C# MMethodDef怎么用?C# MMethodDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MMethodDef类属于de4dot.code.renamer.asmmodules命名空间,在下文中一共展示了MMethodDef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: addMethod
// Returns the previous method, or null if none
public MMethodDef addMethod(MMethodDef ifaceMethod, MMethodDef classMethod)
{
var ifaceKey = new MethodDefKey(ifaceMethod);
if (!ifaceMethodToClassMethod.ContainsKey(ifaceKey))
throw new ApplicationException("Could not find interface method");
MMethodDef oldMethod;
ifaceMethodToClassMethod.TryGetValue(ifaceKey, out oldMethod);
ifaceMethodToClassMethod[ifaceKey] = classMethod;
return oldMethod;
}
开发者ID:GodLesZ,项目名称:ConfuserDeobfuscator,代码行数:12,代码来源:TypeDef.cs
示例2: Add
public void Add(MMethodDef m) {
methods.Add(m);
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:3,代码来源:TypeDef.cs
示例3: GetEventMethodType
static EventMethodType GetEventMethodType(MMethodDef method) {
var evt = method.Event;
if (evt == null)
return EventMethodType.None;
if (evt.AddMethod == method)
return EventMethodType.Adder;
if (evt.RemoveMethod == method)
return EventMethodType.Remover;
if (evt.RaiseMethod == method)
return EventMethodType.Raiser;
return EventMethodType.Other;
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:12,代码来源:Renamer.cs
示例4: CreatePropertySetter
MPropertyDef CreatePropertySetter(string name, MMethodDef propMethod) {
if (string.IsNullOrEmpty(name))
return null;
var ownerType = propMethod.Owner;
if (!ownerType.HasModule)
return null;
if (propMethod.Property != null)
return null;
var sig = propMethod.MethodDef.MethodSig;
if (sig == null || sig.Params.Count == 0)
return null;
var propType = sig.Params[sig.Params.Count - 1];
var propDef = CreateProperty(ownerType, name, propType, null, propMethod.MethodDef);
if (propDef == null)
return null;
if (propDef.SetMethod != null)
return null;
if (isVerbose)
Logger.v("Restoring property setter {0} ({1:X8}), Property: {2} ({3:X8})",
Utils.RemoveNewlines(propMethod),
propMethod.MethodDef.MDToken.ToInt32(),
Utils.RemoveNewlines(propDef.PropertyDef),
propDef.PropertyDef.MDToken.ToInt32());
propDef.PropertyDef.SetMethod = propMethod.MethodDef;
propDef.SetMethod = propMethod;
propMethod.Property = propDef;
return propDef;
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:29,代码来源:Renamer.cs
示例5: GetOverriddenMethod
MMethodDef GetOverriddenMethod(MMethodDef overrideMethod) {
return modules.ResolveMethod(overrideMethod.MethodDef.Overrides[0].MethodDeclaration);
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:3,代码来源:Renamer.cs
示例6: GetOverriddenProperty
MPropertyDef GetOverriddenProperty(MMethodDef overrideMethod) {
var theMethod = overrideMethod.MethodDef.Overrides[0].MethodDeclaration;
var overriddenMethod = modules.ResolveMethod(theMethod);
if (overriddenMethod != null)
return overriddenMethod.Property;
var extType = theMethod.DeclaringType;
if (extType == null)
return null;
var extTypeDef = modules.ResolveOther(extType);
if (extTypeDef == null)
return null;
var theMethodDef = extTypeDef.FindMethod(theMethod);
if (theMethodDef != null)
return theMethodDef.Property;
return null;
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:18,代码来源:Renamer.cs
示例7: GetOverriddenEvent
MEventDef GetOverriddenEvent(MMethodDef overrideMethod) {
MMethodDef overriddenMethod;
return GetOverriddenEvent(overrideMethod, out overriddenMethod);
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:4,代码来源:Renamer.cs
示例8: Add
public void Add(MMethodDef method) {
methods.Add(method);
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:3,代码来源:MethodNameGroups.cs
示例9: CanRenameMethod
bool CanRenameMethod(MMethodDef methodDef) {
var methodInfo = Method(methodDef);
if (methodDef.IsStatic()) {
if (methodInfo.oldName == ".cctor")
return false;
}
else if (methodDef.IsVirtual()) {
if (DotNetUtils.DerivesFromDelegate(type.TypeDef)) {
switch (methodInfo.oldName) {
case "BeginInvoke":
case "EndInvoke":
case "Invoke":
return false;
}
}
}
else {
if (methodInfo.oldName == ".ctor")
return false;
}
return true;
}
开发者ID:heartbleeded,项目名称:de4dot,代码行数:22,代码来源:TypeInfo.cs
示例10: PrepareRenameMethodArgs
void PrepareRenameMethodArgs(MMethodDef methodDef) {
VariableNameState newVariableNameState = null;
ParamInfo info;
if (methodDef.VisibleParameterCount > 0) {
if (IsEventHandler(methodDef)) {
info = Param(methodDef.ParamDefs[methodDef.VisibleParameterBaseIndex]);
if (!info.GotNewName())
info.newName = "sender";
info = Param(methodDef.ParamDefs[methodDef.VisibleParameterBaseIndex + 1]);
if (!info.GotNewName())
info.newName = "e";
}
else {
newVariableNameState = variableNameState.CloneParamsOnly();
var checker = NameChecker;
foreach (var paramDef in methodDef.ParamDefs) {
if (paramDef.IsHiddenThisParameter)
continue;
info = Param(paramDef);
if (info.GotNewName())
continue;
if (!checker.IsValidMethodArgName(info.oldName))
info.newName = newVariableNameState.GetNewParamName(info.oldName, paramDef.ParameterDef);
}
}
}
info = Param(methodDef.ReturnParamDef);
if (!info.GotNewName()) {
if (!NameChecker.IsValidMethodReturnArgName(info.oldName)) {
if (newVariableNameState == null)
newVariableNameState = variableNameState.CloneParamsOnly();
info.newName = newVariableNameState.GetNewParamName(info.oldName, methodDef.ReturnParamDef.ParameterDef);
}
}
if ((methodDef.Property != null && methodDef == methodDef.Property.SetMethod) ||
(methodDef.Event != null && (methodDef == methodDef.Event.AddMethod || methodDef == methodDef.Event.RemoveMethod))) {
if (methodDef.VisibleParameterCount > 0) {
var paramDef = methodDef.ParamDefs[methodDef.ParamDefs.Count - 1];
Param(paramDef).newName = "value";
}
}
}
开发者ID:heartbleeded,项目名称:de4dot,代码行数:45,代码来源:TypeInfo.cs
示例11: RenameSpecialMethod
void RenameSpecialMethod(MMethodDef methodDef, string newName) {
if (methodDef == null)
return;
if (methodDef.IsVirtual())
return;
RenameMethod(methodDef, newName);
}
开发者ID:heartbleeded,项目名称:de4dot,代码行数:7,代码来源:TypeInfo.cs
示例12: MethodInfo
public MethodInfo(MMethodDef methodDef)
: base(methodDef) {
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:3,代码来源:MemberInfos.cs
示例13: Method
public MethodInfo Method(MMethodDef method) {
return allMethodInfos[method];
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:3,代码来源:MemberInfos.cs
示例14: MethodInst
public MethodInst(MMethodDef origMethodDef, IMethodDefOrRef methodRef) {
this.origMethodDef = origMethodDef;
this.methodRef = methodRef;
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:4,代码来源:TypeDef.cs
示例15: MethodDefKey
public MethodDefKey(MMethodDef methodDef) {
this.methodDef = methodDef;
}
开发者ID:GreenDamTan,项目名称:de4dot,代码行数:3,代码来源:TypeDef.cs
示例16: Get
public MethodNameGroup Get(MMethodDef method) {
if (!method.IsVirtual())
throw new ApplicationException("Not a virtual method");
MethodNameGroup group;
if (!methodGroups.TryGetValue(method, out group)) {
methodGroups[method] = group = new MethodNameGroup();
group.Add(method);
}
return group;
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:10,代码来源:MethodNameGroups.cs
示例17: RenameMethod
public void RenameMethod(MMethodDef methodDef, string methodName) {
if (!CanRenameMethod(methodDef))
return;
var methodInfo = Method(methodDef);
variableNameState.AddMethodName(methodName);
methodInfo.Rename(methodName);
}
开发者ID:heartbleeded,项目名称:de4dot,代码行数:7,代码来源:TypeInfo.cs
示例18: GetOverridePrefix
static string GetOverridePrefix(MethodNameGroup group, MMethodDef method) {
if (method == null || method.MethodDef.Overrides.Count == 0)
return "";
if (group.Methods.Count > 1) {
// Don't use an override prefix if the group has an iface method.
foreach (var m in group.Methods) {
if (m.Owner.TypeDef.IsInterface)
return "";
}
}
var overrideMethod = method.MethodDef.Overrides[0].MethodDeclaration;
if (overrideMethod.DeclaringType == null)
return "";
var name = overrideMethod.DeclaringType.FullName.Replace('/', '.');
name = removeGenericsArityRegex.Replace(name, "");
return name + ".";
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:17,代码来源:Renamer.cs
示例19: GetPinvokeName
string GetPinvokeName(MMethodDef methodDef) {
var entryPoint = methodDef.MethodDef.ImplMap.Name.String;
if (Regex.IsMatch(entryPoint, @"^#\d+$"))
entryPoint = DotNetUtils.GetDllName(methodDef.MethodDef.ImplMap.Module.Name.String) + "_" + entryPoint.Substring(1);
return entryPoint;
}
开发者ID:heartbleeded,项目名称:de4dot,代码行数:6,代码来源:TypeInfo.cs
示例20: GetPropertyMethodType
static PropertyMethodType GetPropertyMethodType(MMethodDef method) {
if (DotNetUtils.HasReturnValue(method.MethodDef))
return PropertyMethodType.Getter;
if (method.VisibleParameterCount > 0)
return PropertyMethodType.Setter;
return PropertyMethodType.Other;
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:7,代码来源:Renamer.cs
注:本文中的de4dot.code.renamer.asmmodules.MMethodDef类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论