diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-12-01 18:13:54 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2016-12-01 18:13:54 -0500 |
| commit | 8c42dabe92340b4d342f3b4e7594fb70f1890e41 (patch) | |
| tree | 406a4a0e0486b00a71b3d0bb65a3dd15cdf91981 /architecture.cpp | |
| parent | f69430aedd957f5e8f221488cd6acb9031d3c1c1 (diff) | |
| parent | 3b719e990e3e01242918bf66d5a1fb6032517641 (diff) | |
Merge branch '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); |
