Vector35 / Vector35/binaryninja-api

No obvious way to retrieve on IL instruction given an IL basic block from the C++ API

Open
#4,654 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: API Effort: Trivial Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

There is no obvious way to retrieve on IL instruction given an IL basic block from the C++ API. It is easy in Python, that we can either directly index the IL basic block or iterate over it.

By looking at the Python source code, I noticed that a viable is to first retrieve the IL function and then index into it. https://github.com/Vector35/binaryninja-api/blob/2f415e3da3a417160c07928cc8b91f42eddbac3f/python/lowlevelil.py#L5289C1-L5290. It would be better if there is an API to do it directly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python implementation in lowlevelil.py around the linked lines, then inspect the corresponding C++ IL basic-block and function API. Determine how direct instruction lookup should be exposed consistently with existing indexing or iteration, and verify that callers can retrieve an instruction from a basic block through the C++ API.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api, reverse-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.