Is it possible to check IsPInvokeImpl on a method without needing to resolve the MethodReference? #969

Open
opened 2025-04-21 06:57:04 -05:00 by b1bradders · 0 comments
b1bradders commented 2025-04-21 06:57:04 -05:00 (Migrated from github.com)

I'm trying to make this scanner which blocks the use of external code in BepInEx mods. Due to it being run before any assemblies have been resolved, there is a time where calling Resolve() on a MethodReference may throw a AssemblyResolutionException.

I was wondering if it was possible to get IsPInvokeImpl (or something similar that can tell me if it's an extern method), without resolving the MethodReference 🤔

I'm trying to make this scanner which blocks the use of external code in BepInEx mods. Due to it being run before any assemblies have been resolved, there is a time where calling `Resolve()` on a `MethodReference` may throw a `AssemblyResolutionException`. I was wondering if it was possible to get IsPInvokeImpl (or something similar that can tell me if it's an `extern` method), without resolving the `MethodReference` 🤔
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil#969
No description provided.