Type libraries for non-x86 are weirdly wrong and incomplete

Aperta
#4,347 0 commenti 7 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, python

Direzione di ricerca

Start by comparing the generated libraries at typelib/armv7/libc.so.6.bntl, typelib/aarch64/libc.so.6.bntl, and typelib/x86/libc.so.6.bntl, using the TypeLibrary Python calls shown in the report. Trace the undocumented builtin type-library generation process and verify that non-x86 libraries include strcpy with the same correct two-argument signature as x86.

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

Descrizione

Component: Type Libraries Effort: Medium Impact: Medium

Version and Platform (required):

  • Binary Ninja Version: 3.5.4296-dev
  • OS: Arch Linux
  • CPU Architecture: x64

Bug Description:
strcpy gets an absolutely bonkers type on armv7, and doesn't exist on aarch64. The process by which the builtin type libraries are generated is undocumented, which makes it difficult to discern why this is the case, and what the actual extent of the problem is.

Steps To Reproduce:

In [1]: from binaryninja import *

In [2]: tylib = TypeLibrary.load_from_file('/home/maya/binaryninja/typelib/armv7/libcv
   ...: 7.so.6.bntl')

In [3]: tylib.get_named_object('strcpy')
Out[3]: <type: immutable:FunctionTypeClass 'char*(char* dest, char const* src, char const* src, char* dest)'>

In [4]: tylib = TypeLibrary.load_from_file('/home/maya/binaryninja/typelib/aarch64/lib
   ...: c.so.6.bntl')

In [5]: tylib.get_named_object('strcpy')

In [6]: tylib.get_named_object('strcpy') is None
Out[6]: True

Expected Behavior:
The type is correct, as on x86:

In [7]: tylib = TypeLibrary.load_from_file('/home/maya/binaryninja/typelib/x86/libc.so
   ...: .6.bntl')

In [8]: tylib.get_named_object('strcpy')
Out[8]: <type: immutable:FunctionTypeClass 'char*(char*, char const*)'>
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.