diff options
| author | Brian Potchik <brian@vector35.com> | 2021-08-04 11:15:27 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2021-08-04 11:15:27 -0400 |
| commit | b78c9f4f4a53a77ea7267b61e7d90ea7778400df (patch) | |
| tree | 2d36030f9de8f0dddad0c9690e8192ae5b9da68f | |
| parent | 98c2b6f32e3181a3a3462c6bd41306ff674a515b (diff) | |
Add IsConstant API for Register.
| -rw-r--r-- | binaryninjaapi.h | 3 | ||||
| -rw-r--r-- | function.cpp | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 0f49039f..a726b843 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3238,6 +3238,9 @@ __attribute__ ((format (printf, 1, 2))) int64_t offset; RegisterValue(); + + bool IsConstant() const; + static RegisterValue FromAPIObject(const BNRegisterValue& value); BNRegisterValue ToAPIObject(); }; diff --git a/function.cpp b/function.cpp index fc90a8d1..f8b84a8a 100644 --- a/function.cpp +++ b/function.cpp @@ -106,6 +106,12 @@ RegisterValue::RegisterValue(): state(UndeterminedValue), value(0), offset(0) } +bool RegisterValue::IsConstant() const +{ + return (state == ConstantValue) || (state == ConstantPointerValue); +} + + BNRegisterValue RegisterValue::ToAPIObject() { BNRegisterValue result; |
