From 88ecc534a2965a7da0d8e9c351d16c11cb5ed418 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Wed, 5 Feb 2025 10:16:45 +0100 Subject: [PATCH] add Instruction::is_pseudo_ins() --- androscalpel/src/instructions.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/androscalpel/src/instructions.rs b/androscalpel/src/instructions.rs index 4b72558..4dcd7a4 100644 --- a/androscalpel/src/instructions.rs +++ b/androscalpel/src/instructions.rs @@ -2106,6 +2106,22 @@ impl Instruction { Ok(serde_json::from_str(json)?) } + /// Test if the instruction is a dalvik instruction or a pseudo instruction like a label or a + /// debug info. + pub fn is_pseudo_ins(&self) -> bool { + matches!( + self, + Self::Try { .. } + | Self::Label { .. } + | Self::DebugLocal { .. } + | Self::DebugEndLocal { .. } + | Self::DebugEndPrologue {} + | Self::DebugBeginEpilogue {} + | Self::DebugSourceFile { .. } + | Self::DebugLine { .. } + ) + } + pub fn __str__(&self) -> String { match self { Self::Nop {} => "nop".into(),