summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-05-25 02:02:00 -0400
committerRusty Wagner <rusty@vector35.com>2016-05-25 02:02:12 -0400
commit1c3762b59af1b949234cc9cc12a42a8fb3765b14 (patch)
treede06a790c461fd8587f44a9ddb8d15c179333d19 /binaryninjaapi.h
parent05128d0d96b07156ea91243911efcd4da2a0b8c6 (diff)
Extending register value system to include ranges and lookup table values
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h23
1 files changed, 19 insertions, 4 deletions
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<int64_t> 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<LookupTableEntry> table;
+ };
+
class FunctionGraph;
class Function: public CoreRefCountObject<BNFunction, BNNewFunctionReference, BNFreeFunction>
@@ -1337,10 +1352,10 @@ namespace BinaryNinja
Ref<LowLevelILFunction> GetLowLevelIL() const;
size_t GetLowLevelILForInstruction(Architecture* arch, uint64_t addr);
std::vector<size_t> 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<uint32_t> GetRegistersReadByInstruction(Architecture* arch, uint64_t addr);
std::vector<uint32_t> GetRegistersWrittenByInstruction(Architecture* arch, uint64_t addr);
std::vector<StackVariableReference> GetStackVariablesReferencedByInstruction(Architecture* arch, uint64_t addr);