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 --- binaryninjacore.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'binaryninjacore.h') diff --git a/binaryninjacore.h b/binaryninjacore.h index 51a3afdf..0eff6aaf 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -358,14 +358,27 @@ extern "C" OffsetFromEntryValue, ConstantValue, StackFrameOffset, - UndeterminedValue + UndeterminedValue, + OffsetFromUndeterminedValue, + SignedRangeValue, + UnsignedRangeValue, + LookupTableValue + }; + + struct BNLookupTableEntry + { + int64_t* fromValues; + size_t fromCount; + int64_t toValue; }; struct BNRegisterValue { BNRegisterValueType state; uint32_t reg; // For EntryValue and OffsetFromEntryValue, the original input register - int64_t value; // Offset for OffsetFromEntryValue or StackFrameOffset, value of register for ConstantValue + int64_t value; // Offset for OffsetFromEntryValue, StackFrameOffset or RangeValue, value of register for ConstantValue + uint64_t rangeStart, rangeEnd, rangeStep; // Range of register, inclusive + BNLookupTableEntry* table; // Number of entries in rangeEnd }; struct BNRegisterOrConstant @@ -1102,6 +1115,7 @@ extern "C" uint32_t reg); BINARYNINJACOREAPI BNRegisterValue BNGetRegisterValueAtLowLevelILInstruction(BNFunction* func, size_t i, uint32_t reg); BINARYNINJACOREAPI BNRegisterValue BNGetRegisterValueAfterLowLevelILInstruction(BNFunction* func, size_t i, uint32_t reg); + BINARYNINJACOREAPI void BNFreeRegisterValue(BNRegisterValue* value); BINARYNINJACOREAPI uint32_t* BNGetRegistersReadByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, size_t* count); BINARYNINJACOREAPI uint32_t* BNGetRegistersWrittenByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, -- cgit v1.3.1