set_int_display_type doesn't work with tokens as expected

Open
#2,723 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python

Research direction

Start with the set_int_display_type API and InstructionTextToken operand property, using the linked true.txt reproduction and the provided Python snippet. Compare token.operand with the operand accepted by set_int_display_type; done means the integer display type is set correctly when the token's operand is passed, matching the expected behavior.

Written by the indexing model from the issue text.

Description

Component: API Effort: Low Impact: Low

Binary Ninja Version
2.4.3074-dev

Describe the bug
set_int_display_type's operand argument doesn't match with InstructionTextToken's operand property

To Reproduce
Steps to reproduce the behavior:

  1. Open true.txt
  2. Run
token = current_function.basic_blocks[0][5][0][-1]
print(f"{token=} {token.type=} {token.operand=}")
current_function.set_int_display_type(0x215d, token.value, token.operand, IntegerDisplayType.UnsignedOctalDisplayType)

Expected behavior
The integer display type should be set properly

Screenshots
This doesn't work:
image

This works though:
image

Version and Platform (required):

  • Binary Ninja: 2.4.3074-dev
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.