Automatically type all block arguments in function definitions with Block_literal *

Offen
#7,342 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet

Rechercherichtung

The issue names no source file, test, or entry point. Start by locating the parsing of Objective-C and Swift function metadata and block literals; done means block arguments receive copied Block_literal * types and that type propagation reaches their call sites.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Component: Objective-C Workflow Effort: Medium Impact: Medium

When parsing Objective-C and Swift function metadata, you often encounter blocks which are stack or global closures.

When you encounter these, apply a copy of the type Block_literal * to them.

struct Block_literal {
    void *isa;                    // Pointer to block's class ("isa" pointer)
    int flags;                    // Block flags
    int reserved;                 // Reserved for future use
    void (*invoke)(void *, ...);  // Function pointer to the block's code
    struct Block_descriptor *descriptor;  // Pointer to block's descriptor
    // ... captured variables (optional, not part of base header)
};

This type is the base type of all blocks in Objective-C and Swift. It will enable proper type propagation at all the call sites. The type is just the base type -- it can be further refined by parsing the Block_descriptor. I would prefer you make a copy of the block literal, because each call site will be different and we can fine the type in a second pass.

It goes a long way towards making ObjC and Swift easier to reverse

Image

vs

Image
Vorherrschende Sprache
C++
Sterne
1.3k
Forks
298
Ø Merge
5 T. 5 Std.
Gemergte PRs (30 T.)
19

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Vector35/binaryninja-api

Alle Issues in Vector35/binaryninja-api

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.