Skip to main content

MIPS disassembler

Project description

spimdisasm

PyPI - Downloads GitHub License GitHub release (latest SemVer) PyPI GitHub contributors

A matching MIPS disassembler API and front-ends with built-in instruction analysis.

Currently supports all the CPU instructions for MIPS I, II, III and IV.

Mainly focused on supporting Nintendo 64 binaries, but it should work with other MIPS platforms too.

Features

  • Produces matching assembly.
  • Supports .text, .data, .rodata and .bss disassembly.
    • The reloc section from Zelda 64 and some other games is supported too, but no front-end script uses it yet.
  • Generates separated files for each section of a file (.text, .data, .rodata and .bss).
  • Supports multiple files spliting from a single input binary.
  • Automatic function detection.
    • Can detect if a function is handwritten too.
  • hi/lo pairing with high success rate.
  • Automatic pointer and symbol detection.
  • Function spliting with rodata migration.
  • Supports floats and doubles in rodata.
  • String detection with medium to high success rate.
  • Allows to set user-defined function and symbol names.
  • Big, little and middle endian support.
  • Autogenerated symbols can be named after the section they come from (RO_ and B_ for .rodata and .bss sections) or its type (STR_, FLT_ and DBL_ for string, floats and doubles respectively).
  • Simple file boundary detection.
    • Detects boundaries on .text and .rodata sections
  • Lots of features can be turned on and off.
  • MIPS instructions features:
    • Named registers for MIPS VR4300's coprocessors.
    • Support for many pseudoinstructions.
    • 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/PSYQ:
      • div/divu fix: tweaks a bit the produced div, divu and break instructions.
  • Support for specific MIPS instruction sets:
    • N64's RSP instruction disassembly support.
      • RSP decoding has been tested to build back to matching assemblies with armips.
    • PS1's R3000 GTE instruction set support.
    • PSP's R4000 ALLEGREX instruction set support.
    • PS2's R5900 EE instruction set support.
  • (Experimental) Same VRAM overlay support.
    • Overlays which are able to reference symbols from other overlays in other categories/types is supported too.
    • NOTE: This feature lacks lots of testing and probably has many bugs.

Installing

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

python3 -m pip install -U spimdisasm

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

spimdisasm>=1.39.3,<2.0.0

Development version

The development version is located at the 1.x branch.

The recommended way to install a locally cloned repo is by passing the -e (editable) flag to pip.

python3 -m pip install -e .

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 spimdisasm
python3 -m pip install git+https://github.com/Decompollaborate/spimdisasm.git@1.x

NOTE: Installing the development version is not recommended unless you know what you are doing. Proceed at your own risk.

Versioning and changelog

This library follows Semantic Versioning. We try to always keep backwards compatibility, so no breaking changes should happen until a major release (i.e. jumping from 1.X.X to 2.0.0).

To see what changed on each release check either the CHANGELOG.md file or check the releases page on Github. You can also use this link to check the latest release.

How to use

This repo can be used either by using the existing front-end scripts or by creating new programs on top of the back-end API.

Front-end

Every front-end CLI tool has its own --help screen.

The included tool can be executed with either spimdisasm modulename (for example spimdisasm disasmdis --help) or directly modulename (for example spimdisasm --help)

  • singleFileDisasm: Allows to disassemble a single binary file, producing matching assembly files.

  • disasmdis: Disassembles raw hex passed to the CLI as a MIPS instruction.

  • elfObjDisasm: [EXPERIMENTAL] Allows to disassemble elf files. Generated assembly files are not guaranteed to match or even be assemblable.

  • rspDisasm: Disassemblies RSP binaries.

Back-end

TODO

Check the already existing front-ends is recommended for now.

References

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spimdisasm-1.39.3.tar.gz (108.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spimdisasm-1.39.3-py3-none-any.whl (139.2 kB view details)

Uploaded Python 3

File details

Details for the file spimdisasm-1.39.3.tar.gz.

File metadata

  • Download URL: spimdisasm-1.39.3.tar.gz
  • Upload date:
  • Size: 108.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spimdisasm-1.39.3.tar.gz
Algorithm Hash digest
SHA256 c2c9f67678d511672b5a8c91cb5c26177b00f6f4cbaaacd3acba162e746609fd
MD5 aff47879f79023ffc69cadbb6e97d9bc
BLAKE2b-256 ea9f548b1239e4340763baa4030d2227df7f4b18ac4328c384e1a157d60274b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for spimdisasm-1.39.3.tar.gz:

Publisher: ci.yml on Decompollaborate/spimdisasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spimdisasm-1.39.3-py3-none-any.whl.

File metadata

  • Download URL: spimdisasm-1.39.3-py3-none-any.whl
  • Upload date:
  • Size: 139.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spimdisasm-1.39.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fbe1258926adfaab535e17bb8345e4e4d712029a8f8fe42ee993dd885d2ea510
MD5 475a0eaf74f9bef94cebae08f069b7e2
BLAKE2b-256 3a7135051e46068bff429b3b4c43bfb6d477d4359c5578497c1abfad17064465

See more details on using hashes here.

Provenance

The following attestation bundles were made for spimdisasm-1.39.3-py3-none-any.whl:

Publisher: ci.yml on Decompollaborate/spimdisasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page