diff options
| author | Mason Reed <mason@vector35.com> | 2025-07-10 01:32:32 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-15 12:34:43 -0400 |
| commit | 1c01b00d87e45c7ae8eb6320b20e7dcf67915d77 (patch) | |
| tree | e861d689ad737bb1140cd24654d74bbd82c3068d /lowlevelil.cpp | |
| parent | 99e442620e8e19053120dc44239372d1fb5a3053 (diff) | |
Move LLIL instruction retrieval into the LLIL function where it belongs
The python API was kept the same seeing as we are close to the release, will likely start deprecating some of those API's soon.
Diffstat (limited to 'lowlevelil.cpp')
| -rw-r--r-- | lowlevelil.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lowlevelil.cpp b/lowlevelil.cpp index 33dea219..dd3989f1 100644 --- a/lowlevelil.cpp +++ b/lowlevelil.cpp @@ -96,6 +96,29 @@ size_t LowLevelILFunction::GetInstructionStart(Architecture* arch, uint64_t addr return BNLowLevelILGetInstructionStart(m_object, arch ? arch->GetObject() : nullptr, addr); } +std::set<size_t> LowLevelILFunction::GetInstructionsAt(Architecture *arch, uint64_t addr) +{ + size_t count; + size_t* instructions = BNLowLevelILGetInstructionsAt(m_object, arch ? arch->GetObject() : nullptr, addr, &count); + std::set<size_t> result; + for (size_t i = 0; i < count; i++) + result.insert(instructions[i]); + BNFreeILInstructionList(instructions); + return result; +} + +std::vector<size_t> LowLevelILFunction::GetExitsForInstruction(size_t i) +{ + size_t count; + size_t* instructions = BNLowLevelILGetExitsForInstruction(m_object, i, &count); + std::vector<size_t> result; + result.reserve(count); + for (size_t j = 0; j < count; j++) + result.push_back(instructions[j]); + BNFreeILInstructionList(instructions); + return result; +} + void LowLevelILFunction::ClearIndirectBranches() { |
