binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

The type for various variadic functions (_printf) are inaccurate in macOS type libraries

Open xusheng6 opened this issue 1 year ago • 3 comments

bv.type_libraries [<typelib '/usr/lib/libSystem.B.dylib.mac-aarch64.1292.100.5':aarch64>] lib = bv.type_libraries[0] bv.import_library_object('_printf', lib) <type: immutable:FunctionTypeClass 'int32_t(char const*)'>

It should be int32_t _printf(char const*, ...). This also affects functions like _scanf, vsprintf, snprintf, and potentially other variadic functions as well.

This does not affect Linux type libraries -- they are correct

xusheng6 avatar Aug 13 '24 07:08 xusheng6

Confirmed, not only for MacOS type libraries, but also in all ARM type libraries

HarDToBelieve avatar Aug 24 '24 14:08 HarDToBelieve

Seems Rel: #5828?

0xricksanchez avatar Aug 26 '24 08:08 0xricksanchez

Don't think it's related. Lack of type libraries is totally independent from heuristic analysis being off.

psifertex avatar Aug 28 '24 02:08 psifertex

Fixed in 4.2.6443

plafosse avatar Nov 15 '24 14:11 plafosse