Vector35 / Vector35/binaryninja-api

hellopane.py crashes when right-clicked

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

Nobody has claimed this yet.

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

Description

Version and Platform (required):

  • Binary Ninja Version: 4.3.7046-dev
  • OS: all
  • OS Version: all
  • CPU Architecture: all

Bug Description:
python/examples/hellopane.py does not actually initialize self.m_contextMenuManager or self.m_menu and so if you right-click on the pane itself, you get:

[ScriptingProvider] Traceback (most recent call last):
[ScriptingProvider]   File "C:\Users\joshwatson\AppData\Roaming\Binary Ninja\plugins\pane.py", line 112, in contextMenuEvent
[ScriptingProvider]     self.m_contextMenuManager.show(self.m_menu, self.actionHandler)
[ScriptingProvider]     ^^^^^^^^^^^^^^^^^^^^^^^^^
[ScriptingProvider] AttributeError: 'HelloPaneWidget' object has no attribute 'm_contextMenuManager'

Steps To Reproduce:
Please provide all steps required to reproduce the behavior:

  1. Install python\examples\hellopane.py in the Binary Ninja plugins directory
  2. Open the Hello Pane from the Plugins menu
  3. Right-click the Hello Pane

Expected Behavior:
A context menu or something should probably show, but at least it shouldn't throw an exception

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 python/examples/hellopane.py, especially HelloPaneWidget and its contextMenuEvent method, and compare how the context-menu members are set up before the right-click path runs. Reproduce the issue by opening the Hello Pane and right-clicking it; done means the action no longer raises the reported AttributeError and the intended context-menu behavior is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.