Vector35 / Vector35/binaryninja-api

Common pattern should be simplified in HLIL

Open
#2,596 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Core Effort: Medium IL Optimization Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Binary Ninja Version

2.4.2950-dev Personal

Describe the bug

Binja can't optimize IL that looks like this:

00000084      char temp211 = 0
00000084      if (arg1)
00000084          temp211 = 1
00000090      if (temp211 == 1)
00000090          return 1
0000008c      return 0

To Reproduce
Steps to reproduce the behavior:

  1. Install https://github.com/google/binja-hexagon/ plugin
  2. Open https://github.com/google/binja-hexagon/blob/main/test_binaries/prebuilt/bn_llil_test_app in binja
  3. Navigate to test_dualjump_cond_jump function

Expected behavior

I want HLIL to look like:

00000084      if (arg1)
00000090          return 1
0000008c      return 0

Version and Platform (required):

  • Binary Ninja: 2.4.2950-dev Personal
  • OS: Debian Linux
  • Version Buster

Additional context

Split from https://github.com/google/binja-hexagon/issues/4

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

Reproduce the issue by opening test_binaries/prebuilt/bn_llil_test_app from the binja-hexagon plugin and navigating to test_dualjump_cond_jump. Compare the current HLIL with the expected form in the report; done means the temporary-variable pattern is simplified into the conditional return without regressing related HLIL behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.