简体   繁体   中英

Accessing in memory assembly

I am looking at creating and dynamically compiling an assembly in memory from serialized code. Is it possible to dump or access the memory to gain access to the code of the assembly?

That depends on how you create the assembly.For example, if you use the CSharpCodeProvider , you can set CompilerParameters that will save the assembly in memory or to a file. Or both. You could then read the output file.

You could also define a dynamic assembly and then save it to disk.

In either case, you can access the code and other information in the assembly using reflection (ie System.Reflection.Assembly ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM