def __init__(self, title, isMatchedProcs, matchedProcsCache, procId=None, deflt=1): if isMatchedProcs: Choose2.__init__(self, title, [['RVA', 10 | Choose2.CHCOL_HEX], ['Name', 30 | Choose2.CHCOL_PLAIN], ['Binary hash', 30 | Choose2.CHCOL_PLAIN]], Choose2.CH_MULTI) else: Choose2.__init__(self, title, [ ['Address', 10 | Choose2.CHCOL_HEX], ['Name', 30 | Choose2.CHCOL_PLAIN], ], Choose2.CH_MULTI) self.openedFileHash = VBIDAHelper.SHA1File(VBIDAHelper.getFilePath()) self.n = 0 self.icon = 41 self.deflt = deflt self.isMatchedProcs = isMatchedProcs self.procId = procId self.matchedProcsCache = matchedProcsCache self.populateItems() self.addCommand()
def __init__(self, parent=None): super(VBMainWidget, self).__init__(parent) self.ui = Ui_frmVirusBattle() self.ui.setupUi(self) self.APIKey = None self.initCaches() self.initSignals() VBIDAHelper.addMenuItem('View/', '[VB] Matched Procs', 'Alt-Shift-V', self.menuItemMatchedProcsTriggered, self.matchedProcsCache) self.currentDir = os.path.abspath( os.path.join(os.path.realpath(__file__), os.pardir, os.pardir)) self.downloadFolder = self.currentDir + os.sep + 'download' self.openedFilePath = VBIDAHelper.getFilePath() self.openedFileHash = '' try: self.openedFileHash = VBIDAHelper.SHA1File(self.openedFilePath) except: pass if self.openedFileHash != '': self.ui.lblOpenFileHash.setText('Current file hash: %s' % self.openedFileHash) self.ui.editOtherSHA.setText(self.openedFileHash) else: self.openedFilePath = '' self.ui.lblOpenFileHash.setText('Current file could be not found.') self.loadListProfiles() self.otherInfosAvailability = { 'avscans': False, 'behaviors': False, 'pedata': False }