Vector35 / Vector35/binaryninja-api
`TypeMapping.get()` method fails to retrieve system types when the type name contains `::`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
Version and Platform (required):
- Binary Ninja Version: 5.1.7512-test
- Edition: Ultimate
- OS: MacOS
- OS Version:15.4.1
- CPU Architecture: M4 Max
Bug Description:
TypeMapping.get() method fails to retrieve system types when the type name contains :: (double colons), while direct dictionary access works correctly. User-defined types with :: in their names can be retrieved normally with get().
Steps To Reproduce:
- Open any binary with C++ symbols that creates types with namespace qualifiers
- Access the Python console
- Verify type exists: type
bv.typesto search for examplestd::stringexists - Try to get the type:
bv.types.get('std::string')returns None - With non-namespaced type works correctly
Expected Behavior:
bv.types.get('std::string') should return the same result as bv.types['std::string'] for system types containing ::.
Screenshots/Video Recording:
>>> bv.types
<TypeMapping 132 symbols: {... , 'std::string': <type: immutable:StructureTypeClass 'class std::string'>, ...>
>>> bv.types.get("std::string")
>>> bv.types['std::string']
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Applications/Binary Ninja.app/Contents/MacOS/plugins/../../Resources/python/binaryninja/binaryview.py", line 2062, in __getitem__
raise KeyError(key)
KeyError: 'std::string'
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.
Research direction
Start with binaryninja/binaryview.py around line 2062 and the TypeMapping.get entry point. Reproduce the Python console example using bv.types.get('std::string') and bv.types['std::string']; done when namespaced system types return the same result through both access paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100