Git Product home page Git Product logo

ilreader's Introduction

CIL-Reader for Methods(e.g. dynamic) and Delegates

Common Intermediate Language reader, analyzer and visualizer tool.
Allows you to access CIL-instructions of .Net method's bodies.

Nuget Version

Core Library (ILReader.Core)

Provides a way to read and interprete CIL-bytes of methods and delegates bodies.

Usage:

var method = typeof(...).GetMethod(...);
// or
var method = delegate.Method;
// or
var method = (DynamicMethod)(/* create or get method */);

Get Reader:

IILReader GetReader(MethodBase method) {
    IILReaderConfiguration cfg = Configuration.Resolve(method);
    return reader = cfg.GetReader(method);
}

Iterate instructions one-by-one:

foreach(IInstruction instruction in reader) {
    var opCode = instruction.OpCode
    object operand = instruction.Operand;
    int ILOffset = instruction.Offset;
    // ...
}

Visualizer Library (ILReader.Visualizer)

Debugger Visualizer for Visual Studio. Provides a way to view CIL-bytes of methods and delegates bodies.

Usage:

Func<...> someFunc = ...; // Just use it while debugging

Analyzer Library (ILReader.Analyzer)

Provides a way to detect typical patterns in CIL-bytes.

Usage:

class Bar {
    public void Stub() {
        throw new NotImplementedException("Stub");
    }
}

Check whether or not the method's body match pattern:

var method = typeof(Bar).GetMethod("Stub");
var reader = GetReader(method);
// use default pattern or create you own
var pattern = Analyzer.NotImplemented.Instance;
if (pattern.Match(reader)) {
    // do something
}

Real usage

NuGet

To install ILReader.Core, run the following command in the Package Manager Console:

Install-Package ILReader.Core

License

The ILReader.Core library is licensed under the MIT license.

ilreader's People

Contributors

dmitrygaravsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dadhi c3nb zha0

ilreader's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.