diff options
| author | plafosse <peter@vector35.com> | 2016-10-28 20:41:40 -0400 |
|---|---|---|
| committer | plafosse <peter@vector35.com> | 2016-10-28 20:41:40 -0400 |
| commit | 18e7e9378a4d7dff8140ed35eb47ce7993bd850b (patch) | |
| tree | c78882aa02a668637fb33124ae20f34a25e461f1 /architecture.cpp | |
| parent | 5e4cca1f1796bec109adacdb049d9e34c17656eb (diff) | |
| parent | b5eacc14097def2367b650fc4a9377d4910441eb (diff) | |
Merging with dev
Diffstat (limited to 'architecture.cpp')
| -rw-r--r-- | architecture.cpp | 20 |
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); |
