Support `.callers` and other `Function` methods for extern functions

Aperta
#6,722 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
cpp

Direzione di ricerca

Start by reviewing issue #2663 and the existing Function APIs around bv.get_functions_by_name, then trace how extern calls are represented by MediumLevelILExternPtr in MediumLevelILCall. Done means extern functions expose the requested Function-style queries, or a documented query for their call sites without manually walking every function's IL.

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

Descrizione

Component: API Effort: Low Impact: Low

What is the feature you'd like to have?
I'd like extern (imported) functions to be fully represented as Function objects (or at least to have a wrapper/interface that behaves similarly), so that I can use standard API methods and properties like .callers, .caller_sites, etc. For example, I'd expect bv.get_functions_by_name("strcpy") to return the extern function if it's present in the binary.

Is your feature request related to a problem?
Yes. Currently, extern functions (such as those from standard libraries) are represented differently in the MLIL (e.g., as MediumLevelILExternPtr in the dest field of MediumLevelILCall). Because of this, I cannot interact with them using the same APIs available for regular functions. As a result, methods like .callers and .caller_sites do not work for them. There also seems to be no straightforward way to get call sites to extern functions without iterating through all IL instructions in all functions manually.

Are any alternative solutions acceptable?
If exposing extern functions as regular Function objects is not feasible, I would appreciate an alternative API that allows querying for call sites to extern functions by name or address, without needing to manually walk through every function's IL.

Additional Information:
This feature would improve the developer experience when writing plugins or analyses that rely on detecting uses of unsafe or critical extern functions like strcpy, malloc, or system.

This might be related to or similar to issue #2663.

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.