mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Merge pull request #174
Fix incorrect warning on methods unstripped by unhollower
This commit is contained in:
1 file changed
+12
-2
@@ -55,8 +55,18 @@ namespace BepInEx.IL2CPP.Hook
|
||||
var methodField = UnhollowerUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(Original);
|
||||
|
||||
if (methodField == null)
|
||||
throw new Exception($"No IL2CPP equivalent found for {Original.FullDescription()}. The target might have been automatically generated by Unhollower (e.g. field accessor).");
|
||||
|
||||
{
|
||||
var fieldInfoField = UnhollowerUtils.GetIl2CppFieldInfoPointerFieldForGeneratedFieldAccessor(Original);
|
||||
|
||||
if (fieldInfoField != null)
|
||||
{
|
||||
throw new Exception($"Method {Original.FullDescription()} is a field accessor, it can't be patched.");
|
||||
}
|
||||
|
||||
// Generated method is probably unstripped, it can be safely handed to IL handler
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the native MethodInfo struct for the target method
|
||||
originalNativeMethodInfo = (Il2CppMethodInfo*)(IntPtr)methodField.GetValue(null);
|
||||
|
||||
|
||||
Reference in new issue
Block a user