[][src]Function solana_rbpf::disassembler::disassemble

pub fn disassemble(prog: &[u8])

Disassemble an eBPF program into human-readable instructions and prints it to standard output.

The program is not checked for errors or inconsistencies.

Examples

use solana_rbpf::disassembler;
let prog = &[
    0x07, 0x01, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00,
    0xb7, 0x02, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00,
    0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xdc, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
    0x87, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
];
disassembler::disassemble(prog);

This will produce the following output:

add64 r1, 0x605
mov64 r2, 0x32
mov64 r1, r0
be16 r0
neg64 r2
exit