Crates.io | pydis |
lib.rs | pydis |
version | 0.4.0 |
source | src |
created_at | 2020-12-12 04:52:21.857209 |
updated_at | 2021-08-12 01:58:32.797866 |
description | Python 2.7 bytecode disassembler |
homepage | |
repository | https://github.com/landaire/pydis |
max_upload_size | |
id | 322076 |
size | 36,637 |
A Rust crate for disassembling Python 2.7 bytecode
use pydis::prelude::*;
use pydis::opcode::py27::Standard;
fn disassemble(bytecode: &[u8]) {
let mut rdr = std::io::Cursor::new(bytecode);
// Decode using the standard Python 2.7 opcode table.
// A custom opcode table can be passed by calling `decode::<OpcodeTable, _>(source)`
while let Ok(instr) = decode_py27::<Standard, _>(&mut rdr) {
println!("{:#?}", instr);
}
}