From 1148826e2bd5f9733bd638d96d4eeadd22958296 Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 14 Jan 2019 01:53:54 -0800 Subject: adjust namespace layout --- Cargo.toml | 13 ++++++++++++- src/lib.rs | 6 +++--- test/test.rs | 4 ++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b18575d..51c590e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "x86-rs" +name = "yaxpeax-x86" version = "0.0.1" authors = [ "iximeow " ] repository = "x86-rs" @@ -19,3 +19,14 @@ A rust x86-64 decoder [[test]] name = "test" path = "test/test.rs" + +[[bench]] +name = "bench" +path = "test/bench.rs" + +[features] +default = [] + +# This enables some capstone benchmarks over the same +# instruction bytes used to bench this code. +capstone_bench = [] diff --git a/src/lib.rs b/src/lib.rs index 87d74cf..21ce8c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ impl RegSpec { } fn gp_from_parts(num: u8, extended: bool, width: u8, rex: bool) -> RegSpec { - println!("from_parts width: {}, num: {}, extended: {}", width, num, extended); +// println!("from_parts width: {}, num: {}, extended: {}", width, num, extended); RegSpec { num: num + if extended { 0b1000 } else { 0 }, bank: width_to_gp_reg_bank(width, rex) @@ -1962,7 +1962,7 @@ pub fn decode_one<'a, 'b, T: IntoIterator>(bytes: T, instr: &'b mut Some(()) }, Err(reason) => { - panic!("Decode error on operand: {:?}", reason); +// panic!("Decode error on operand: {:?}", reason); // println!("Invalid instruction: {}", reason); // return Instruction::invalid() None @@ -1970,7 +1970,7 @@ pub fn decode_one<'a, 'b, T: IntoIterator>(bytes: T, instr: &'b mut } } Err(reason) => { - panic!("Decode error on opcode: {:?}", reason); +// panic!("Decode error on opcode: {:?}", reason); // println!("Invalid instruction: {}", reason); // return Instruction::invalid() None diff --git a/test/test.rs b/test/test.rs index 956faf1..8a0b6cb 100644 --- a/test/test.rs +++ b/test/test.rs @@ -1,6 +1,6 @@ -extern crate x86_rs; +extern crate yaxpeax_x86; -use x86_rs::{Instruction, Opcode, decode_one}; +use yaxpeax_x86::{Instruction, Opcode, decode_one}; fn decode(bytes: &[u8]) -> Option { let mut instr = Instruction::invalid(); -- cgit v1.1