2025-04-05 19:02:50 +08:00
|
|
|
|
using dnlib.DotNet;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Obfuz.Rename
|
|
|
|
|
{
|
|
|
|
|
public interface IRenamePolicy
|
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(ModuleDefMD mod);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(TypeDef typeDef);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(MethodDef methodDef);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(FieldDef fieldDef);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(PropertyDef propertyDef);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
bool NeedRename(EventDef eventDef);
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class RenamePolicy : IRenamePolicy
|
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(ModuleDefMD mod)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(TypeDef typeDef)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(MethodDef methodDef)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(FieldDef fieldDef)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(PropertyDef propertyDef)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-05 21:47:28 +08:00
|
|
|
|
public bool NeedRename(EventDef eventDef)
|
2025-04-05 19:02:50 +08:00
|
|
|
|
{
|
2025-04-05 21:47:28 +08:00
|
|
|
|
return true;
|
2025-04-05 19:02:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|