Code reflection

Is it possible to use reflection to know what the code is doing, not types and methods, but what is inside the method (if instructions, purpose, etc.). I know I can parse it, but I need to parse the class at runtime using C #, for example, find out how many of them exist ...

This tool should be in C #, any ideas? any classes in the CLR that can open the assembly and allow me to navigate through the code inside it.

+3
source share
8 answers

Yes. Microsoft FxCop uses an introspection model that is much richer than reflection. You can use the FxCop API to examine expressions in detail.

+4
source

To be sure, the purpose of reflection is not to reveal such implementation details.

You will need a decompiler / disassembler utility. Decompilers usually target one specific source language, so you need to have one that matches the language in which the assembly is written. If you can use decompiler or API output at the level of your own C # programs, this is another story.

, , , , .

Reflector, , .NET IL, . , , , , #.

+3

? , "if" , , "Cyclomatic complex" , . Visual Studio . Reflector Add-in, .

+1

, " ", , IL. "IF" IL brtrue brfalse . , , IL ( Runtime).

, RAIL ( ). Linked - , , , "if", .

, , .

+1

, FxCop - , . , , - , : .

0

langauge , , , , , .

, . ( , , , !).

, , langauge , langauge , . , ( " X?" ) .

, langauges (C, ++, Java, COBOL, #,...) DMS.

0

Source: https://habr.com/ru/post/1717202/


All Articles