Skip to content

What is New in Capstone.NET 2.x

Ahmed Garhy edited this page Jan 23, 2019 · 1 revision

Overview

Capstone.NET 1.x was first released almost 4 years ago in 2015. As much as I was happy with Capstone.NET 1.x, there were definitely some problems with it that did not become apparent until the first public release. It did not support the X64 runtime of .NET Framework, APIs that should have been marked as internal were marked as public, there was a dependency on a C library to help address structure alignment issues, some naming conventions deviated from Capstone, and not all of Capstone's features were supported. I couldn't make any significant changes, that frankly bothered me personally, without breaking backwards-compatibility.

Now, 4 years later and with the release of Capstone 4.x, I figured I could take a chance in redesigning Capstone.NET to address the concerns I had without, hopefully, destroying too much confidence in the project's stability. The result is Capstone.NET 2.x.

A More Obvious Note on Backwards-Compatibility with Capstone.NET 1.x

Capstone.NET 2.x is absolutely NOT backwards-compatible with Capstone.NET 1.x. The object model and public API are new and different and in-place upgrade by existing applications and libraries will break. Please do not upgrade until you are prepared to put in the effort to refactor your existing applications and libraries.

I want to apologize in advance for these breaking changes. I know how incredibly frustrating it can be to have a library you depend on introduce breaking changes but ultimately I feel the new code-base is much cleaner and will allow for easier integration moving forward.

For convenience, the latest version of Capstone.NET 1.x, Capstone.NET 1.2.2, is tagged on the repository and you can continue to reference it until you are ready to upgrade.

So, What's New?

(+) Capstone 4.x Support: Capstone.NET 2.x supports Capstone 4.x. It does not support any other major version of Capstone so please don't try to use any other major version.

(+) .NET Core 2.x and .NET Framework 4.x Support: Capstone.NET 2.x supports .NET Core 2.x and .NET Framework 4.x.

(+) X86 and X64 Support: Capstone.NET 2.x supports the X86 and X64 versions of Capstone as well as the X86 and X64 runtimes of .NET Core and .NET Framework.

(+) Windows/Linux/MacOS Support: With support for .NET Core, Capstone.NET 2.x should support Windows, Linux, and MacOS. I have not tested on Linux and MacOS so please feel free to test on those operating systems and open a ticket if you encounter a problem.

(+) No External Dependencies: The dependency on the dreaded C library in Capstone.NET 1.x is gone! Beginning with Capstone.NET 2.x there are no more external dependencies, except obviously for Capstone.

(+) Named Types: Capstone.NET 1.x used generic types with extremely large type definitions quite extensively. That is normally not an issue but types with extremely large type definitions are usually a burden, in terms of code readability, to work with. Beginning with Capstone.NET 2.x, even though generic types are still in use as abstract classes, there are named types that extend from them for easier code readability.

(+) Consistent Naming Conventions: Capstone.NET 1.x had naming conventions for instructions, instruction groups, and registers that deviated from Capstone's naming conventions. That is normally not an issue but a few folks raised concerns that it made it challenging to look up something in Capstone and find its equivalent in Capstone.NET. Beginning with Capstone.NET 2.x, the same naming conventions as Capstone are used to help address this challenge.