Pin type position when a nested type has a RuntimeInitializeOnLoadMethod

pull/36/head
olivato 2026-09-01 16:29:19 +01:00
parent 5680d7ef39
commit b3ef0049fc
1 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,13 @@ namespace Obfuz.ObfusPasses.SymbolObfus
{
return true;
}
return type.Methods.Any(MetaUtil.HasRuntimeInitializeOnLoadMethodAttribute);
return HasRuntimeInitializeOnLoadMethod(type);
}
private static bool HasRuntimeInitializeOnLoadMethod(TypeDef type)
{
return type.Methods.Any(MetaUtil.HasRuntimeInitializeOnLoadMethodAttribute)
|| type.NestedTypes.Any(HasRuntimeInitializeOnLoadMethod);
}
private bool IsPositionPinnedMethod(MethodDef method)