Vector35 / Vector35/binaryninja-api
Bare identifier appears alone on line before (constant?) assignment (HLIL and Pseudo-C)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
Version (required):
- Binary Ninja Version: 3.4.4144-dev
Bug Description:
From @zino on public slack (link to thread below):
"I've been seeing these double statement now and then, first just stating a data variable and then on the next line setting it. Not a problem but it looks funny every time it happens."
(See screenshots.)
Steps To Reproduce:
Please provide all steps required to reproduce the behavior:
wget https://paste.c-net.org/SmarterTwins -O AmLite.tar.gztar xzf AmLite.tar.gzbinaryninja AmLite- go to
0x20cad3d - View HLIL or Pseudo-C
- Observe issue: bare identifier appears on its own line before assignment on the next.
Expected Behavior:
Expect not to see the lines with just the bare identifier.
Screenshots:
LLIL -> Pseudo-C:

LLIL -> HLIL:

LLIL -> MLIL:

Assembly:

Additional Information:
Posting this issue for @zino on the public slack in this thread: https://binaryninja.slack.com/archives/C0CVALTLN/p1678746976324619
My (unsubstantiated) speculation from that thread:
Ok I suspect this is a combination of
- temp reg being used for the swap (is this from an x86 xchg instruction?)
- constant propagation of a 0 from that data var
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Download AmLite.tar.gz, open it in Binary Ninja, navigate to 0x20cad3d, and compare the HLIL and Pseudo-C output with LLIL, MLIL, and assembly. Start by tracing how the intermediate representations are rendered at that location. Done means the standalone identifier lines no longer appear before the following assignments in HLIL or Pseudo-C.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100