aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-07-05 03:50:34 +0000
committeriximeow <me@iximeow.net>2026-07-05 03:50:34 +0000
commitf08fb038def88e7025d19aeaa1cb45125074f6c2 (patch)
tree841b46a41143f41721dd6126512dc2e81de28a4c
parent43a6554770d6bfd74c05d37af772e0a65ef54ab1 (diff)
2.2.02.2.0
-rw-r--r--Cargo.toml2
-rw-r--r--fuzz/Cargo.toml6
-rw-r--r--fuzz/fuzz_targets/display_masm_does_not_panic.rs21
-rw-r--r--fuzz/fuzz_targets/instruction_text_buffer_size_ok.rs12
4 files changed, 40 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e7158ea..99667dd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "yaxpeax-x86"
-version = "2.1.1"
+version = "2.2.0"
authors = [ "iximeow <me@iximeow.net>" ]
license = "0BSD"
repository = "http://git.iximeow.net/yaxpeax-x86/"
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 2e554db..e5c1105 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -48,6 +48,12 @@ test = false
doc = false
[[bin]]
+name = "display_masm_does_not_panic"
+path = "fuzz_targets/display_masm_does_not_panic.rs"
+test = false
+doc = false
+
+[[bin]]
name = "does_not_decode_invalid_registers"
path = "fuzz_targets/does_not_decode_invalid_registers.rs"
test = false
diff --git a/fuzz/fuzz_targets/display_masm_does_not_panic.rs b/fuzz/fuzz_targets/display_masm_does_not_panic.rs
new file mode 100644
index 0000000..ac9bd02
--- /dev/null
+++ b/fuzz/fuzz_targets/display_masm_does_not_panic.rs
@@ -0,0 +1,21 @@
+#![no_main]
+#[macro_use] extern crate libfuzzer_sys;
+extern crate yaxpeax_x86;
+
+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();
+
+ if let Ok(inst) = x86_64_decoder.decode_slice(data) {
+ let _ = inst.display_with(yaxpeax_x86::long_mode::DisplayStyle::Masm).to_string();
+ };
+
+ if let Ok(inst) = x86_32_decoder.decode_slice(data) {
+ let _ = inst.display_with(yaxpeax_x86::protected_mode::DisplayStyle::Masm).to_string();
+ };
+
+ if let Ok(inst) = x86_16_decoder.decode_slice(data) {
+ let _ = inst.display_with(yaxpeax_x86::real_mode::DisplayStyle::Masm).to_string();
+ };
+});
diff --git a/fuzz/fuzz_targets/instruction_text_buffer_size_ok.rs b/fuzz/fuzz_targets/instruction_text_buffer_size_ok.rs
index 2c88424..16bd098 100644
--- a/fuzz/fuzz_targets/instruction_text_buffer_size_ok.rs
+++ b/fuzz/fuzz_targets/instruction_text_buffer_size_ok.rs
@@ -21,6 +21,10 @@ fuzz_target!(|data: &[u8]| {
write!(s, "{}", inst.display_with(DisplayStyle::C)).expect("can write");
// MAX_INSTRUCTION_LEN is not a public crate item yet...
assert!(s.len() < 512);
+ s.clear();
+ write!(s, "{}", inst.display_with(DisplayStyle::Masm)).expect("can write");
+ // MAX_INSTRUCTION_LEN is not a public crate item yet...
+ assert!(s.len() < 512);
};
if let Ok(inst) = x86_32_decoder.decode_slice(data) {
@@ -34,6 +38,10 @@ fuzz_target!(|data: &[u8]| {
write!(s, "{}", inst.display_with(DisplayStyle::C)).expect("can write");
// MAX_INSTRUCTION_LEN is not a public crate item yet...
assert!(s.len() < 512);
+ s.clear();
+ write!(s, "{}", inst.display_with(DisplayStyle::Masm)).expect("can write");
+ // MAX_INSTRUCTION_LEN is not a public crate item yet...
+ assert!(s.len() < 512);
};
if let Ok(inst) = x86_16_decoder.decode_slice(data) {
@@ -47,5 +55,9 @@ fuzz_target!(|data: &[u8]| {
write!(s, "{}", inst.display_with(DisplayStyle::C)).expect("can write");
// MAX_INSTRUCTION_LEN is not a public crate item yet...
assert!(s.len() < 512);
+ s.clear();
+ write!(s, "{}", inst.display_with(DisplayStyle::Masm)).expect("can write");
+ // MAX_INSTRUCTION_LEN is not a public crate item yet...
+ assert!(s.len() < 512);
};
});