Exemplo n.º 1
0
    def highlightMatchedProcs(self):
        matchedProcs = self.matchedProcsCache.readAll()
        prefix = '[%s]\n[!] Matched Procedures: \n' % self.ui.editHighlightCaption.toPlainText()        
        if len(matchedProcs) > 0:
            for proc in matchedProcs:
                procStr = ''
                rva = proc.split('/')[1]
                ea = VBIDAHelper.addressFromRVA(int(rva, 16))
                matched = self.matchedProcsCache.read(proc)
                for m in matched:
                    mbinary, mrva = m['proc_id'].split('/')
                    procStr += 'Procedure: %s, Binary: %s, RVA: %s\n'%(
                        m['procName'], mbinary, mrva)

                cmt =  prefix + procStr
                cmt = cmt.encode('ascii','ignore')
                
                VBIDAHelper.setFunctionComment(ea, cmt)

                css = self.ui.btnHighlightColorChooser.styleSheet()
                start = css.find('rgb')
                if start != -1:
                    start += 4
                    end = css.find(')')
                    t = css[start : end]
                    rgb = map(str, t.split(','))
                    rgb = map(str.strip, rgb)
                    rgb = map(int, rgb)
                    VBIDAHelper.setFunctionColor(ea, rgb[2], rgb[1], rgb[0])

            self.notifyStatus({
                'statuscode': 0,
                'message': '%s procedures has been highlighted'%len(matchedProcs)
            })
Exemplo n.º 2
0
    def highlightMatchedProcs(self):
        matchedProcs = self.matchedProcsCache.readAll()
        prefix = '[%s]\n[!] Matched Procedures: \n' % self.ui.editHighlightCaption.toPlainText(
        )
        if len(matchedProcs) > 0:
            for proc in matchedProcs:
                procStr = ''
                rva = proc.split('/')[1]
                ea = VBIDAHelper.addressFromRVA(int(rva, 16))
                matched = self.matchedProcsCache.read(proc)
                for m in matched:
                    mbinary, mrva = m['proc_id'].split('/')
                    procStr += 'Procedure: %s, Binary: %s, RVA: %s\n' % (
                        m['procName'], mbinary, mrva)

                cmt = prefix + procStr
                cmt = cmt.encode('ascii', 'ignore')

                VBIDAHelper.setFunctionComment(ea, cmt)

                css = self.ui.btnHighlightColorChooser.styleSheet()
                start = css.find('rgb')
                if start != -1:
                    start += 4
                    end = css.find(')')
                    t = css[start:end]
                    rgb = map(str, t.split(','))
                    rgb = map(str.strip, rgb)
                    rgb = map(int, rgb)
                    VBIDAHelper.setFunctionColor(ea, rgb[2], rgb[1], rgb[0])

            self.notifyStatus({
                'statuscode':
                0,
                'message':
                '%s procedures has been highlighted' % len(matchedProcs)
            })