From 1c3762b59af1b949234cc9cc12a42a8fb3765b14 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 25 May 2016 02:02:00 -0400 Subject: Extending register value system to include ranges and lookup table values --- binaryninjaapi.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index c0c9708c..c9c19953 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1312,6 +1312,21 @@ namespace BinaryNinja ArchAndAddr(Architecture* a, uint64_t addr): arch(a), address(addr) {} }; + struct LookupTableEntry + { + std::vector fromValues; + int64_t toValue; + }; + + struct RegisterValue + { + BNRegisterValueType state; + uint32_t reg; // For EntryValue and OffsetFromEntryValue, the original input register + int64_t value; // Offset for OffsetFromEntryValue, StackFrameOffset or RangeValue, value of register for ConstantValue + uint64_t rangeStart, rangeEnd, rangeStep; // Range of register, inclusive + std::vector table; + }; + class FunctionGraph; class Function: public CoreRefCountObject @@ -1337,10 +1352,10 @@ namespace BinaryNinja Ref GetLowLevelIL() const; size_t GetLowLevelILForInstruction(Architecture* arch, uint64_t addr); std::vector GetLowLevelILExitsForInstruction(Architecture* arch, uint64_t addr); - BNRegisterValue GetRegisterValueAtInstruction(Architecture* arch, uint64_t addr, uint32_t reg); - BNRegisterValue GetRegisterValueAfterInstruction(Architecture* arch, uint64_t addr, uint32_t reg); - BNRegisterValue GetRegisterValueAtLowLevelILInstruction(size_t i, uint32_t reg); - BNRegisterValue GetRegisterValueAfterLowLevelILInstruction(size_t i, uint32_t reg); + RegisterValue GetRegisterValueAtInstruction(Architecture* arch, uint64_t addr, uint32_t reg); + RegisterValue GetRegisterValueAfterInstruction(Architecture* arch, uint64_t addr, uint32_t reg); + RegisterValue GetRegisterValueAtLowLevelILInstruction(size_t i, uint32_t reg); + RegisterValue GetRegisterValueAfterLowLevelILInstruction(size_t i, uint32_t reg); std::vector GetRegistersReadByInstruction(Architecture* arch, uint64_t addr); std::vector GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr); std::vector GetStackVariablesReferencedByInstruction(Architecture* arch, uint64_t addr); -- cgit v1.3.1