Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Assembly Runtime #32

Closed
dashne opened this issue Jan 31, 2020 · 2 comments
Closed

Windows Assembly Runtime #32

dashne opened this issue Jan 31, 2020 · 2 comments
Labels

Comments

@dashne
Copy link

dashne commented Jan 31, 2020

how to find out if an AssemblyReference is Windows Runtime Assembly?

@Washi1337
Copy link
Owner

There is no direct property for it (yet). You can resolve the assembly reference to a definition, and then compare the VersionString property in the underlying metadata header. For WinMD assemblies, it should contain start with the string WindowsRuntime, followed by the version number.

Source: adapter.cpp from dotnet/runtime

@Washi1337
Copy link
Owner

Actually, it can be done without resolving the assembly. It is encoded in the assembly attributes with a that AsmResolver 3 does not define yet.

bool isWindowsRuntime = (assembly.Attributes & 0x0E00) == 0x200;

Note that v4 does indeed define these constants.

Source: https://github.com/dotnet/runtime/blob/master/src/coreclr/src/inc/corhdr.h#L767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants