{"id":28128,"library":"rabbitizer","title":"rabbitizer","description":"Rabbitizer is a MIPS instruction decoder library for Python (and Rust/C) that supports multiple MIPS ISAs including R3000GTE, R4000Allegrex, R5900EE, and more. Current version is 1.16.0, with a 2.0.0-alpha series in development. It is used primarily in decompilation toolchains like Decompollaborate's tools. Release cadence is irregular, roughly monthly.","status":"active","version":"1.16.0","language":"python","source_language":"en","source_url":"https://github.com/Decompollaborate/rabbitizer","tags":["mips","disassembler","decompilation","instruction-decoder","native-extension"],"install":[{"cmd":"pip install rabbitizer","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The main classes are in the top-level package, not submodules.","wrong":"from rabbitizer.instruction import Instruction","symbol":"Instruction","correct":"from rabbitizer import Instruction"},{"note":"","wrong":"","symbol":"RabbitizerConfig","correct":"from rabbitizer import RabbitizerConfig"}],"quickstart":{"code":"from rabbitizer import Instruction, RabbitizerConfig\n\n# Decode a MIPS instruction from its hex word\nword = 0x0C000000  # jal 0x0\ninstr = Instruction(word)\nprint(instr.mnemonic())  # jal\nprint(instr.opcode().name())  # jal\nprint(instr.arguments())  # list of arguments\n\n# Access register names\nprint(instr.rs.name())  # $zero\nprint(instr.rt.name())  # $zero\nprint(instr.rd.name())  # $zero\n","lang":"python","description":"Basic usage: create an Instruction from a 32-bit word, then access its properties."},"warnings":[{"fix":"Use instr.mnemonic_display() instead of instr.opcode().name() to get the opcode string.","message":"Using Instruction.opcode().name() is deprecated in favor of Instruction.mnemonic_display(). The new method handles dynamic suffixed instructions (R5900EE) correctly.","severity":"deprecated","affected_versions":">=2.0.0-alpha.8"},{"fix":"Install prebuilt wheels by using a Python version and platform that has wheels (see PyPI). If you must build from source, install Rust via rustup.","message":"The library is a native extension (Rust/C) and wheels are provided for many platforms, but on PyPI only certain Python versions are prebuilt. If building from source, you need a Rust compiler and Cargo. Missing these causes a cryptic ImportError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Reinstall prebuilt wheels: pip install --force-reinstall rabbitizer. If that fails, check Python version compatibility.","cause":"Usually due to incomplete installation or building from source without the required dependencies (Rust compiler).","error":"ImportError: cannot import name 'Instruction' from 'rabbitizer'"},{"fix":"Ensure you have version 1.16.0: pip install rabbitizer==1.16.0","cause":"In older versions (<1.x?) the API might be different, but in 1.16.0 'opcode' exists. Possibly a version mismatch or typo.","error":"AttributeError: 'Instruction' object has no attribute 'opcode'"},{"fix":"Ensure the word is a 32-bit integer (can be hex). For big-endian MIPS, you may need to byte-swap if reading from a little-endian file. Use struct.unpack('>I', ...) to get the correct word.","cause":"The 32-bit word passed to Instruction() is not a valid MIPS instruction or has incorrect byte order.","error":"ValueError: Invalid word: ..."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}