Type libraries for non-x86 are weirdly wrong and incomplete
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- reverse-engineering
Research direction
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.
Written by the indexing model from the issue text.
Description
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*)'>
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Vector35/binaryninja-api
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8540 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8516 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Vector35/binaryninja-api#8503 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8446 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8444 ·
All issues in Vector35/binaryninja-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·