diff options
| author | Rusty Wagner <rusty@vector35.com> | 2015-02-14 02:18:31 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2015-02-14 02:18:31 -0500 |
| commit | 1c076c0802639dcd3d64a251fb12abb9583b3ee9 (patch) | |
| tree | ac4cc89715f268591a609f4fb3daf477fb557580 | |
| parent | 8a839248af8084c90ad14fabb5d5f7863ac146c0 (diff) | |
Add menu items using transform registrations, hook up copy as and paste from
| -rw-r--r-- | binaryninjaapi.h | 5 | ||||
| -rw-r--r-- | transform.cpp | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 0c226b50..712e5cc8 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -525,7 +525,7 @@ namespace BinaryNinja protected: BNTransform* m_xform; BNTransformType m_typeForRegister; - std::string m_nameForRegister, m_longNameForRegister; + std::string m_nameForRegister, m_longNameForRegister, m_groupForRegister; Transform(BNTransform* xform); @@ -538,7 +538,7 @@ namespace BinaryNinja static std::vector<TransformParameter> EncryptionKeyAndIVParameters(size_t fixedKeyLength = 0, size_t fixedIVLength = 0); public: - Transform(BNTransformType type, const std::string& name, const std::string& longName); + Transform(BNTransformType type, const std::string& name, const std::string& longName, const std::string& group); static void Register(Transform* xform); static Ref<Transform> GetByName(const std::string& name); @@ -547,6 +547,7 @@ namespace BinaryNinja BNTransformType GetType() const; std::string GetName() const; std::string GetLongName() const; + std::string GetGroup() const; virtual std::vector<TransformParameter> GetParameters() const; diff --git a/transform.cpp b/transform.cpp index 4f8fe71d..731ac19c 100644 --- a/transform.cpp +++ b/transform.cpp @@ -9,8 +9,9 @@ Transform::Transform(BNTransform* xform): m_xform(xform) } -Transform::Transform(BNTransformType type, const string& name, const string& longName): - m_xform(nullptr), m_typeForRegister(type), m_nameForRegister(name), m_longNameForRegister(longName) +Transform::Transform(BNTransformType type, const string& name, const string& longName, const string& group): + m_xform(nullptr), m_typeForRegister(type), m_nameForRegister(name), m_longNameForRegister(longName), + m_groupForRegister(group) { } @@ -113,7 +114,7 @@ void Transform::Register(Transform* xform) callbacks.decode = DecodeCallback; callbacks.encode = EncodeCallback; xform->m_xform = BNRegisterTransformType(xform->m_typeForRegister, xform->m_nameForRegister.c_str(), - xform->m_longNameForRegister.c_str(), &callbacks); + xform->m_longNameForRegister.c_str(), xform->m_groupForRegister.c_str(), &callbacks); } @@ -164,6 +165,15 @@ string Transform::GetLongName() const } +string Transform::GetGroup() const +{ + char* name = BNGetTransformGroup(m_xform); + string result = name; + BNFreeString(name); + return result; +} + + vector<TransformParameter> Transform::GetParameters() const { return vector<TransformParameter>(); |
