Vector35 / Vector35/binaryninja-api

Optimization of struct variable assignation

Open
#3,744 1 comment 1 reaction 1 assignee View on GitHub

@rssor is already working on this.

Since Feb 6, 2023.

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

Description

rdi is pointer to structure, rsi is zero.

Disassembly:

163e0af9  mov     qword [rdi+0x768], rsi  {0x0}
163e0b00  lea     rbx, [rdi+0x1d0]
163e0b07  mov     dword [rbx], esi  {0x0}

LLIL:

36 @ 163e0af9  [rdi + 0x768 {_struct_a::field_768}].q = rsi
37 @ 163e0b00  rbx = rdi + 0x1d0
38 @ 163e0b07  [rbx {_struct_a::field_1d0}].d = esi

HLIL:

163e0af9  struct_a->field_768 = 0
163e0b00  int32_t* rbx_1 = &struct_a->field_1d0
163e0c00  (rbx_1 - 0x1d0)->field_1d0 = 0

It would be nice if BN just uses struct_a->field_1d0 = 0. If necessary, I can share the BNDB via PM in slack.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.