obfuz/Editor/ObfusPasses/ConstObfus/RuleBasedObfuscationPolicy.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2025-04-22 08:13:58 +08:00
using dnlib.DotNet;
using System;
2025-04-05 19:02:50 +08:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2025-05-04 19:55:10 +08:00
namespace Obfuz.ObfusPasses.ConstObfus
2025-04-05 19:02:50 +08:00
{
public class RuleBasedObfuscationPolicy : ConstObfuscationPolicyBase
2025-04-05 19:02:50 +08:00
{
2025-04-22 08:13:58 +08:00
public override bool NeedObfuscateMethod(MethodDef method)
{
return true;
}
public override bool NeedObfuscateInt(MethodDef method, int value)
{
return value > 10000 || value < -10000;
2025-04-22 08:13:58 +08:00
}
public override bool NeedObfuscateLong(MethodDef method, long value)
{
return value > 10000 || value < -10000;
2025-04-22 08:13:58 +08:00
}
public override bool NeedObfuscateFloat(MethodDef method, float value)
{
return true;
}
public override bool NeedObfuscateDouble(MethodDef method, double value)
{
return true;
}
public override bool NeedObfuscateString(MethodDef method, string value)
{
return true;
}
2025-04-23 13:46:50 +08:00
public override bool NeedObfuscateArray(MethodDef method, byte[] array)
{
return true;
}
2025-04-05 19:02:50 +08:00
}
}