News for hackers. Stuff that matters.
Re:Assembly Language: Still Relevant Today by dx211 on Friday November 06, 2015 @06:11PM (#10522669)
.Net provides a couple of different ways to dynamically emit IL, but that's not quite the same as being able to emit your own native machine instructions, though. I think the challenge would be that you'd need to work out a calling convention between the jitted code and the emitted native code, at which point you might as well stick the native code in its own library function and compile or assemble it with a native tool.
Re:Assembly Language: Still Relevant Today by ChrisLomont on Friday November 06, 2015 @08:45PM (#10523253)
People have done this if you dig around. The basic idea is you can assemble arbitrary code into a byte array, then use an unsafe cast and use PInvoke to execute. The calling convention for many platforms has been reverse engineered, but I don't have a link handy. I've used it before to see if it works, and you can do it.