Tool

m2c

Decompiler for matching projects that turns GNU as-format 32-bit MIPS, ARM, PowerPC and SuperH assembly into draft C, with partial C++ support. A target combines platform, compiler (IDO, GCC or MetroWerks CodeWarrior) and language; context files supply types, and it can infer unknown struct fields and emit global initializers. The README places it alongside splat, asm-differ and decomp-permuter, and decomp.me calls it for initial decompilations.

Requirements and limitations

  • Python 3.8+ with graphviz. Run m2c.py from a checkout or install it from the Git repository as a Python package; the package named m2c on PyPI is an unrelated project. There are no releases or tags, so this entry pins the reviewed master commit (last commit at review: 2026-09-16).
  • Input must match the GNU as assembly format, such as spimdisasm output. The README lists the mips, mipsel, mipsee (eabi64), ppc, arm, gba (APCS) and sh2 platforms, the ido, gcc and mwcc compilers, and the c and c++ languages. Struct-field inference skips structs with bitfields or unnamed union fields, and initializers cannot be generated for bitfield structs or symbols of unknown type.
  • GPL-3.0-only. The README warns that output is sometimes suboptimal, especially for loops; it is a starting point to refine and check with a compiler and diff tool, not byte-identical source. No assembly was decompiled.

About this entry

Type
Tool
Category
Game analysis tools
Relationship
Foundation tool
Targets
Binary · Game

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Primary sources

  1. README.md GitHub · matt-kempster/m2c · Revision 708d2d2
  2. README.md#L26-L49 GitHub · matt-kempster/m2c · Revision 708d2d2
  3. README.md#L387-L404 GitHub · matt-kempster/m2c · Revision 708d2d2
  4. pyproject.toml GitHub · matt-kempster/m2c · Revision 708d2d2
  5. LICENSE GitHub · matt-kempster/m2c · Revision 708d2d2
  6. cromper/cromper/wrappers/m2c_wrapper.py GitHub · decompme/decomp.me · Revision f585075