通过.NET x86汇编可能吗? [英] Is x86 assembler via .NET possible?
问题描述
是否有这样的事,作为一个x86汇编,我可以通过C#调用?我希望能够通过x86指令作为一个字符串,并得到一个字节数组回来。如果不存在,我怎样才能使自己的
Is there such a thing as an x86 assembler that I can call through C#? I want to be able to pass x86 instructions as a string and get a byte array back. If one doesn't exist, how can I make my own?
需要明确的是 - 我不想的呼叫的汇编代码C# - 我只是想能够从指示汇编代码和一个字节数组拿到机器代码。我将这种注入代码(将实时生成)注入到其他进程完全。
To be clear - I don't want to call assembly code from C# - I just want to be able to assemble code from instructions and get the machine code in a byte array. I'll be injecting this code (which will be generated on the fly) to inject into another process altogether.
推荐答案
由于零件一些早期的原型我在个人项目做了,我写了相当多的代码做这样的事情。它并不需要串 - 86码是在一个X86Writer类的方法。它不是在所有的记录,并有隔靴搔痒全覆盖,但它是否会感兴趣,我愿意开放源码下的新的BSD许可证了。
As part of some early prototyping I did on a personal project, I wrote quite a bit of code to do something like this. It doesn't take strings -- x86 opcodes are methods on an X86Writer class. Its not documented at all, and has nowhere near complete coverage, but if it would be of interest, I would be willing to open-source it under the New BSD license.
更新:
好吧,我已经创建了一个项目 - Managed.X86
这篇关于通过.NET x86汇编可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!