The following target triples are supported: It also has some compiler-specific heuristics and language-specific behavior.įor example, it can demangle C++ symbol names as used by CodeWarrior.Ĭollectively, the output's architecture, compiler, and source language are referred to as a target.
Target Architecture / Compiler / Languageĭespite the name, mips_to_c has support for both MIPS and PPC assembly. Caching can be disabled with the -no-cache argument. gitignore), and are automatically regenerated if context files change. The cache for foo/bar.c is stored in foo/bar.m2c. Run with -help to see which options are available.Ĭontext files provided with -context are parsed and cached, so subsequent runs with the same file are faster.
This project requires Python 3.6 or later. See the tests/ directory for some example input and output.ĭespite the project's name, mips_to_c also has experimental support for PowerPC (PPC) as well.Īn online version is also available. The input is expected to match a particular assembly format, such as that produced by tools like mipsdisasm. Right now the decompiler is fairly functional, though it sometimes generates suboptimal code (especially for loops). This differentiates it from other decompilation suites, such as IDA or Ghidra. The focus of mips_to_c is to aid in the process of producing "matching" C source files. However, it may also work with other compilers or hand-written assembly. It primarily focuses on supporting popular compilers of the late 1990's. The goal of this project is to support decompilation projects, which aim to write C code that yields byte-identical output when compiled with a particular build system. Given some MIPS or PPC assembly, this program will attempt to convert it to C.