Vector35 / Vector35/binaryninja-api

Can't register TriCore Architecture Hook at startup time

Open
#6,618 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Arch: TriCore Component: Architecture Effort: Low Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):
5.0.7204-dev ultimate

Bug Description:
Can't register TriCore Architecture Hook at startup time. (raises KeyError)

[ScriptingProvider] Traceback (most recent call last):
[ScriptingProvider]   File "/Users/d0now/Library/Application Support/Binary Ninja/plugins/tricore_ext/__init__.py", line 51, in <module>
[ScriptingProvider]     TriCoreExtHook.register(Architecture['tricore'])
[ScriptingProvider]   File "/Applications/Binary Ninja.app/Contents/MacOS/plugins/../../Resources/python/binaryninja/architecture.py", line 167, in __getitem__
[ScriptingProvider]     raise KeyError(f"'{name}' is not a valid architecture")
[ScriptingProvider] KeyError: "'tricore' is not a valid architecture"
[PythonPlugin] Python plugin 'tricore_ext' could not be loaded

Steps To Reproduce:

  1. write architecture plugin: ($BINARYNINJA_HOME/plugins/tricorehook/__init__.py)
class TriCoreHook(ArchitectureHook):
    ...

TriCoreHook.register(Architecture['tricore'])
  1. start binary ninja

Expected Behavior:
TriCoreHook should be registered at startup time.

Additional Information:
Workaround: d0now/binaryninja-tricore-ext

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the plugin entry point at $BINARYNINJA_HOME/plugins/tricorehook/init.py and the Architecture['tricore'] lookup shown in the traceback. Compare the workaround in d0now/binaryninja-tricore-ext, especially the linked registration section, and investigate startup ordering. Done means TriCoreHook registers during startup without the KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.