Skip to content

AOT: Determine runtime version linked to native binary #105705

Answered by AustinWise
dlosch asked this question in General
Discussion options

You must be logged in to vote

Do you want a way to identify the AOT version used to create any binary, by anyone? Or just for the binaries you create?

If you want to identify an executable as being generated by NativeAOT, all NativeAOT executables export a symbol named DotNetRuntimeDebugHeader. It points to this struct. Currently this struct does not contain the product version. You could open an issue or PR requesting the product version be added to that structure.

If you have symbols for the executable, you can easily find the RhGetRuntimeVersion function. This is an implementation detail, but it currently has the product version. Here it is decompiled in Ghidra:

You could also change your build process to include …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dlosch
Comment options

@AustinWise
Comment options

Answer selected by dlosch
@dlosch
Comment options

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