用于从字节数组获取 IL 的 API
MethodBody 类中有一个 GetILAsByteArray 方法,它给出方法的主体。 我正在寻找将此字节数组转换为更易于理解的 IL 指令(转换为列表或类似的东西)。 有哪些资源、开源代码或可用的 API 可以帮助我理解和转换这个字节数组(或为我做)?
我发现了这个,但它不适用于泛型。 我几乎正在寻找指导来转换理解所有框架版本中的这些字节。
CLI 文档对于学习 IL 指令也很有帮助,但我不知道如何使用它来使这些字节有意义。
There is a GetILAsByteArray method in MethodBody class which gives body of a method. I am looking for converting this byte array into more understandable IL instructions (into a List or something like that). What resources, open source code or api available are there to help me understand and convert this byte array (or do it for me)?
I found this but it does not work with generics. I am pretty much looking for guidance to convert understand these bytes in all framework versions.
CLI Documentation is also helpful for learning IL instructions but I cannot see how to use it to make these bytes make sense.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我刚刚编写了一个扩展方法,以使用 GetILasByteArray 获取更易于理解的指令列表。 这很简单,API 就像:
您可以在我的 博客文章。 或者您可以获取实现并开始使用它。
I just wrote an extension method to get a more understandable list of instructions using GetILAsByteArray. It's quite simple, the API is like:
You can read more about the implementation in my blog post. Or you can go take the implementation and start using it.
查看 Mono.Cecil 库。
Have a look at the Mono.Cecil library.
这是一项艰巨的任务。 我编写了一个 IL 阅读器的开头,并且实现了相当多的操作码:但是您将需要完成它。
http://svn.ensemble-os.org/tags/OldOCJ/CIL/< /a>
还有 MONO Cecil,功能齐全。
It is a huge undertaking. I wrote the starts of an IL reader and it had a pretty good amount of opcodes implemented: but you will need to finish it.
http://svn.ensemble-os.org/tags/OldOCJ/CIL/
There is also MONO Cecil, which is feature-complete.