From 238d65c98b2983f87c89f78a793ba7c56dcf7b01 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 23 Jun 2024 23:13:03 -0700 Subject: update yaxpeax-arch to 0.3.1, fix fuzz target warnings --- fuzz/fuzz_targets/displaysink_used_correctly.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fuzz/fuzz_targets/displaysink_used_correctly.rs (limited to 'fuzz/fuzz_targets/displaysink_used_correctly.rs') diff --git a/fuzz/fuzz_targets/displaysink_used_correctly.rs b/fuzz/fuzz_targets/displaysink_used_correctly.rs new file mode 100644 index 0000000..bd8d1db --- /dev/null +++ b/fuzz/fuzz_targets/displaysink_used_correctly.rs @@ -0,0 +1,24 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate yaxpeax_x86; +extern crate yaxpeax_arch; + +fuzz_target!(|data: &[u8]| { + let x86_64_decoder = yaxpeax_x86::long_mode::InstDecoder::default(); + let x86_32_decoder = yaxpeax_x86::protected_mode::InstDecoder::default(); + let x86_16_decoder = yaxpeax_x86::real_mode::InstDecoder::default(); + + use yaxpeax_arch::testkit::DisplaySinkValidator; + + if let Ok(inst) = x86_64_decoder.decode_slice(data) { + inst.display_into(&mut DisplaySinkValidator::new()).expect("instruction can be displayed"); + }; + + if let Ok(inst) = x86_32_decoder.decode_slice(data) { + inst.display_into(&mut DisplaySinkValidator::new()).expect("instruction can be displayed"); + }; + + if let Ok(inst) = x86_16_decoder.decode_slice(data) { + inst.display_into(&mut DisplaySinkValidator::new()).expect("instruction can be displayed"); + }; +}); -- cgit v1.1