obfuz/Editor/ObfusPasses/CallObfus/IObfuscationPolicy.cs

35 lines
1012 B
C#
Raw Normal View History

2025-05-10 09:41:45 +08:00
using dnlib.DotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Obfuz.ObfusPasses.CallObfus
{
public struct ObfuscationCachePolicy
{
public bool cacheInLoop;
public bool cacheNotInLoop;
}
public interface IObfuscationPolicy
{
2025-05-10 11:04:25 +08:00
bool NeedObfuscateCallInMethod(MethodDef method);
2025-05-10 09:41:45 +08:00
ObfuscationCachePolicy GetMethodObfuscationCachePolicy(MethodDef method);
2025-05-10 11:04:25 +08:00
bool NeedObfuscateCalledMethod(MethodDef callerMethod, IMethod calledMethod, bool callVir, bool currentInLoop);
2025-05-10 09:41:45 +08:00
}
2025-05-10 18:25:43 +08:00
public abstract class ObfuscationPolicyBase : IObfuscationPolicy
{
public abstract bool NeedObfuscateCallInMethod(MethodDef method);
public abstract ObfuscationCachePolicy GetMethodObfuscationCachePolicy(MethodDef method);
public abstract bool NeedObfuscateCalledMethod(MethodDef callerMethod, IMethod calledMethod, bool callVir, bool currentInLoop);
}
2025-05-10 09:41:45 +08:00
}