Replies: 1 comment
-
|
For those who care, a quick workaround: private static IEnumerable<string> GetImports(Assembly assembly)
{
return assembly.GetTypes().SelectMany(GetImports);
}
private static IEnumerable<string> GetImports(Type type)
{
return type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).SelectMany(GetImports)
.Concat(type.GetNestedTypes().SelectMany(GetImports));
}
private static IEnumerable<string> GetImports(MethodInfo methodInfo)
{
if ((methodInfo.Attributes & MethodAttributes.PinvokeImpl) != 0)
yield return methodInfo.GetCustomAttribute<DllImportAttribute>().Value;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
In a mixed-mode assembly, is there any way to get the list of native imports? (such as libc or things like this).
I can find samples using C++, but this is something I would like to do using dnlib, if possible.
Has somoeone an idea?
Beta Was this translation helpful? Give feedback.
All reactions