summaryrefslogtreecommitdiff
path: root/architecture.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-10-24 19:03:00 -0400
committerRusty Wagner <rusty@vector35.com>2016-10-24 19:03:00 -0400
commitb5eacc14097def2367b650fc4a9377d4910441eb (patch)
tree62fccbe6e01676a422117302703f33e893b7acd0 /architecture.cpp
parent045571e89c195dfb39cad5e635679be715c9123f (diff)
parent6b307f7cad00e4d89e5ed66b9d67e374078f8b95 (diff)
Merge branch 'thumb' into dev
Diffstat (limited to 'architecture.cpp')
-rw-r--r--architecture.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/architecture.cpp b/architecture.cpp
index af7b0cba..3c7d9af8 100644
--- a/architecture.cpp
+++ b/architecture.cpp
@@ -111,6 +111,13 @@ size_t Architecture::GetOpcodeDisplayLengthCallback(void* ctxt)
}
+BNArchitecture* Architecture::GetAssociatedArchitectureByAddressCallback(void* ctxt, uint64_t* addr)
+{
+ Architecture* arch = (Architecture*)ctxt;
+ return arch->GetAssociatedArchitectureByAddress(*addr)->GetObject();
+}
+
+
bool Architecture::GetInstructionInfoCallback(void* ctxt, const uint8_t* data, uint64_t addr,
size_t maxLen, BNInstructionInfo* result)
{
@@ -408,6 +415,7 @@ void Architecture::Register(Architecture* arch)
callbacks.getDefaultIntegerSize = GetDefaultIntegerSizeCallback;
callbacks.getMaxInstructionLength = GetMaxInstructionLengthCallback;
callbacks.getOpcodeDisplayLength = GetOpcodeDisplayLengthCallback;
+ callbacks.getAssociatedArchitectureByAddress = GetAssociatedArchitectureByAddressCallback;
callbacks.getInstructionInfo = GetInstructionInfoCallback;
callbacks.getInstructionText = GetInstructionTextCallback;
callbacks.freeInstructionText = FreeInstructionTextCallback;
@@ -499,6 +507,12 @@ size_t Architecture::GetOpcodeDisplayLength() const
}
+Ref<Architecture> Architecture::GetAssociatedArchitectureByAddress(uint64_t&)
+{
+ return this;
+}
+
+
bool Architecture::GetInstructionLowLevelIL(const uint8_t*, uint64_t, size_t&, LowLevelILFunction& il)
{
il.AddInstruction(il.Undefined());
@@ -919,6 +933,12 @@ size_t CoreArchitecture::GetOpcodeDisplayLength() const
}
+Ref<Architecture> CoreArchitecture::GetAssociatedArchitectureByAddress(uint64_t& addr)
+{
+ return new CoreArchitecture(BNGetAssociatedArchitectureByAddress(m_object, &addr));
+}
+
+
bool CoreArchitecture::GetInstructionInfo(const uint8_t* data, uint64_t addr, size_t maxLen, InstructionInfo& result)
{
return BNGetInstructionInfo(m_object, data, addr, maxLen, &result);