mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Added options for disasm (#306)
This commit is contained in:
parent
25d2606bfc
commit
806fc5bded
@ -507,7 +507,11 @@ void CutterCore::resetDefaultAsmOptions()
|
|||||||
setConfig("asm.offset", Config()->getAsmOffset());
|
setConfig("asm.offset", Config()->getAsmOffset());
|
||||||
setConfig("asm.describe", Config()->getAsmDescribe());
|
setConfig("asm.describe", Config()->getAsmDescribe());
|
||||||
setConfig("asm.stackptr", Config()->getAsmStackPointer());
|
setConfig("asm.stackptr", Config()->getAsmStackPointer());
|
||||||
|
setConfig("asm.slow", Config()->getAsmSlow());
|
||||||
setConfig("asm.lines", Config()->getAsmLines());
|
setConfig("asm.lines", Config()->getAsmLines());
|
||||||
|
setConfig("asm.emu", Config()->getAsmEmu());
|
||||||
|
setConfig("asm.cmtright", Config()->getAsmCmtRight());
|
||||||
|
setConfig("asm.varsum", Config()->getAsmVarSum());
|
||||||
setConfig("asm.bytes", Config()->getAsmBytes());
|
setConfig("asm.bytes", Config()->getAsmBytes());
|
||||||
setConfig("asm.bytespace", Config()->getAsmBytespace());
|
setConfig("asm.bytespace", Config()->getAsmBytespace());
|
||||||
setConfig("asm.lbytes", Config()->getAsmLBytes());
|
setConfig("asm.lbytes", Config()->getAsmLBytes());
|
||||||
@ -517,6 +521,7 @@ void CutterCore::resetDefaultAsmOptions()
|
|||||||
setConfig("asm.capitalize", Config()->getAsmCapitalize());
|
setConfig("asm.capitalize", Config()->getAsmCapitalize());
|
||||||
setConfig("asm.varsub", Config()->getAsmVarsub());
|
setConfig("asm.varsub", Config()->getAsmVarsub());
|
||||||
setConfig("asm.varsub_only", Config()->getAsmVarsubOnly());
|
setConfig("asm.varsub_only", Config()->getAsmVarsubOnly());
|
||||||
|
setConfig("asm.tabs", Config()->getAsmTabs());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CutterCore::saveDefaultAsmOptions()
|
void CutterCore::saveDefaultAsmOptions()
|
||||||
@ -526,7 +531,11 @@ void CutterCore::saveDefaultAsmOptions()
|
|||||||
Config()->setAsmOffset(getConfigb("asm.offset"));
|
Config()->setAsmOffset(getConfigb("asm.offset"));
|
||||||
Config()->setAsmDescribe(getConfigb("asm.describe"));
|
Config()->setAsmDescribe(getConfigb("asm.describe"));
|
||||||
Config()->setAsmStackPointer(getConfigb("asm.stackptr"));
|
Config()->setAsmStackPointer(getConfigb("asm.stackptr"));
|
||||||
|
Config()->setAsmSlow(getConfigb("asm.slow"));
|
||||||
Config()->setAsmLines(getConfigb("asm.lines"));
|
Config()->setAsmLines(getConfigb("asm.lines"));
|
||||||
|
Config()->setAsmEmu(getConfigb("asm.emu"));
|
||||||
|
Config()->setAsmCmtRight(getConfigb("asm.cmtright"));
|
||||||
|
Config()->setAsmVarSum(getConfigb("asm.varsum"));
|
||||||
Config()->setAsmBytes(getConfigb("asm.bytes"));
|
Config()->setAsmBytes(getConfigb("asm.bytes"));
|
||||||
Config()->setAsmBytespace(getConfigb("asm.bytespace"));
|
Config()->setAsmBytespace(getConfigb("asm.bytespace"));
|
||||||
Config()->setAsmLBytes(getConfigb("asm.lbytes"));
|
Config()->setAsmLBytes(getConfigb("asm.lbytes"));
|
||||||
@ -536,6 +545,7 @@ void CutterCore::saveDefaultAsmOptions()
|
|||||||
Config()->setAsmCapitalize(getConfigb("asm.capitalize"));
|
Config()->setAsmCapitalize(getConfigb("asm.capitalize"));
|
||||||
Config()->setAsmVarsub(getConfigb("asm.varsub"));
|
Config()->setAsmVarsub(getConfigb("asm.varsub"));
|
||||||
Config()->setAsmVarsubOnly(getConfigb("asm.varsub_only"));
|
Config()->setAsmVarsubOnly(getConfigb("asm.varsub_only"));
|
||||||
|
Config()->setAsmTabs(getConfigi("asm.tabs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CutterCore::getConfig(const QString &k)
|
QString CutterCore::getConfig(const QString &k)
|
||||||
@ -768,12 +778,10 @@ void CutterCore::setSettings()
|
|||||||
//setConfig("asm.functions", "false");
|
//setConfig("asm.functions", "false");
|
||||||
setConfig("hex.pairs", false);
|
setConfig("hex.pairs", false);
|
||||||
setConfig("asm.cmtflgrefs", false);
|
setConfig("asm.cmtflgrefs", false);
|
||||||
setConfig("asm.cmtright", true);
|
|
||||||
setConfig("asm.cmtcol", 70);
|
setConfig("asm.cmtcol", 70);
|
||||||
setConfig("asm.xrefs", false);
|
setConfig("asm.xrefs", false);
|
||||||
setConfig("asm.fcnlines", false);
|
setConfig("asm.fcnlines", false);
|
||||||
|
|
||||||
setConfig("asm.tabs", 5);
|
|
||||||
setConfig("asm.tabsonce", true);
|
setConfig("asm.tabsonce", true);
|
||||||
setConfig("asm.tabsoff", 5);
|
setConfig("asm.tabsoff", 5);
|
||||||
setConfig("asm.nbytes", 10);
|
setConfig("asm.nbytes", 10);
|
||||||
|
@ -40,7 +40,11 @@ void AsmOptionsWidget::updateAsmOptionsFromVars()
|
|||||||
qhelpers::setCheckedWithoutSignals(ui->offsetCheckBox, Core()->getConfigb("asm.offset"));
|
qhelpers::setCheckedWithoutSignals(ui->offsetCheckBox, Core()->getConfigb("asm.offset"));
|
||||||
qhelpers::setCheckedWithoutSignals(ui->describeCheckBox, Core()->getConfigb("asm.describe"));
|
qhelpers::setCheckedWithoutSignals(ui->describeCheckBox, Core()->getConfigb("asm.describe"));
|
||||||
qhelpers::setCheckedWithoutSignals(ui->stackpointerCheckBox, Core()->getConfigb("asm.stackptr"));
|
qhelpers::setCheckedWithoutSignals(ui->stackpointerCheckBox, Core()->getConfigb("asm.stackptr"));
|
||||||
|
qhelpers::setCheckedWithoutSignals(ui->slowCheckBox, Core()->getConfigb("asm.slow"));
|
||||||
qhelpers::setCheckedWithoutSignals(ui->linesCheckBox, Core()->getConfigb("asm.lines"));
|
qhelpers::setCheckedWithoutSignals(ui->linesCheckBox, Core()->getConfigb("asm.lines"));
|
||||||
|
qhelpers::setCheckedWithoutSignals(ui->emuCheckBox, Core()->getConfigb("asm.emu"));
|
||||||
|
qhelpers::setCheckedWithoutSignals(ui->cmtrightCheckBox, Core()->getConfigb("asm.cmtright"));
|
||||||
|
qhelpers::setCheckedWithoutSignals(ui->varsumCheckBox, Core()->getConfigb("asm.varsum"));
|
||||||
|
|
||||||
bool bytesEnabled = Core()->getConfigb("asm.bytes");
|
bool bytesEnabled = Core()->getConfigb("asm.bytes");
|
||||||
qhelpers::setCheckedWithoutSignals(ui->bytesCheckBox, bytesEnabled);
|
qhelpers::setCheckedWithoutSignals(ui->bytesCheckBox, bytesEnabled);
|
||||||
@ -76,6 +80,10 @@ void AsmOptionsWidget::updateAsmOptionsFromVars()
|
|||||||
}
|
}
|
||||||
ui->caseComboBox->blockSignals(false);
|
ui->caseComboBox->blockSignals(false);
|
||||||
|
|
||||||
|
ui->asmTabsSpinBox->blockSignals(true);
|
||||||
|
ui->asmTabsSpinBox->setValue(Core()->getConfigi("asm.tabs"));
|
||||||
|
ui->asmTabsSpinBox->blockSignals(false);
|
||||||
|
|
||||||
qhelpers::setCheckedWithoutSignals(ui->bblineCheckBox, Core()->getConfigb("asm.bbline"));
|
qhelpers::setCheckedWithoutSignals(ui->bblineCheckBox, Core()->getConfigb("asm.bbline"));
|
||||||
|
|
||||||
bool varsubEnabled = Core()->getConfigb("asm.varsub");
|
bool varsubEnabled = Core()->getConfigb("asm.varsub");
|
||||||
@ -135,12 +143,36 @@ void AsmOptionsWidget::on_stackpointerCheckBox_toggled(bool checked)
|
|||||||
triggerAsmOptionsChanged();
|
triggerAsmOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmOptionsWidget::on_slowCheckBox_toggled(bool checked)
|
||||||
|
{
|
||||||
|
Core()->setConfig("asm.slow", checked);
|
||||||
|
triggerAsmOptionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void AsmOptionsWidget::on_linesCheckBox_toggled(bool checked)
|
void AsmOptionsWidget::on_linesCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
Core()->setConfig("asm.lines", checked);
|
Core()->setConfig("asm.lines", checked);
|
||||||
triggerAsmOptionsChanged();
|
triggerAsmOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmOptionsWidget::on_emuCheckBox_toggled(bool checked)
|
||||||
|
{
|
||||||
|
Core()->setConfig("asm.emu", checked);
|
||||||
|
triggerAsmOptionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AsmOptionsWidget::on_cmtrightCheckBox_toggled(bool checked)
|
||||||
|
{
|
||||||
|
Core()->setConfig("asm.cmtright", checked);
|
||||||
|
triggerAsmOptionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AsmOptionsWidget::on_varsumCheckBox_toggled(bool checked)
|
||||||
|
{
|
||||||
|
Core()->setConfig("asm.varsum", checked);
|
||||||
|
triggerAsmOptionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void AsmOptionsWidget::on_bytesCheckBox_toggled(bool checked)
|
void AsmOptionsWidget::on_bytesCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
Core()->setConfig("asm.bytes", checked);
|
Core()->setConfig("asm.bytes", checked);
|
||||||
@ -199,6 +231,12 @@ void AsmOptionsWidget::on_caseComboBox_currentIndexChanged(int index)
|
|||||||
triggerAsmOptionsChanged();
|
triggerAsmOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmOptionsWidget::on_asmTabsSpinBox_valueChanged(int value)
|
||||||
|
{
|
||||||
|
Core()->setConfig("asm.tabs", value);
|
||||||
|
triggerAsmOptionsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void AsmOptionsWidget::on_bblineCheckBox_toggled(bool checked)
|
void AsmOptionsWidget::on_bblineCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
Core()->setConfig("asm.bbline", checked);
|
Core()->setConfig("asm.bbline", checked);
|
||||||
|
@ -39,12 +39,17 @@ private slots:
|
|||||||
void on_offsetCheckBox_toggled(bool checked);
|
void on_offsetCheckBox_toggled(bool checked);
|
||||||
void on_describeCheckBox_toggled(bool checked);
|
void on_describeCheckBox_toggled(bool checked);
|
||||||
void on_stackpointerCheckBox_toggled(bool checked);
|
void on_stackpointerCheckBox_toggled(bool checked);
|
||||||
|
void on_slowCheckBox_toggled(bool checked);
|
||||||
void on_linesCheckBox_toggled(bool checked);
|
void on_linesCheckBox_toggled(bool checked);
|
||||||
|
void on_emuCheckBox_toggled(bool checked);
|
||||||
|
void on_cmtrightCheckBox_toggled(bool checked);
|
||||||
|
void on_varsumCheckBox_toggled(bool checked);
|
||||||
void on_bytesCheckBox_toggled(bool checked);
|
void on_bytesCheckBox_toggled(bool checked);
|
||||||
void on_bytespaceCheckBox_toggled(bool checked);
|
void on_bytespaceCheckBox_toggled(bool checked);
|
||||||
void on_lbytesCheckBox_toggled(bool checked);
|
void on_lbytesCheckBox_toggled(bool checked);
|
||||||
void on_syntaxComboBox_currentIndexChanged(int index);
|
void on_syntaxComboBox_currentIndexChanged(int index);
|
||||||
void on_caseComboBox_currentIndexChanged(int index);
|
void on_caseComboBox_currentIndexChanged(int index);
|
||||||
|
void on_asmTabsSpinBox_valueChanged(int value);
|
||||||
void on_bblineCheckBox_toggled(bool checked);
|
void on_bblineCheckBox_toggled(bool checked);
|
||||||
void on_varsubCheckBox_toggled(bool checked);
|
void on_varsubCheckBox_toggled(bool checked);
|
||||||
void on_varsubOnlyCheckBox_toggled(bool checked);
|
void on_varsubOnlyCheckBox_toggled(bool checked);
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>541</width>
|
<width>545</width>
|
||||||
<height>478</height>
|
<height>638</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -49,6 +49,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="slowCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Slow Analysis (asm.slow)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="linesCheckBox">
|
<widget class="QCheckBox" name="linesCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -56,6 +63,27 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="emuCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Run ESIL emulation analysis (asm.emu)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="cmtrightCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show comments at right of assembly (asm.cmtright)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="varsumCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show variables summary instead of full list (asm.varsum)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="bytesCheckBox">
|
<widget class="QCheckBox" name="bytesCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -117,6 +145,27 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Tabs in assembly (asm.tabs):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="asmTabsSpinBox">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="bblineCheckBox">
|
<widget class="QCheckBox" name="bblineCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -58,9 +58,21 @@ public:
|
|||||||
bool getAsmStackPointer() const { return s.value("asm.stackptr", false).toBool(); }
|
bool getAsmStackPointer() const { return s.value("asm.stackptr", false).toBool(); }
|
||||||
void setAsmStackPointer(bool v) { s.setValue("asm.stackptr", v); }
|
void setAsmStackPointer(bool v) { s.setValue("asm.stackptr", v); }
|
||||||
|
|
||||||
|
bool getAsmSlow() const { return s.value("asm.slow", false).toBool(); }
|
||||||
|
void setAsmSlow(bool v) { s.setValue("asm.slow", v); }
|
||||||
|
|
||||||
bool getAsmLines() const { return s.value("asm.lines", false).toBool(); }
|
bool getAsmLines() const { return s.value("asm.lines", false).toBool(); }
|
||||||
void setAsmLines(bool v) { s.setValue("asm.lines", v); }
|
void setAsmLines(bool v) { s.setValue("asm.lines", v); }
|
||||||
|
|
||||||
|
bool getAsmEmu() const { return s.value("asm.emu", false).toBool(); }
|
||||||
|
void setAsmEmu(bool v) { s.setValue("asm.emu", v); }
|
||||||
|
|
||||||
|
bool getAsmCmtRight() const { return s.value("asm.cmtright", true).toBool(); }
|
||||||
|
void setAsmCmtRight(bool v) { s.setValue("asm.cmtright", v); }
|
||||||
|
|
||||||
|
bool getAsmVarSum() const { return s.value("asm.varsum", false).toBool(); }
|
||||||
|
void setAsmVarSum(bool v) { s.setValue("asm.varsum", v); }
|
||||||
|
|
||||||
bool getAsmBytes() const { return s.value("asm.bytes", false).toBool(); }
|
bool getAsmBytes() const { return s.value("asm.bytes", false).toBool(); }
|
||||||
void setAsmBytes(bool v) { s.setValue("asm.bytes", v); }
|
void setAsmBytes(bool v) { s.setValue("asm.bytes", v); }
|
||||||
|
|
||||||
@ -88,6 +100,9 @@ public:
|
|||||||
bool getAsmVarsubOnly() const { return s.value("asm.varsub_only", true).toBool(); }
|
bool getAsmVarsubOnly() const { return s.value("asm.varsub_only", true).toBool(); }
|
||||||
void setAsmVarsubOnly(bool v) { s.setValue("asm.varsub_only", v); }
|
void setAsmVarsubOnly(bool v) { s.setValue("asm.varsub_only", v); }
|
||||||
|
|
||||||
|
int getAsmTabs() const { return s.value("asm.tabs", 5).toInt(); }
|
||||||
|
void setAsmTabs(int v) { s.setValue("asm.tabs", v); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void fontsUpdated();
|
void fontsUpdated();
|
||||||
void colorsUpdated();
|
void colorsUpdated();
|
||||||
|
Loading…
Reference in New Issue
Block a user