TypeOxidizer (v1.2.2)

February 24, 2025 ยท View on GitHub

Author: azw / austinzwile

TypeOxidizer converts the C-Style types in your HLIL / decompilation to their Rust equivalents for easier reading / interpretation and shorter decompilation.

Description:

TypeOxidizer is a Binary Ninja plugin that seamlessly transforms the C-Style types in your HLIL / decompilation to their Rust equivalents through automatic typedef declaration and retyping, making for a cleaner and more precise decompilation. With built-in support for standard integer and floating-point types as well as strings, TypeOxidizer enhances your analysis by "oxidizing" legacy type definitions into Rust's clean and precise syntax.

Demo

Here's a nice before:

image

and after:

image

Usage

The following registered commands are available via the Plugins dropdown menu as well as the command pallette with CMD+P:

  • Convert from C to Rust Types
  • Revert to C Types from Rust

Features

The conversion from and to following types are currently handled:

C TypeRust Type
uint8_tu8
uint16_tu16
uint32_tu32
uint64_tu64
uint128_tu128
int8_ti8
int16_ti16
int32_ti32
int64_ti64
int128_ti128
floatf32
doublef64
size_tusize
ssize_tisize
char*str

Installation Instructions

Darwin

Install via the Plugin Manager or by cloning the repo at https://github.com/austinzwile/TypeOxidizer and dropping the folder into your plugins directory.

Linux

Install via the Plugin Manager or by cloning the repo at https://github.com/austinzwile/TypeOxidizer and dropping the folder into your plugins directory.

Windows

Install via the Plugin Manager or by cloning the repo at https://github.com/austinzwile/TypeOxidizer and dropping the folder into your plugins directory.

Minimum Version

This plugin requires the following minimum version of Binary Ninja:

  • 3164

Required Dependencies

The following dependencies are required for this plugin:

Todo

  • Implement a drop-down/content menu to allow for selective conversion between C and Rust.
  • Handle structs and typedefs. The types within already defined type definitions don't get handled right.
  • Add proper conversion of types when typecasting. The decompilation currently doesn't allow for the retyping of anything on the right side of an equals sign so I will have to figure that out. Possibly for workflows.

Required Dependencies

The following dependencies are required for this plugin:

License

This plugin is released under a MIT license.

Metadata Version

2