From fe925b01df7934785aa5dc67d23c577f13ad42e6 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Sun, 26 Aug 2018 15:31:12 -0400 Subject: Add support for new constant type EXTERN_PTR --- examples/mlil_parser/src/mlil_parser.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'examples/mlil_parser/src/mlil_parser.cpp') diff --git a/examples/mlil_parser/src/mlil_parser.cpp b/examples/mlil_parser/src/mlil_parser.cpp index a4c10f61..a9411251 100644 --- a/examples/mlil_parser/src/mlil_parser.cpp +++ b/examples/mlil_parser/src/mlil_parser.cpp @@ -323,17 +323,10 @@ int main(int argc, char *argv[]) // Example of using visitors to find all constants in the instruction instr.VisitExprs([&](const MediumLevelILInstruction& expr) { - switch (expr.operation) - { - case MLIL_CONST: - case MLIL_CONST_PTR: - case MLIL_EXTERN_PTR: + bool status = MediumLevelILFunction::IsConstantType(expr.operation); + if (status) printf(" Found constant 0x%" PRIx64 "\n", expr.GetConstant()); - return false; // Done parsing this - default: - break; - } - return true; // Parse any subexpressions + return !status; }); // Example of using the templated accessors for efficiently parsing load instructions -- cgit v1.3.1