Automatically type all block arguments in function definitions with Block_literal *

Abierto
#7,342 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp, objective-c, swift

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
C++
Estrellas
1.3k
Forks
298
Merge medio
5 d 5 h
PR fusionados (30 d)
19

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Vector35/binaryninja-api

Todos los issues de Vector35/binaryninja-api

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.