Support for custom CIL instructions
See original GitHub issueHi,
For a project I’m currently working on, I need to be able to insert custom CIL instructions into a method body (ones that are understood by the runtime I’m targeting). Basically, I just want to be able to provide dnlib with custom OpCode
instances that inform it about how to decode/encode these instructions, calculate stack usage and control flow, etc.
From what I can gather looking at the source, what would need to happen for this to be possible is:
OpCode
would need to be made extensible in some form (probably just a public constructor).- There would need to be some place in the API for registering custom
OpCode
instances. MethodBodyReaderBase
and a few other places need to be made aware about the experimental opcode range (0xf0
…0xfb
).
There may of course be other required changes that I’m not aware of, but I think that’s the gist of it.
Would a patch for this be welcome? If so, what would be an acceptable design for this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Common Intermediate Language (CIL) - What Does It Look ...
CIL is an object-oriented assembly language and is CPU and platform-independent instructions that can be executed in any environment supporting the Common ...
Read more >How to use CIL instruction conv.r4
Today I started to learn how CIL code works. ... I want to replace var1 with hard-written value. ... Convert to float32, pushing...
Read more >CIL programming tutorial – The Basics Part I
For this tutorial you will need the IL Support Visual Studio extension which can be downloaded from here. Creating your first IL code....
Read more >Common Intermediate Language
CIL is a CPU- and platform-independent instruction set that can be executed in any environment supporting the Common Language Infrastructure, such as the...
Read more >Ted Neward - Busy Developer's Guide to .NET ... - YouTube
CIL (Common Intermediate Language) is the execution code set used by the .NET runtime (the Common Language Infrastructure, or CLI) that is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would expect that if you want to define your own custom opcodes, you’d create a table with 256 values in it so an array should be enough.
0xF0-0xFB
can then be overridden to use those arrays (if they’re not null).Add new overloads
The
opResolver
is usually a module but we can’t assume it.