Structure fields not recognized in an array of structures

Aperta
#5,376 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma

Direzione di ricerca

The report names no source file, test, or entry point. Start by reproducing the output with Binary Ninja 4.0.4958 on macOS 14.4/arm64 using the shown PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST array and inspect the structure-field accesses. Done means the listed fields are represented separately rather than combined into 64-bit values.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Component: Core Core: MLIL Effort: Low Impact: Medium

Version and Platform (required):

  • Binary Ninja Version: 4.0.4958, ddff9339
  • OS: macos
  • OS Version: 14.4
  • CPU Architecture: arm64

Internal binary major dine favor.

I'm getting pretty bad output from BN and it's not letting me tweak it. For example, that 0x145e4c is the second field in the structure. And I don't understand why it's trying to grab series1 and x1_5 as 64-bit ints instead of splitting them into separate structure field accesses.

00099c68          if (PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST[sx.q(ix)].series == series && *(sx.q(ix) * 0x14 + 0x145e4c) == mount_pos_type)
00099cac              int64_t ix_1 = sx.q(ix)
00099ccc              int64_t series_1 = PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST[ix_1].series.q
00099ccc              int64_t x1_5 = PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST[ix_1].no_negotiate_flag.q
00099cd0              config->series = series_1.d
00099cd0              config->mount_pos_type = series_1:4.d
00099cd0              config->no_negotiate_flag = x1_5.d
00099cd0              config->sender = x1_5:4.b
00099cd0              config->receiver = x1_5:5.b
00099cd0              config->field5 = x1_5:6.w
00099cd8              config->field6.d = PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST[ix_1].field_6
00099cdc              x0_1 = 0
00099ce0              break

Both of series1 and x1_5 are picking up data from the same structure and should be automatically split into several field accesses instead. PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST is an array of structures that looks like this

00145e48  struct PayloadNegotiateParamConfig PAYLOAD_NEGOTIATE_PARAM_CONFIG_LIST[0x9] = 
00145e48  {
00145e48      [0x0] = 
00145e48      {
00145e48          enum E_DjiAircraftSeries series = DJI_AIRCRAFT_SERIES_M300
00145e4c          enum E_DjiMountPositionType mount_pos_type = DJI_MOUNT_POSITION_TYPE_PAYLOAD_PORT
00145e50          uint32_t no_negotiate_flag = 0x0
00145e54          uint8_t sender = 0x13
00145e55          uint8_t receiver = 0x34
00145e56          uint16_t field_5 = 0x9
00145e58          uint32_t field_6 = 0x2710
00145e5c      },
...

Let me know if I should upload my database somewhere.

Lingua principale
C++
Stelle
1.3k
Fork
298
Merge medio
5g 5h
PR unite (30g)
19

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Vector35/binaryninja-api

Tutte le issue di Vector35/binaryninja-api

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.