-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explorer: fix exception when loaded in IDA hosted under idat #1341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased)
section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
CHANGELOG updated or no update needed, thanks! 😄
|
||
pixmap = QtGui.QPixmap() | ||
pixmap.loadFromData(ICON) | ||
QICON = QtGui.QIcon(pixmap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source of the exception.
My initial thoughts: at some point capa_explorer.py
is executed which imports capa/ida/plugin/__init__.py
which imports capa/ida/plugin/icon.py
resulting in execution of the referenced code. This code is invalid under idat
because the Qt
libraries are not loaded/init'd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lesson learned: code stored at global scope of plugin and imports is executed even if the plugin returns PLUGIN_SKIP
when its init
method is called.
|
||
pixmap = QtGui.QPixmap() | ||
pixmap.loadFromData(ICON) | ||
|
||
self.parent.setWindowIcon(QtGui.QIcon(pixmap)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from capa/ida/plugin/icon.py
; see other comments for more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for investigating and fixing this.
closes #1331
No issues identified when running the following command-line:
(source)