Vector35 / Vector35/binaryninja-api

Option for showing variable types only at top of function

Offen
#3,313 0 Kommentare 9 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Component: UI Effort: Low Impact: Medium UI: Linear
Vorherrschende Sprache
C++
Sterne
1.3k
Forks
298
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
19

Beschreibung

I know that there is an option which is under Show Variable Types as At Top of Function. But this is not what I'm thinking of. Because when I enable that option, it shows variables at top of function, but they also visible in de-compiler output as inline too.

How about adding one more option, in this way there will be two option like:

  • At top of function and inline
  • At top of function only

Let me show an example:

At top of function and inline: Binary ninja already have this.

00401170  void print_list(struct list_T* list)

uint32_t dwCount  {Frame offset -50}
char buf[0x4]  {Frame offset -44}
int32_t i  {Frame offset -40}
char line[0x32]  {Frame offset -3c}
int32_t __saved_ebp  {Frame offset -4}
struct list_T* list  {Frame offset 4}
int32_t eax_1  {Register eax}
HANDLE hOut  {Register eax}
struct person_T* person  {Register edx}

0040117b  int32_t __saved_ebp
0040117b  int32_t eax_1 = stack_cookie ^ &__saved_ebp
00401182  HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE)
004011a6  for (int32_t i = 0; i u< list->size; i = i + 1) {
004011b2      char buf[0x4]
004011b2      my_memset(&buf, 4)
004011c0      char line[0x32]
004011c0      my_memset(&line, 50)
004011d0      struct person_T* person = list->items[i]
004011df      my_strcat(&line, &data_40303c)
004011f1      my_ultostr(person->age, &buf)
00401201      my_strcat(&line, &buf)
00401212      my_strcat(&line, &data_403044)
00401225      my_strcat(&line, person->name)
00401236      my_strcat(&line, &data_40304c)
00401259      uint32_t dwCount
00401259      WriteConsoleA(hOut, &line, my_strlen(&line), &dwCount, nullptr)
0040123e  }
...

At top of function only: This is what I think would be useful.

00401170  void print_list(struct list_T* list)

uint32_t dwCount  {Frame offset -50}
char buf[0x4]  {Frame offset -44}
int32_t i  {Frame offset -40}
char line[0x32]  {Frame offset -3c}
int32_t __saved_ebp  {Frame offset -4}
struct list_T* list  {Frame offset 4}
int32_t eax_1  {Register eax}
HANDLE hOut  {Register eax}
struct person_T* person  {Register edx}

0040117b  eax_1 = stack_cookie ^ &__saved_ebp
00401182  hOut = GetStdHandle(STD_OUTPUT_HANDLE)
004011a6  for (i = 0; i u< list->size; i = i + 1) {
004011b2      my_memset(&buf, 4)
004011c0      my_memset(&line, 50)
004011d0      person = list->items[i]
004011df      my_strcat(&line, &data_40303c)
004011f1      my_ultostr(person->age, &buf)
00401201      my_strcat(&line, &buf)
00401212      my_strcat(&line, &data_403044)
00401225      my_strcat(&line, person->name)
00401236      my_strcat(&line, &data_40304c)
00401259      WriteConsoleA(hOut, &line, my_strlen(&line), &dwCount, nullptr)
0040123e  }
...

This way de-compiler's output could be more clean and suitable for some users needs.

One more step from there would be an option that hides all of variable types from de-compiler output. But if done so, there will be need for feature to show variable types on hover like in IDA. Currently binary ninja shows some explanation about what opcode does, which is, in my humble opinion, a little bit meaningless for HLIL or Pseudo C.

Actually, I think binary ninja should show variable types on hover in HLIL or Pseudo C view regardless of this feature implemented.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

No files or tests are named. Start by locating the existing “Show Variable Types as At Top of Function” option in the Binary Ninja decompiler and trace how it controls HLIL or pseudo-C output. Define the separate “at top of function only” behavior using the two examples, then add coverage for both output modes.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
reverse-engineering
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.