change: ObfuscationMethodWhitelist::IsInWhiteList(MethodDef)对于带有`[RuntimeInitializeOnLoadMethod]`的函数,如果LoadType等于或者早于AfterAssembliesLoaded,就不对函数进行混淆
parent
3fe3a6b302
commit
05c3fd24bf
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obfuz
|
||||
{
|
||||
|
@ -15,7 +16,7 @@ namespace Obfuz
|
|||
public bool IsInWhiteList(ModuleDef module)
|
||||
{
|
||||
string modName = module.Assembly.Name;
|
||||
if (modName == "Obfuz.Runtime")
|
||||
if (modName == ConstValues.ObfuzRuntimeAssemblyName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -40,6 +41,15 @@ namespace Obfuz
|
|||
{
|
||||
return true;
|
||||
}
|
||||
CustomAttribute ca = method.CustomAttributes.Find("UnityEngine.RuntimeInitializeOnLoadMethodAttribute");
|
||||
if (ca != null && ca.ConstructorArguments.Count > 0)
|
||||
{
|
||||
RuntimeInitializeLoadType loadType = (RuntimeInitializeLoadType)ca.ConstructorArguments[0].Value;
|
||||
if (loadType >= RuntimeInitializeLoadType.AfterAssembliesLoaded)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue