Last active
March 10, 2017 09:40
-
-
Save levisre/a0563dc3c5f6e8f67e6a to your computer and use it in GitHub Desktop.
Quick IDA choooser to help choose between IDA32 or IDA64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# -*- coding: utf-8 -*- | |
# IDA Chooser in PySide | |
# By Levis Nickaster([email protected]) | |
# Created: Tue Feb 2 16:35:11 2016 | |
# Usage: Copy the IDA_Chooser.py into the $IDADIR and execute | |
# A small windows might appears and ask you to choose which IDA (32 bit or 64 bit) will be used | |
# Now the only thing remain is to create a global hotkey and invoke it anywhere you want | |
# Requires PySide to be installed | |
from PySide import QtCore, QtGui | |
import sys,subprocess,os | |
class Ui_Form(object): | |
def setupUi(self, Form): | |
Form.setObjectName("Form") | |
Form.setWindowModality(QtCore.Qt.WindowModal) | |
Form.resize(366, 94) | |
Form.setFocusPolicy(QtCore.Qt.TabFocus) | |
self.ida32btn = QtGui.QPushButton(Form) | |
self.ida32btn.setGeometry(QtCore.QRect(10, 20, 161, 71)) | |
self.ida32btn.setFocusPolicy(QtCore.Qt.TabFocus) | |
self.ida32btn.setObjectName("ida32btn") | |
self.ida64btn = QtGui.QPushButton(Form) | |
self.ida64btn.setGeometry(QtCore.QRect(190, 20, 171, 71)) | |
self.ida64btn.setFocusPolicy(QtCore.Qt.TabFocus) | |
self.ida64btn.setObjectName("ida64btn") | |
self.retranslateUi(Form) | |
QtCore.QMetaObject.connectSlotsByName(Form) | |
Form.setTabOrder(self.ida32btn, self.ida64btn) | |
def retranslateUi(self, Form): | |
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Choose IDA Version", None, QtGui.QApplication.UnicodeUTF8)) | |
self.ida32btn.setText(QtGui.QApplication.translate("Form", "&1. IDA 32bit", None, QtGui.QApplication.UnicodeUTF8)) | |
self.ida64btn.setText(QtGui.QApplication.translate("Form", "&2. IDA &64bit", None, QtGui.QApplication.UnicodeUTF8)) | |
class MainWindow(QtGui.QMainWindow, Ui_Form): | |
def __init__(self): | |
super(MainWindow,self).__init__() | |
self.setupUi(self) | |
self.assignWidgets() | |
self.show() | |
self.ida32btn.setFocus() | |
def assignWidgets(self): | |
self.connect(self.ida32btn, QtCore.SIGNAL("clicked()"), self._32bitClick) | |
self.connect(self.ida64btn, QtCore.SIGNAL("clicked()"), self._64bitClick) | |
def _32bitClick(self): | |
self._execute("idaq") | |
def _64bitClick(self): | |
self._execute("idaq64") | |
def _execute(self,fname): | |
dir = os.path.dirname(os.path.abspath(sys.argv[0])) | |
_execname = dir + "/" + fname | |
if(os.path.isfile(_execname)): | |
subprocess.Popen([_execname]) | |
sys.exit(0) | |
else: | |
sys.exit(-1) | |
if __name__=="__main__": | |
app=QtGui.QApplication(sys.argv) | |
mainWin = MainWindow() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment