MIPS instruction decoder
Go to file
2024-04-03 12:41:26 -03:00
.github/workflows Update cibuildwheel on GHA 2024-02-18 16:50:30 -03:00
.vscode Add markdown linter to CI 2023-09-22 15:54:19 -03:00
cplusplus Fix rsp pref too 2024-03-11 09:30:45 -03:00
docs getBranchVramGeneric should return an unsigned value (#49) 2023-12-25 14:58:47 -03:00
include Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
rabbitizer Fix rsp pref too 2024-03-11 09:30:45 -03:00
rust Fix rsp pref too 2024-03-11 09:30:45 -03:00
src Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
tables Consider r5900's paddub as a possible move instruction 2024-03-25 20:54:06 -03:00
tests Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
.clang-format Change column limit to 120 2022-12-20 00:47:17 -03:00
.clang-tidy
.gitattributes Implement neg pseudo 2024-02-18 11:34:07 -03:00
.gitignore Add markdown linter to CI 2023-09-22 15:54:19 -03:00
.markdownlint.jsonc Fix linting on changelog.md 2023-09-22 15:01:26 -03:00
Cargo.toml Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
CHANGELOG.md Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
LICENSE
Makefile Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
MANIFEST.in Update copyright years 2024-01-28 12:16:11 -03:00
pyproject.toml Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
README.md cleanups 2024-03-18 10:16:51 -03:00
setup.py Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00

rabbitizer

PyPI - Downloads GitHub GitHub release (latest SemVer) PyPI crate.io GitHub contributors

MIPS instruction decoder API.

Features

  • Should produce matching assembly.
  • Fully written in C for fast decoding.
    • The library is completely allocation-less, in other words rabbitizer doesn't allocate in anything in the heap by itself.
  • Other language bindings supported in this repo:
    • Python bindings
      • The minimal Python version is 3.7, older versions are not guaranteed to work.
    • C++ bindings
    • Rust bindings
  • Simple per-word instruction decoding.
    • The library doesn't try to be too smart by processing multiple instructions at a time.
  • Can perform validation checks for instructions.
  • Provides many examination/grouping functions for instructions, allowing to simplify checking characteristics of an instruction and minimizing the need to check for specific instructions in a hardcoded way.
  • Includes some minor tools to build your own pointer/symbol detection.
  • Configurable, many features can be turned on and off.
  • MIPS instructions features:
    • Named registers for MIPS VR4300's coprocessors.
    • Support for many pseudo-instructions.
    • Properly handle move to/from coprocessor instructions.
    • Support for numeric, o32, n32 and n64 ABI register names.
  • Some workarounds for some specific compilers/assemblers:
    • SN64:
      • div/divu fix: tweaks a bit the produced div, divu and break instructions.
  • Multiple MIPS architectures are supported:
    • Main focus on MIPS I, II and III architectures. Partial support for MIPS IV too.
    • N64 RSP instruction decoding support.
      • RSP decoding has been tested to build back to matching assemblies with armips.
    • R5900 (PS2's Emotion Engine processor) decoding support.

Non-features

In order to keep it simple and fast the following features will not be added:

  • Pseudo-instructions which expands to more than one instruction.

Installing

Python bindings

The recommended way to install is using from the PyPi release, via pip:

python3 -m pip install -U rabbitizer

If you use a requirements.txt file in your repository, then you can add this library with the following line:

rabbitizer>=1.9.4,<2.0.0

Development version

The unstable development version is located at the develop branch. PRs should be made into that branch instead of the main one.

In case you want to mess with the latest development version without wanting to clone the repository, then you could use the following command:

python3 -m pip uninstall rabbitizer
python3 -m pip install git+https://github.com/Decompollaborate/rabbitizer.git@develop

NOTE: Installing the development version is not recommended. Proceed at your own risk.

See this package at https://pypi.org/project/rabbitizer/.

Rust bindings

Add this crate to your project with Cargo:

cargo add rabbitizer

Or you can add it manually to your Cargo.toml:

rabbitizer = "1.9.4"

See this crate at https://crates.io/crates/rabbitizer.

References