Need `BNGetLiftedlILBasicBlockForInstruction` to ensure `il_basic_block` will return successfully on lifted_il APIs
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
- Ambito
- api, reverse-engineering
Direzione di ricerca
Reproduce the failure with the lifted_il loop from the issue, then inspect python/binaryninja/lowlevelil.py around il_basic_block and LowLevelILBasicBlock, along with the BNGetLiftedILBasicBlockForInstruction entry point. Compare its behavior with the working llil and mlil cases; done means the lifted_il loop returns a valid il_basic_block without the constructor or cleanup exceptions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On any sufficiently large binary, /bin/ls for example, the following code will not complete without generating an exception.
for func in bv.functions:
for bb in func.lifted_il:
for inst in bb:
inst.il_basic_block
When replacing func.lifted_il with either func.llil or func.mlil, it seems to work fine.
The exception generated is:
Exception AttributeError: "'LowLevelILBasicBlock' object has no attribute 'handle'" in <object repr() failed> ignored
Traceback (most recent call last):
File "<console>", line 4, in <module>
File "/home/kyle/binaryninja/plugins/../python/binaryninja/lowlevelil.py", line 537, in il_basic_block
return LowLevelILBasicBlock(view, core.BNGetLowLevelILBasicBlockForInstruction(self.function.handle, self.instr_index), self.function)
File "/home/kyle/binaryninja/plugins/../python/binaryninja/lowlevelil.py", line 2413, in __init__
super(LowLevelILBasicBlock, self).__init__(handle, view)
File "/home/kyle/binaryninja/plugins/../python/binaryninja/basicblock.py", line 62, in __init__
self.handle = core.handle_of_type(handle, core.BNBasicBlock)
File "/home/kyle/binaryninja/plugins/../python/binaryninja/_binaryninjacore.py", line 13434, in handle_of_type
raise ValueError('expected pointer to %s' % str(handle_type))
ValueError: expected pointer to <class 'binaryninja._binaryninjacore.BNBasicBlock'>
Later, when closing ipython or waiting an arbitrary amount of time, the following exception is generated:
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/home/kyle/binaryninja/python/binaryninja/basicblock.py", line 69, in __del__
AttributeError: 'LowLevelILBasicBlock' object has no attribute 'handle'
Nearly identical blocks/instructions are affected, does seem to break consistently on the same block in the same binary, but I I think that's more happenstance than anything.
Present in both Python2 and Python3, sorta seems like a dangling pointer issue to me.
- 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à 1/5 1-3 ore Idoneità per principianti 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
automated-analysis bug memory-safety
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
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 ·