Python memory map API is kinda awkward
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- api, reverse-engineering
Direzione di ricerca
Start with the Python MemoryMap API entry point and review how regions, iteration, and flags are currently exposed. Done means the API provides an object or equivalent access for regions, supports iterating all regions, and accepts the flag representation needed to copy flags between regions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version and Platform (required):
- Binary Ninja Version: 5.2.8236-dev Ultimate, d8af0ff0
- OS: macos
- OS Version: 26.0
- CPU Architecture: arm64
Bug Description:
I used the MemoryMap API for the first time today and found it a bit awkward to use. I was writing a small script to extract the flags for each memory region into a dictionary so they could be used to copy the same flags to an existing database (to help recover from #7354).
I ended up with:
import functools
{ bv.memory_map.get_active_memory_region_at(s.start):
functools.reduce(lambda a, b: a | b, bv.memory_map.get_memory_region_flags(bv.memory_map.get_active_memory_region_at(s.start)), 0)
for s in bv.segments
}
I had expected it to look more like:
{ region.name: region.flags for region in bv.memory_map }
Specifically:
-
There's no object to represent a memory region.
Looking up a region by address gives you back a name. To query properties of that region you pass the name to functions on
MemoryMap. -
There's no way to iterate all memory regions.
MemoryMapimplements__len__, but not__getitem__or__iter__. -
get_memory_region_flagsreturns asetcontaining zero or moreSegmentFlag, butset_memory_region_flagsaccepts aSegmentFlag.In order to take the flags from one memory region and apply them to another, you have to do something like
reduce(lambda a, b: a | b, flags, 0)to convert from the set toSegmentFlag.set_memory_region_flagsshould probably accept both a set orSegmentFlag.
- 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 ·