mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 03:16:10 +00:00
Set bits for analysis after loading the binary (#618)
This commit is contained in:
parent
bf07f2a002
commit
f98a175c5c
@ -26,8 +26,6 @@ void AnalTask::runTask()
|
|||||||
log(tr("Loading Binary...\n"));
|
log(tr("Loading Binary...\n"));
|
||||||
openFailed = false;
|
openFailed = false;
|
||||||
|
|
||||||
Core()->setCPU(options.arch, options.cpu, options.bits);
|
|
||||||
|
|
||||||
int perms = R_IO_READ | R_IO_EXEC;
|
int perms = R_IO_READ | R_IO_EXEC;
|
||||||
if (options.writeEnabled)
|
if (options.writeEnabled)
|
||||||
perms |= R_IO_WRITE;
|
perms |= R_IO_WRITE;
|
||||||
@ -54,6 +52,9 @@ void AnalTask::runTask()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// r_core_bin_load might change asm.bits, so let's set that after the bin is loaded
|
||||||
|
Core()->setCPU(options.arch, options.cpu, options.bits);
|
||||||
|
|
||||||
if (isInterrupted()) {
|
if (isInterrupted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -609,8 +609,12 @@ void CutterCore::setConfig(const QString &k, const QVariant &v)
|
|||||||
|
|
||||||
void CutterCore::setCPU(QString arch, QString cpu, int bits)
|
void CutterCore::setCPU(QString arch, QString cpu, int bits)
|
||||||
{
|
{
|
||||||
setConfig("asm.arch", arch);
|
if (arch != nullptr) {
|
||||||
setConfig("asm.cpu", cpu);
|
setConfig("asm.arch", arch);
|
||||||
|
}
|
||||||
|
if (cpu != nullptr) {
|
||||||
|
setConfig("asm.cpu", cpu);
|
||||||
|
}
|
||||||
setConfig("asm.bits", bits);
|
setConfig("asm.bits", bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1068,15 +1068,13 @@ void HexdumpWidget::on_copySHA1_clicked()
|
|||||||
void HexdumpWidget::selectHexPreview()
|
void HexdumpWidget::selectHexPreview()
|
||||||
{
|
{
|
||||||
// Pre-select arch and bits in the hexdump sidebar
|
// Pre-select arch and bits in the hexdump sidebar
|
||||||
QString arch = Core()->cmd("e asm.arch").trimmed();
|
QString arch = Core()->getConfig("asm.arch");
|
||||||
QString bits = Core()->cmd("e asm.bits").trimmed();
|
QString bits = Core()->getConfig("asm.bits");
|
||||||
|
|
||||||
//int arch_index = ui->hexArchComboBox_2->findText(arch);
|
|
||||||
if (ui->parseArchComboBox->findText(arch) != -1) {
|
if (ui->parseArchComboBox->findText(arch) != -1) {
|
||||||
ui->parseArchComboBox->setCurrentIndex(ui->parseArchComboBox->findText(arch));
|
ui->parseArchComboBox->setCurrentIndex(ui->parseArchComboBox->findText(arch));
|
||||||
}
|
}
|
||||||
|
|
||||||
//int bits_index = ui->hexBitsComboBox_2->findText(bits);
|
|
||||||
if (ui->parseBitsComboBox->findText(bits) != -1) {
|
if (ui->parseBitsComboBox->findText(bits) != -1) {
|
||||||
ui->parseBitsComboBox->setCurrentIndex(ui->parseBitsComboBox->findText(bits));
|
ui->parseBitsComboBox->setCurrentIndex(ui->parseBitsComboBox->findText(bits));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user