I got the instruction pointer from a thread in a .NET process and now I’d like to determine
in which module in that process it resides.
So I was thinking to get the loaded modules of the process and check for each of them if:
Module’s Base address <= ip < Module’s Base address + Module’s size.
What I wanted to know is:
How can I get the size of a .NET module? (preferablly in C++)
When you check the instruction pointer when executing .NET code, it will be either in the CLR module, or in the module’s JIT-compiled code.
Neither of these are interesting for you, especially since the JIT compiled CLR code can be thrown away, recompiled, dynamically optimized… there is no such thing as the ‘size’ of a .NET module.