summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-08-26 15:31:12 -0400
committerPeter LaFosse <peter@vector35.com>2018-08-26 15:31:12 -0400
commitfe925b01df7934785aa5dc67d23c577f13ad42e6 (patch)
tree8a2e05c645c6be7dbc12897cb1a696f16066b8af /examples
parent4fdd54f690e538ddb4e38248144ef3d3e0f817da (diff)
Add support for new constant type EXTERN_PTR
Diffstat (limited to 'examples')
-rw-r--r--examples/mlil_parser/src/mlil_parser.cpp13
1 files changed, 3 insertions, 10 deletions
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