Improve Labeling API

Open
#4,372 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python

Research direction

Start with LowLevelILFunction.mark_label() and the labeling usage in examples/workflows/inliner/inliner.cpp. Compare how LowLevelILInstruction targets are represented and determine the API or documentation scope needed for arbitrary goto targets. Done means callers can create jumps to arbitrary instructions without manual label manipulation or ctypes knowledge.

Written by the indexing model from the issue text.

Description

Component: API Effort: Medium Impact: Medium

What is the feature you'd like to have?
The "labeling" API is currently undocumented and convoluted. It is necessary for many tasks when creating workflows.
Currently, labels must be manually modified manually (which is cumbersome and requires ctypes knowledge in Python), even in the official examples

Is your feature request related to a problem?
When modifying LowLevelIL and trying to insert goto/jump instructions, one needs to create a label in order to specify the target. In order to create these, the normal API is LowLevelILFunction.mark_label(). This API is inadequate because it is only capable of targeting the next added instruction (which is also undocumented, by the way). Instead, an API needs to be exposed to allow selecting label targets based on LowLevelILInstructions or another flexible mechanism.

Are any alternative solutions acceptable?
Provide/document an additional API for creating goto instructions pointing to arbitrary instructions.

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

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.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.