Vector35 / Vector35/binaryninja-api

__gconv_step is wrong in x86_64 libc type library

Aperta
#2,764 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Component: Type Libraries Effort: Trivial Impact: Low
Lingua principale
C++
Stelle
1.3k
Fork
298
Merge medio
5g 5h
PR unite (30g)
19

Descrizione

Binary Ninja Version
2.4

Describe the bug
the structure __gconv_step is misdefined in the libc typelibrary for x86_64.

This is likely due to a DWARF parsing bug.

To Reproduce

>>> Platform['linux-x86_64'].get_type_libraries_by_name('libc_x86_64.so.6')[0].get_named_type('__gconv_step').members
[<void* __shlib_handle, offset 0x0>, <char const* __modname, offset 0x8>, <int32_t __counter, offset 0x10>, <char* __from_name, offset 0x18>, <char* __to_name, offset 0x20>, <__gconv_fct __fct, offset 0x28>, <void __fct, offset 0x28>, <void __fct, offset 0x28>, <__gconv_btowc_fct __btowc_fct, offset 0x30>, <__gconv_init_fct __init_fct, offset 0x38>, <__gconv_end_fct __end_fct, offset 0x40>, <int32_t __min_needed_from, offset 0x48>, <int32_t __max_needed_from, offset 0x4c>, <int32_t __min_needed_to, offset 0x50>, <int32_t __max_needed_to, offset 0x54>, <int32_t __stateful, offset 0x58>, <void* __data, offset 0x60>]

Expected behavior
The two void types at offset 0x28 shouldn't exist.

Screenshots

image

Workaround

with Type.builder(bv, '__gconv_step') as s:
  s.remove(6)
  s.remove(7)

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.

Direzione di ricerca

Reproduce the issue with Platform['linux-x86_64'].get_type_libraries_by_name('libc_x86_64.so.6') and inspect get_named_type('__gconv_step'). Trace the DWARF parsing path that creates the duplicate void members at offset 0x28. Done means the type library no longer contains those two members and the Type.builder workaround is unnecessary.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.