Add asm.flags.real to preferences and enable by default (#2014)

This commit is contained in:
Itay Cohen 2020-01-21 12:00:38 +02:00 committed by Florian Märkl
parent e0c80182dd
commit 1c39aa6d41
3 changed files with 418 additions and 359 deletions

View File

@ -124,6 +124,7 @@ static const QHash<QString, QVariant> asmOptions = {
{ "asm.tabs.off", 5 }, { "asm.tabs.off", 5 },
{ "asm.marks", false }, { "asm.marks", false },
{ "asm.refptr", false }, { "asm.refptr", false },
{ "asm.flags.real", true },
{ "esil.breakoninvalid",true }, { "esil.breakoninvalid",true },
{ "graph.offset", false} { "graph.offset", false}
}; };

View File

@ -42,6 +42,7 @@ AsmOptionsWidget::AsmOptionsWidget(PreferencesDialog *dialog)
{ ui->emuStrCheckBox, "emu.str" }, { ui->emuStrCheckBox, "emu.str" },
{ ui->varsumCheckBox, "asm.var.summary" }, { ui->varsumCheckBox, "asm.var.summary" },
{ ui->sizeCheckBox, "asm.size" }, { ui->sizeCheckBox, "asm.size" },
{ ui->realnameCheckBox, "asm.flags.real" }
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>652</width> <width>652</width>
<height>725</height> <height>686</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -36,282 +36,331 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QGroupBox" name="disassemblyGroupBox"> <widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy"> <property name="frameShape">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <enum>QFrame::NoFrame</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="title"> <property name="widgetResizable">
<string>Disassembly</string> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <widget class="QWidget" name="scrollAreaWidgetContents">
<item row="5" column="2"> <property name="geometry">
<widget class="QComboBox" name="caseComboBox"> <rect>
<item> <x>0</x>
<property name="text"> <y>0</y>
<string>Lowercase</string> <width>583</width>
<height>668</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="disassemblyGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</item> <property name="title">
<item> <string>Disassembly</string>
<property name="text">
<string>Uppercase (asm.ucase)</string>
</property> </property>
</item> <layout class="QGridLayout" name="gridLayout">
<item> <item row="9" column="2">
<property name="text"> <widget class="QSpinBox" name="nbytesSpinBox">
<string>Capitalize (asm.capitalize)</string> <property name="enabled">
</property> <bool>true</bool>
</item> </property>
</widget> </widget>
</item>
<item row="11" column="2">
<widget class="QSpinBox" name="asmTabsOffSpinBox">
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="asmTabsLabel">
<property name="text">
<string>Tabs in assembly (asm.tabs):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="syntaxComboBox"/>
</item>
<item row="10" column="2">
<widget class="QSpinBox" name="asmTabsSpinBox">
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="14" column="1" colspan="2">
<widget class="QCheckBox" name="bytespaceCheckBox">
<property name="text">
<string>Separate bytes with whitespace (asm.bytespace)</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="syntaxLabel">
<property name="text">
<string>Syntax (asm.syntax):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="12" column="1" colspan="2">
<widget class="QCheckBox" name="indentCheckBox">
<property name="text">
<string>Indent disassembly based on reflines depth (asm.indent)</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="offsetCheckBox">
<property name="text">
<string>Show offsets (asm.offset)</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLabel" name="asmTabsOffLabel">
<property name="text">
<string>Tabs before assembly (asm.tabs.off):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Show Disassembly as:</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QCheckBox" name="bblineCheckBox">
<property name="text">
<string>Show empty line after every basic block (asm.bb.line)</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2" colspan="2">
<widget class="QComboBox" name="asmComboBox">
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>ESIL (asm.esil)</string>
</property>
</item>
<item>
<property name="text">
<string>Pseudocode (asm.pseudo)</string>
</property>
</item>
</widget>
</item>
<item row="13" column="1" colspan="2">
<widget class="QCheckBox" name="lbytesCheckBox">
<property name="text">
<string>Align bytes to the left (asm.lbytes)</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="bytesCheckBox">
<property name="text">
<string>Display the bytes of each instruction (asm.bytes)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="commentsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Comments</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_5" columnminimumwidth="0,0">
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="describeCheckBox">
<property name="text">
<string>Show opcode description (asm.describe)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="commentsComboBox">
<item>
<property name="text">
<string>Normal</string>
</property>
</item> </item>
<item> <item row="9" column="1">
<property name="text"> <widget class="QLabel" name="nbytesLabel">
<string>Above instructions</string> <property name="enabled">
</property> <bool>true</bool>
</property>
<property name="text">
<string>Number of bytes to display (asm.nbytes):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item> </item>
<item> <item row="13" column="1">
<property name="text"> <widget class="QLabel" name="asmTabsOffLabel">
<string>Off</string> <property name="text">
</property> <string>Tabs before assembly (asm.tabs.off):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item> </item>
</widget> <item row="3" column="1">
</item> <widget class="QLabel" name="label">
<item row="0" column="0"> <property name="text">
<widget class="QLabel" name="label_2"> <string>Show Disassembly as:</string>
<property name="text"> </property>
<string>Show comments:</string> <property name="textInteractionFlags">
</property> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
<property name="textInteractionFlags"> </property>
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> </widget>
</property> </item>
</widget> <item row="13" column="2">
</item> <widget class="QSpinBox" name="asmTabsOffSpinBox">
<item row="4" column="1"> <property name="maximum">
<widget class="QSpinBox" name="cmtcolSpinBox"> <number>100</number>
<property name="maximum"> </property>
<number>100</number> <property name="singleStep">
</property> <number>5</number>
<property name="singleStep"> </property>
<number>5</number> </widget>
</property> </item>
</widget> <item row="16" column="1" colspan="2">
</item> <widget class="QCheckBox" name="bytespaceCheckBox">
<item row="4" column="0"> <property name="text">
<widget class="QLabel" name="cmtcolLabel"> <string>Separate bytes with whitespace (asm.bytespace)</string>
<property name="text"> </property>
<string>Column to align comments (asm.cmt.col):</string> </widget>
</property> </item>
<property name="textInteractionFlags"> <item row="14" column="1" colspan="2">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <widget class="QCheckBox" name="indentCheckBox">
</property> <property name="text">
</widget> <string>Indent disassembly based on reflines depth (asm.indent)</string>
</item> </property>
<item row="2" column="0"> </widget>
<widget class="QCheckBox" name="xrefCheckBox"> </item>
<property name="text"> <item row="12" column="2">
<string>Show x-refs (asm.xrefs)</string> <widget class="QSpinBox" name="asmTabsSpinBox">
</property> <property name="maximum">
</widget> <number>100</number>
</item> </property>
<item row="3" column="0" colspan="2"> <property name="singleStep">
<widget class="QCheckBox" name="refptrCheckBox"> <number>5</number>
<property name="text"> </property>
<string>Show refpointer information (asm.refptr)</string> </widget>
</property> </item>
</widget> <item row="12" column="1">
</item> <widget class="QLabel" name="asmTabsLabel">
</layout> <property name="text">
</item> <string>Tabs in assembly (asm.tabs):</string>
<item row="0" column="0"> </property>
<spacer name="verticalSpacer_2"> <property name="textInteractionFlags">
<property name="orientation"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
<enum>Qt::Vertical</enum> </property>
</property> </widget>
<property name="sizeType"> </item>
<enum>QSizePolicy::Fixed</enum> <item row="15" column="1" colspan="2">
</property> <widget class="QCheckBox" name="lbytesCheckBox">
<property name="sizeHint" stdset="0"> <property name="text">
<size> <string>Align bytes to the left (asm.lbytes)</string>
<width>20</width> </property>
<height>10</height> </widget>
</size> </item>
</property> <item row="0" column="1" colspan="2">
</spacer> <spacer name="verticalSpacer_3">
</item> <property name="orientation">
</layout> <enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="2">
<widget class="QComboBox" name="caseComboBox">
<item>
<property name="text">
<string>Lowercase</string>
</property>
</item>
<item>
<property name="text">
<string>Uppercase (asm.ucase)</string>
</property>
</item>
<item>
<property name="text">
<string>Capitalize (asm.capitalize)</string>
</property>
</item>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QComboBox" name="asmComboBox">
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>ESIL (asm.esil)</string>
</property>
</item>
<item>
<property name="text">
<string>Pseudocode (asm.pseudo)</string>
</property>
</item>
</widget>
</item>
<item row="11" column="1" colspan="2">
<widget class="QCheckBox" name="bblineCheckBox">
<property name="text">
<string>Show empty line after every basic block (asm.bb.line)</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="offsetCheckBox">
<property name="text">
<string>Show offsets (asm.offset)</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="syntaxLabel">
<property name="text">
<string>Syntax (asm.syntax):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="bytesCheckBox">
<property name="text">
<string>Display the bytes of each instruction (asm.bytes)</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="syntaxComboBox"/>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="realnameCheckBox">
<property name="text">
<string>Display flags' real name (asm.flags.real)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="commentsGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Comments</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_5" columnminimumwidth="0,0">
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="describeCheckBox">
<property name="text">
<string>Show opcode description (asm.describe)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="commentsComboBox">
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Above instructions</string>
</property>
</item>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Show comments:</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="cmtcolSpinBox">
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="cmtcolLabel">
<property name="text">
<string>Column to align comments (asm.cmt.col):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="xrefCheckBox">
<property name="text">
<string>Show x-refs (asm.xrefs)</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="refptrCheckBox">
<property name="text">
<string>Show refpointer information (asm.refptr)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -322,101 +371,109 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="slowCheckBox"> <widget class="QScrollArea" name="scrollArea_2">
<property name="text"> <property name="frameShape">
<string>Slow Analysis (asm.slow)</string> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>581</width>
<height>302</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QCheckBox" name="slowCheckBox">
<property name="text">
<string>Slow Analysis (asm.slow)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="linesCheckBox">
<property name="text">
<string>Show jump lines (asm.lines)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fcnlinesCheckBox">
<property name="text">
<string>Show function boundary lines (asm.lines.fcn)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="flgoffCheckBox">
<property name="text">
<string>Show offset before flags (asm.flags.off)</string>
</property>
</widget>
</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="emuStrCheckBox">
<property name="text">
<string>Show only strings if any in the asm.emu output (emu.str)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sizeCheckBox">
<property name="text">
<string>Show size of opcodes in disassembly (asm.size)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varsumCheckBox">
<property name="text">
<string>Show variables summary instead of full list (asm.var.summary)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varsubCheckBox">
<property name="text">
<string>Substitute variables (asm.var.sub)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varsubOnlyCheckBox">
<property name="text">
<string>Substitute entire variable expressions with names (asm.var.subonly)</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="linesCheckBox"> <spacer name="verticalSpacer_4">
<property name="text"> <property name="orientation">
<string>Show jump lines (asm.lines)</string> <enum>Qt::Vertical</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item> <width>20</width>
<widget class="QCheckBox" name="fcnlinesCheckBox"> <height>40</height>
<property name="text"> </size>
<string>Show function boundary lines (asm.lines.fcn)</string>
</property> </property>
</widget> </spacer>
</item>
<item>
<widget class="QCheckBox" name="flgoffCheckBox">
<property name="text">
<string>Show offset before flags (asm.flags.off)</string>
</property>
</widget>
</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="emuStrCheckBox">
<property name="text">
<string>Show only strings if any in the asm.emu output (emu.str)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="sizeCheckBox">
<property name="text">
<string>Show size of opcodes in disassembly (asm.size)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varsumCheckBox">
<property name="text">
<string>Show variables summary instead of full list (asm.var.summary)</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>16</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nbytesLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Number of bytes to display (asm.nbytes):</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="nbytesSpinBox">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="varsubCheckBox">
<property name="text">
<string>Substitute variables (asm.var.sub)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varsubOnlyCheckBox">
<property name="text">
<string>Substitute entire variable expressions with names (asm.var.subonly)</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>