mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 03:16:10 +00:00
Made "load bin" checkbox more understandble
It is also now doing as the -n option of radare
This commit is contained in:
parent
a869009909
commit
28ff13729f
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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'};
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user