Add information from aai to Dashboard, fixes #1571 (#1792)

* Add information from aai to Dashboard
This commit is contained in:
Alex Vorobyev 2019-09-28 23:46:41 +03:00 committed by Itay Cohen
parent 88553ae7d9
commit d69dee7225
2 changed files with 329 additions and 83 deletions

View File

@ -74,11 +74,22 @@ void Dashboard::updateContents()
setBool(this->ui->strippedEdit, item2, "stripped");
setBool(this->ui->relocsEdit, item2, "relocs");
// Add file hashes and libraries
// Add file hashes, analysis info and libraries
QJsonObject hashes = Core()->cmdj("itj").object();
setPlainText(ui->md5Edit, hashes["md5"].toString());
setPlainText(ui->sha1Edit, hashes["sha1"].toString());
QJsonObject analinfo = Core()->cmdj("aaij").object();
setPlainText(ui->functionsLineEdit, QString::number(analinfo["fcns"].toInt()));
setPlainText(ui->xRefsLineEdit, QString::number(analinfo["xrefs"].toInt()));
setPlainText(ui->callsLineEdit, QString::number(analinfo["calls"].toInt()));
setPlainText(ui->stringsLineEdit, QString::number(analinfo["strings"].toInt()));
setPlainText(ui->symbolsLineEdit, QString::number(analinfo["symbols"].toInt()));
setPlainText(ui->importsLineEdit, QString::number(analinfo["imports"].toInt()));
setPlainText(ui->coverageLineEdit, QString::number(analinfo["covrage"].toInt()) + " bytes");
setPlainText(ui->codeSizeLineEdit, QString::number(analinfo["codesz"].toInt()) + " bytes");
setPlainText(ui->percentageLineEdit, QString::number(analinfo["percent"].toInt()) + "%");
QStringList libs = Core()->cmdList("il");
if (!libs.isEmpty()) {
libs.removeFirst();

View File

@ -56,7 +56,7 @@
<x>0</x>
<y>0</y>
<width>1055</width>
<height>982</height>
<height>980</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
@ -972,6 +972,8 @@
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
@ -1069,6 +1071,239 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<pointsize>17</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Analysis info</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="functionsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Functions:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="functionsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="xRefsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>X-Refs:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="xRefsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="callsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Calls:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="callsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="stringsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Strings:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="stringsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="symbolsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Symbols:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="symbolsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="importsLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Imports:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="importsLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="coverageLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Analysis coverage:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="coverageLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="codeSizeLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Code size:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="codeSizeLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="percentageLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Coverage percent:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="percentageLineEdit">
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</item>