All Projects → matt-kempster → Mips_to_c

matt-kempster / Mips_to_c

Licence: gpl-3.0
A MIPS decompiler.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mips to c

Ex4 to mq4 cli
Unofficial CLI support for ex4_to_mq4 decompiler. Note: This is the wrapper, not decompiler!
Stars: ✭ 42 (-70%)
Mutual labels:  decompiler
Jremapper
Remapping tool for compiled java programs.
Stars: ✭ 97 (-30.71%)
Mutual labels:  decompiler
Ccompiler
c语言编译器,用 lex 和 yacc 工具完成词法分析与语法分析并生成语法树,C++实现了语 法树的解析并生成中间代码,生成中间代码的过程中实现了错误检测。C++实 现了中间代码的优化操作。之后利用 python 对中间代码进行处理并生成 mips 汇编码并且可以成功在 PCSpim(mips 模拟器)上运行。
Stars: ✭ 113 (-19.29%)
Mutual labels:  mips
Termux Apktool
Decompile and Recompile android aplication use termux without openjdk installed
Stars: ✭ 53 (-62.14%)
Mutual labels:  decompiler
Unisimd Assembler
SIMD macro assembler unified for ARM, MIPS, PPC and x86
Stars: ✭ 63 (-55%)
Mutual labels:  mips
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+889.29%)
Mutual labels:  mips
Mips
MIPS assembler and simulator
Stars: ✭ 38 (-72.86%)
Mutual labels:  mips
Rcore
Rust version of THU uCore OS. Linux compatible.
Stars: ✭ 2,175 (+1453.57%)
Mutual labels:  mips
Mrspicky
MrsPicky - An IDAPython decompiler script that helps auditing calls to the memcpy() and memmove() functions.
Stars: ✭ 86 (-38.57%)
Mutual labels:  decompiler
Keystone
Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
Stars: ✭ 1,654 (+1081.43%)
Mutual labels:  mips
Hexrays scripts
Various scripts for the Hexrays decompiler (kloppy, shuffle, arachno, IDA coffee, screenrecorder, ricky)
Stars: ✭ 50 (-64.29%)
Mutual labels:  decompiler
Simplesmali
通过精简Smali语法细节来增强反编译代码阅读性,自定义了一种简单语法
Stars: ✭ 61 (-56.43%)
Mutual labels:  decompiler
Papermario
Decompilation of Paper Mario
Stars: ✭ 105 (-25%)
Mutual labels:  mips
Redasm
The OpenSource Disassembler
Stars: ✭ 1,042 (+644.29%)
Mutual labels:  mips
Unreal Library
A decompiler library for Unreal packages such as .upk and .u files, supporting Unreal Engine 1, 2, and 3.
Stars: ✭ 123 (-12.14%)
Mutual labels:  decompiler
Mips Cpu
A MIPS CPU implemented in Verilog
Stars: ✭ 38 (-72.86%)
Mutual labels:  mips
Jsc Decompile Mozjs 34
A javascript bytecode decoder for mozilla spider-monkey version 34. May decompile jsc file compile by cocos-2dx
Stars: ✭ 101 (-27.86%)
Mutual labels:  decompiler
Ubnt Mips Shadowsocks Libev
Cross complie shadowsocks for UBNT devices based on mipsel or mips64
Stars: ✭ 127 (-9.29%)
Mutual labels:  mips
Despector
Java / Kotlin Decompiler and AST Library
Stars: ✭ 126 (-10%)
Mutual labels:  decompiler
Gda Android Reversing Tool
GDA is a new fast and powerful decompiler in C++(working without Java VM) for the APK, DEX, ODEX, OAT, JAR, AAR, and CLASS file. which supports malicious behavior detection, privacy leaking detection, vulnerability detection, path solving, packer identification, variable tracking, deobfuscation, python&java scripts, device memory extraction, dat…
Stars: ✭ 2,332 (+1565.71%)
Mutual labels:  decompiler

mips_to_c

Given some MIPS assembly, this program will attempt to convert it to C. The goal is that eventually the output will be well-formed C, and eventually after that, byte-equivalent C.

Right now the decompiler is fairly functional, though it sometimes generates suboptimal code (especially for loops), and sometimes crashes. See the tests/ directory for some example output.

Install

Make sure you have Python 3.6 or later installed, then do python3 -m pip install --upgrade attrs pycparser.

You might need to install pip first; on Ubuntu this can be done with:

sudo apt update
sudo apt install python3-pip

Usage

python3 mips_to_c.py [options] <asmfile> <functionname | index | all>

Run with --help to see which options are available.

Contributing

There is much low-hanging fruit still. Take a look at the issues if you want to help out.

We use black to auto-format our code. We recommend using pre-commit to ensure only auto-formatted code is committed. To set these up, run:

pip install pre-commit black
pre-commit install

Your commits will then be automatically formatted per commit. You can also manually run black on the command-line.

There is a small test suite, which works as follows:

  • As you develop your commit, occasionally run ./run_tests.py to see if any tests have changed output. These tests run the decompiler on a small corpus of IDO 5.3-compiled MIPS assembly.
  • Before pushing your commit, run ./run_tests.py --overwrite to write changed tests to disk, and commit resultant changes.

You are encouraged to add new tests using the ./tests/add_test.py script. Make sure to ./run_tests.py after adding new tests.

Type annotations are used for all Python code. mypy mips_to_c.py should pass without any errors.

To get pretty graph visualizations, install graphviz using pip and globally on your system (e.g. sudo apt install graphviz), and pass the --visualize flag.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].