From d2ea9d6762b7bbb50bc0781fa441a7b07ba3a6c7 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 12 May 2015 18:29:02 +0800 Subject: [PATCH 1/2] use PyQt5 instead of PySide --- ArchitectureDialog.py | 5 +++-- AssembleDialog.py | 4 ++-- DisassemblerView.py | 6 +++--- FindDialog.py | 5 +++-- Fonts.py | 4 ++-- HelpView.py | 10 ++++++---- HexEditor.py | 6 +++--- Preferences.py | 5 +++-- PythonConsole.py | 9 +++++---- RunWindow.py | 4 ++-- TerminalView.py | 5 +++-- TextEditor.py | 6 +++--- Threads.py | 4 ++-- Transform.py | 5 +++-- Util.py | 4 ++-- View.py | 10 +++++----- binja.py | 4 ++-- 17 files changed, 52 insertions(+), 44 deletions(-) diff --git a/ArchitectureDialog.py b/ArchitectureDialog.py index 875e0d7..68f80e8 100644 --- a/ArchitectureDialog.py +++ b/ArchitectureDialog.py @@ -13,8 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * class ArchitectureDialog(QDialog): diff --git a/AssembleDialog.py b/AssembleDialog.py index 2559c98..d673bcd 100644 --- a/AssembleDialog.py +++ b/AssembleDialog.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from Fonts import * from TextEditor import * import nasm diff --git a/DisassemblerView.py b/DisassemblerView.py index d4f014b..196cf5e 100644 --- a/DisassemblerView.py +++ b/DisassemblerView.py @@ -49,7 +49,7 @@ def __init__(self, view): self.highlight_token = view.highlight_token class DisassemblerView(QAbstractScrollArea): - statusUpdated = Signal(QWidget, name="statusUpdated") + statusUpdated = pyqtSignal(QWidget, name="statusUpdated") def __init__(self, data, filename, view, parent): super(DisassemblerView, self).__init__(parent) @@ -288,8 +288,8 @@ def paintEvent(self, event): for edge in block.edges: p.setPen(edge.color) p.setBrush(edge.color) - p.drawPolyline(edge.polyline) - p.drawConvexPolygon(edge.arrow) + p.drawPolyline(QPolygon(edge.polyline)) + p.drawConvexPolygon(QPolygon(edge.arrow)) def isMouseEventInBlock(self, event): # Convert coordinates to system used in blocks diff --git a/FindDialog.py b/FindDialog.py index 59c1452..ce5846e 100644 --- a/FindDialog.py +++ b/FindDialog.py @@ -13,8 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * import re import sys diff --git a/Fonts.py b/Fonts.py index 6ad3fc7..e085166 100644 --- a/Fonts.py +++ b/Fonts.py @@ -14,8 +14,8 @@ # along with this program. If not, see . import sys -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * monospaceFont = None lineSpacing = None diff --git a/HelpView.py b/HelpView.py index 77a29e2..dafac74 100644 --- a/HelpView.py +++ b/HelpView.py @@ -15,10 +15,12 @@ import sys import os -from PySide.QtCore import * -from PySide.QtGui import * -from PySide.QtWebKit import * -from PySide.QtNetwork import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWebKit import * +from PyQt5.QtNetwork import * +from PyQt5.QtWidgets import * +from PyQt5.QtWebKitWidgets import QWebView from View import * diff --git a/HexEditor.py b/HexEditor.py index 1ffc334..b553930 100644 --- a/HexEditor.py +++ b/HexEditor.py @@ -14,8 +14,8 @@ # along with this program. If not, see . import sys -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from Fonts import * from View import * from BinaryData import * @@ -31,7 +31,7 @@ def __init__(self, view): self.ascii = view.cursorAscii class HexEditor(QAbstractScrollArea): - statusUpdated = Signal(QWidget, name="statusUpdated") + statusUpdated = pyqtSignal(QWidget, name="statusUpdated") def __init__(self, data, filename, view, parent): super(HexEditor, self).__init__(parent) diff --git a/Preferences.py b/Preferences.py index b21f577..f76fc02 100644 --- a/Preferences.py +++ b/Preferences.py @@ -13,8 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * from Fonts import * diff --git a/PythonConsole.py b/PythonConsole.py index d899fb9..23f4218 100644 --- a/PythonConsole.py +++ b/PythonConsole.py @@ -13,8 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * from Fonts import * import code import sys @@ -163,8 +164,8 @@ def run(self): self.done.set() class PythonConsoleLineEdit(QLineEdit): - prevHistory = Signal(()) - nextHistory = Signal(()) + prevHistory = pyqtSignal(()) + nextHistory = pyqtSignal(()) def __init__(self, *args): super(PythonConsoleLineEdit, self).__init__(*args) diff --git a/RunWindow.py b/RunWindow.py index 290d71b..e004576 100644 --- a/RunWindow.py +++ b/RunWindow.py @@ -14,8 +14,8 @@ # along with this program. If not, see . import shlex -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from TerminalView import * diff --git a/TerminalView.py b/TerminalView.py index 3e298f5..ccc0704 100644 --- a/TerminalView.py +++ b/TerminalView.py @@ -14,8 +14,9 @@ # along with this program. If not, see . import sys -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * from TerminalProcess import * from Fonts import * diff --git a/TextEditor.py b/TextEditor.py index 20af12e..b0a00fc 100644 --- a/TextEditor.py +++ b/TextEditor.py @@ -15,8 +15,8 @@ import sys import os -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from Fonts import * from View import * from BinaryData import * @@ -41,7 +41,7 @@ def __init__(self, view): class TextEditor(QAbstractScrollArea): - statusUpdated = Signal(QWidget, name="statusUpdated") + statusUpdated = pyqtSignal(QWidget, name="statusUpdated") def __init__(self, data, filename, view, parent): super(TextEditor, self).__init__(parent) diff --git a/Threads.py b/Threads.py index a75f3b8..5d65706 100644 --- a/Threads.py +++ b/Threads.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * import thread import threading diff --git a/Transform.py b/Transform.py index 05d48de..5039f28 100644 --- a/Transform.py +++ b/Transform.py @@ -13,8 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * from Crypto.Cipher import AES from Crypto.Cipher import Blowfish from Crypto.Cipher import CAST diff --git a/Util.py b/Util.py index df2df99..1ddcf34 100644 --- a/Util.py +++ b/Util.py @@ -14,8 +14,8 @@ # along with this program. If not, see . import struct -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from Crypto.Hash import MD2 from Crypto.Hash import MD4 from Crypto.Hash import MD5 diff --git a/View.py b/View.py index c942d34..5255397 100644 --- a/View.py +++ b/View.py @@ -14,8 +14,8 @@ # along with this program. If not, see . import os -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from PythonConsole import * ViewTypes = [] @@ -29,9 +29,9 @@ def __init__(self, type, data): self.data = data class ViewFrame(QWidget): - statusUpdated = Signal(QWidget) - viewChanged = Signal(QWidget) - closeRequest = Signal(QWidget) + statusUpdated = pyqtSignal(QWidget) + viewChanged = pyqtSignal(QWidget) + closeRequest = pyqtSignal(QWidget) def __init__(self, type, data, filename, viewList): super(ViewFrame, self).__init__(None) diff --git a/binja.py b/binja.py index b8faf81..e23bcd5 100755 --- a/binja.py +++ b/binja.py @@ -23,8 +23,8 @@ import stat import thread import Threads -from PySide.QtCore import * -from PySide.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * from View import * from BinaryData import * from HexEditor import * From ff3515f0812cdfa9824258dd39ca37923d134ca4 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Tue, 12 May 2015 18:34:23 +0800 Subject: [PATCH 2/2] update README --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e6703b8..2c568bf 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Binary Ninja and the Binary Ninja logo are trademarks of Vector 35 LLC. Binary Ninja is cross-platform and can run on Linux, Mac OS X, Windows, and FreeBSD. In order to run Binary Ninja, you will need to install a few prerequisites: * [Python 2.7](https://www.python.org/downloads/) -* [PySide](https://pypi.python.org/pypi/PySide#installing-prerequisites) for Qt Python bindings +* [PyQt5](http://www.riverbankcomputing.com/software/pyqt/download5) for Qt Python bindings * The [pycrypto](https://www.dlitz.net/software/pycrypto/) library You can start Binary Ninja by running `binja.py` in the Python interpreter.