Variables created from array indexing have incorrect types
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- cpp
- Ambito
- reverse-engineering
Direzione di ricerca
Start with the provided struct_array3.zip reproduction in _main, applying Foo* to x0 and comparing x8_16 with Show All Expression Types enabled. Trace how MLIL assigns the variable type and how HLIL resolves the array index expression. Done means the variable receives the higher-confidence struct Bar* type from the resolved expression.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version and Platform (required):
- Binary Ninja Version: 3.1.3553-dev
- OS: macOS
- OS Version: 12.0.1
- CPU Architecture: M1
Bug Description:
When HLIL resolves an array index offset, the resulting HLIL Expression has a deduced type, but this does not apply the type to a variable assigned to that expression. This is probably due to array resolution being done in HLIL and not applying expression types to variables which are created in MLIL.
Steps To Reproduce:
Please provide all steps required to reproduce the behavior:
- Open this binary: struct_array3.zip
- Create these types:
struct Bar __packed
{
int32_t a;
int32_t field_4;
struct Baz* bazs[0x10];
int32_t b;
};
struct Baz __packed
{
int32_t a;
int32_t b;
uint8_t* c;
};
struct Foo __packed
{
int64_t unknown;
struct Bar* pBars[0xa];
struct Bar** ppBars[0xa];
struct Bar*** pppBars[0xa];
int64_t unknown1;
};
- In
_main, apply the typeFoo*to the variablex0(address100003df8) - Observe the type of variable
x8_16(address100003e88) isint32_t* - Enable the option Show All Expression Types
- Observe the type of the expression assigned to
x8_16isstruct Bar*
Expected Behavior:
I expected the assignment to change the variable's type automatically (at least, assuming the new type has confidence > the variable's existing confidence)
Screenshots:


Additional Information:
This is probably due to MLIL assigning the variable's type based on the analysis without the array resolution, as HLIL applies later and doesn't update the type.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Vector35/binaryninja-api
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
Vector35/binaryninja-api#8540 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Vector35/binaryninja-api#8516 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
Vector35/binaryninja-api#8503 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Vector35/binaryninja-api#8446 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Vector35/binaryninja-api#8444 ·
Tutte le issue di Vector35/binaryninja-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gazebosim/gz-sensors#662 · 1 commento ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
comp-datalake
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
LadybirdBrowser/ladybird#12123 ·