first.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:FIRST-plugin-ida 作者: vrtadmin 项目源码 文件源码
def init_top_layout(self):
            title = QtWidgets.QLabel('Check All Functions')
            title.setStyleSheet('font: 16pt;')

            description = QtWidgets.QLabel((
                'Query FIRST\'s server for function metadata.\n'
                'If a function within this IDB matches a signature found in '
                'FIRST then it and its metadata will be available for you to '
                'select below to apply to your IDB. Select the function you '
                'wish to apply existing metadata to in order to view the '
                'possible matches.'))
            description.setWordWrap(True)
            description.setStyleSheet('text-size: 90%')

            vbox_text = QtWidgets.QVBoxLayout()
            vbox_text.addWidget(title)
            vbox_text.addWidget(description)

            widget = QtWidgets.QWidget()
            widget.setFixedWidth(100)
            vbox_legend = QtWidgets.QVBoxLayout(widget)
            grid_legend = QtWidgets.QGridLayout()
            style = 'background-color: #{0:06x}; border: 1px solid #c0c0c0;'
            colors = [FIRST.color_applied, FIRST.color_selected]
            text = ['Applied', 'Selected']
            for i in xrange(len(colors)):
                box = QtWidgets.QLabel()
                box.setFixedHeight(10)
                box.setFixedWidth(10)
                box.setStyleSheet(style.format(colors[i].color().rgb() & 0xFFFFFF))
                grid_legend.addWidget(box, i, 0)
                grid_legend.addWidget(QtWidgets.QLabel(text[i]), i, 1)

            vbox_legend.addLayout(grid_legend)
            vbox_legend.setAlignment(Qt.AlignRight | Qt.AlignBottom)
            vbox_legend.setContentsMargins(20, 0, 0, 0)


            self.top_layout.addLayout(vbox_text)
            self.top_layout.addWidget(widget)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号