Vector35 / Vector35/binaryninja-api

FormInputField::Integer doesn't handle 0n prefix

Open
#5,374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Version and Platform (required):

  • Binary Ninja Version: 4.1.5246-dev
  • OS: macOS
  • OS Version: 14
  • CPU Architecture: M1

Bug Description:
The FormInputField APi for Integer fields doesn't respect the 0n1234 convention binja generally uses for numbers, nor does it use hex-by-default conventions either. We should make it match the integer parsing behavior seen elsewhere in the app.

Steps To Reproduce:

  1. Run this python:
fi = IntegerField('int')
get_form_input([fi], 'a')
fi.result
  1. Try to type 0n1234
  2. Observe error box
  3. Type 1234
  4. Observe result is decimal 1234 and not 0x1234

Expected Behavior:
I expected integer form inputs to match the rest of the product

Additional Information:
Likely in mainwindow's interaction handler

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 at the mainwindow interaction handler mentioned in the report and trace how IntegerField input is parsed. Reproduce the issue with the supplied Python snippet, then verify that 0n1234 is accepted and that an unprefixed 1234 follows the product's hex-by-default convention.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.