Made "load bin" checkbox more understandble

It is also now doing as the -n option of radare
This commit is contained in:
xarkes 2018-02-10 23:31:15 +01:00
parent a869009909
commit 28ff13729f
6 changed files with 16 additions and 26 deletions

View File

@ -47,7 +47,7 @@ void AnalThread::run()
core->setCPU(optionsDialog->getSelectedArch(), optionsDialog->getSelectedCPU(), optionsDialog->getSelectedBits());
bool rw = false;
bool loadBinInfo = ui->binCheckBox->isChecked();
bool loadBinInfo = !ui->binCheckBox->isChecked();
if (loadBinInfo)
{
@ -61,6 +61,7 @@ void AnalThread::run()
}
else
{
Core()->setConfig("file.info", "false");
va = false;
loadaddr = mapaddr = 0;
}

View File

@ -715,10 +715,9 @@ QString CutterCore::getDecompiledCode(QString addr)
return cmd("pdc @ " + addr);
}
QString CutterCore::getFileInfo()
QJsonDocument CutterCore::getFileInfo()
{
QString info = cmd("ij");
return info;
return cmdj("ij");
}
QStringList CutterCore::getStats()
@ -1055,6 +1054,7 @@ QList<StringDescription> CutterCore::getAllStrings()
{
CORE_LOCK();
QList<StringDescription> ret;
return ret;
QJsonDocument stringsDoc = cmdj("izzj");
QJsonObject stringsObj = stringsDoc.object();
QJsonArray stringsArray = stringsObj["strings"].toArray();

View File

@ -316,7 +316,7 @@ public:
RVA getOffsetJump(RVA addr);
QString getDecompiledCode(RVA addr);
QString getDecompiledCode(QString addr);
QString getFileInfo();
QJsonDocument getFileInfo();
QStringList getStats();
QString getSimpleGraph(QString function);

View File

@ -225,9 +225,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-611</y>
<width>565</width>
<height>856</height>
<y>-379</y>
<width>564</width>
<height>786</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
@ -438,10 +438,10 @@
<item>
<widget class="QCheckBox" name="binCheckBox">
<property name="text">
<string>Load bin information</string>
<string>Do not load bin information (-n)</string>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>

View File

@ -26,6 +26,8 @@ namespace qhelpers
QString formatBytecount(const long bytecount)
{
if (bytecount == 0)
return "0";
const int exp = log(bytecount) / log(1000);
constexpr char suffixes[] = {' ', 'k', 'M', 'G', 'T', 'P', 'E'};

View File

@ -27,19 +27,9 @@ Dashboard::~Dashboard() {}
void Dashboard::updateContents()
{
// Parse and add JSON file info
QString info = CutterCore::getInstance()->getFileInfo();
QJsonDocument docu = QJsonDocument::fromJson(info.toUtf8());
QJsonObject object = docu.object();
QJsonValue value_core = object.value(QString("core"));
QJsonObject item = value_core.toObject();
//qDebug() << tr("QJsonObject of description: ") << item;
QJsonValue value_bin = object.value(QString("bin"));
//qDebug() << value;
QJsonObject item2 = value_bin.toObject();
//qDebug() << tr("QJsonObject of description: ") << item;
QJsonDocument docu = Core()->getFileInfo();
QJsonObject item = docu.object()["core"].toObject();
QJsonObject item2 = docu.object()["bin"].toObject();
this->ui->fileEdit->setText(item["file"].toString());
this->ui->formatEdit->setText(item["format"].toString());
@ -82,7 +72,6 @@ void Dashboard::updateContents()
else
{
this->ui->canaryEdit->setText("False");
//this->ui->canaryEdit->setStyleSheet("color: rgb(255, 0, 0);");
}
if (item2["crypto"].toBool() == true)
{
@ -99,7 +88,6 @@ void Dashboard::updateContents()
else
{
this->ui->nxEdit->setText("False");
//this->ui->nxEdit->setStyleSheet("color: rgb(255, 0, 0);");
}
if (item2["pic"].toBool() == true)
{
@ -108,7 +96,6 @@ void Dashboard::updateContents()
else
{
this->ui->picEdit->setText("False");
//this->ui->picEdit->setStyleSheet("color: rgb(255, 0, 0);");
}
if (item2["static"].toBool() == true)
{