#disassembler #offset #smali #smali-decoder #dalvik-instruction #inst

yanked smali_disassembler

smali disassembler written fully in Rust

3 releases

0.1.2 Sep 21, 2024
0.1.1 Sep 21, 2024
0.1.0 Sep 21, 2024

#21 in #disassembler

MIT license

42KB
1K SLoC

Overview

VERY simple smali disassembler written in Rust

TODO

  • add control flow traits to basic blocks related instuctions (goto, branch, return, ...)
  • add basic util as a cli (kinda like baksmali)
  • add a simple example and document the functions (even though its very very simple :D)

Example

use smali_disassembler::SmaliDecoder;

fn main() {
    let raw_bytes = [0u8; 4];

    let smali_decoder = SmaliDecoder::new(&raw_bytes);
    let disassembled_smali_code = smali_decoder.decode_all();

    println!("result {:#x?}", disassembled_smali_code)
}
result [
    DalvikInstruction {
        inst: Nop,
        offset: 0x0,
    },
    DalvikInstruction {
        inst: Nop,
        offset: 0x2,
    },
]

Dependencies

~8.5MB
~142K SLoC