parent
c9d7d15297
commit
a905656230
|
@ -9,7 +9,7 @@ CapstoneTokenizer::CapstoneTokenizer(int maxModuleLength)
|
|||
isNop(false),
|
||||
_mnemonicType(TokenType::Uncategorized)
|
||||
{
|
||||
SetConfig(false, false, false, false, false, false);
|
||||
SetConfig(false, false, false, false, false, false, false);
|
||||
}
|
||||
|
||||
CapstoneTokenizer::TokenColor colorNamesMap[CapstoneTokenizer::TokenType::Last];
|
||||
|
@ -173,12 +173,13 @@ void CapstoneTokenizer::UpdateConfig()
|
|||
ConfigBool("Disassembler", "ArgumentSpaces"),
|
||||
ConfigBool("Disassembler", "MemorySpaces"),
|
||||
ConfigBool("Disassembler", "NoHighlightOperands"),
|
||||
ConfigBool("Disassembler", "NoCurrentModuleText"));
|
||||
ConfigBool("Disassembler", "NoCurrentModuleText"),
|
||||
ConfigBool("Disassembler", "0xPrefixValues"));
|
||||
_maxModuleLength = (int)ConfigUint("Disassembler", "MaxModuleSize");
|
||||
UpdateStringPool();
|
||||
}
|
||||
|
||||
void CapstoneTokenizer::SetConfig(bool bUppercase, bool bTabbedMnemonic, bool bArgumentSpaces, bool bMemorySpaces, bool bNoHighlightOperands, bool bNoCurrentModuleText)
|
||||
void CapstoneTokenizer::SetConfig(bool bUppercase, bool bTabbedMnemonic, bool bArgumentSpaces, bool bMemorySpaces, bool bNoHighlightOperands, bool bNoCurrentModuleText, bool b0xPrefixValues)
|
||||
{
|
||||
_bUppercase = bUppercase;
|
||||
_bTabbedMnemonic = bTabbedMnemonic;
|
||||
|
@ -186,6 +187,7 @@ void CapstoneTokenizer::SetConfig(bool bUppercase, bool bTabbedMnemonic, bool bA
|
|||
_bMemorySpaces = bMemorySpaces;
|
||||
_bNoHighlightOperands = bNoHighlightOperands;
|
||||
_bNoCurrentModuleText = bNoCurrentModuleText;
|
||||
_b0xPrefixValues = b0xPrefixValues;
|
||||
}
|
||||
|
||||
int CapstoneTokenizer::Size() const
|
||||
|
@ -349,6 +351,8 @@ QString CapstoneTokenizer::printValue(const TokenValue & value, bool expandModul
|
|||
finalText = QString("%1%2").arg(moduleText).arg(addrText);
|
||||
else if(bHasLabel) //<label>
|
||||
finalText = QString("<%1>").arg(labelText);
|
||||
else if (_b0xPrefixValues)
|
||||
finalText = QString("0x")+addrText;
|
||||
else
|
||||
finalText = addrText;
|
||||
return finalText;
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
bool Tokenize(duint addr, const unsigned char* data, int datasize, InstructionToken & instruction);
|
||||
bool TokenizeData(const QString & datatype, const QString & data, InstructionToken & instruction);
|
||||
void UpdateConfig();
|
||||
void SetConfig(bool bUppercase, bool bTabbedMnemonic, bool bArgumentSpaces, bool bMemorySpaces, bool bNoHighlightOperands, bool bNoCurrentModuleText);
|
||||
void SetConfig(bool bUppercase, bool bTabbedMnemonic, bool bArgumentSpaces, bool bMemorySpaces, bool bNoHighlightOperands, bool bNoCurrentModuleText, bool b0xPrefixValues);
|
||||
int Size() const;
|
||||
const Capstone & GetCapstone() const;
|
||||
|
||||
|
@ -173,6 +173,7 @@ private:
|
|||
bool _bMemorySpaces;
|
||||
bool _bNoHighlightOperands;
|
||||
bool _bNoCurrentModuleText;
|
||||
bool _b0xPrefixValues;
|
||||
TokenType _mnemonicType;
|
||||
|
||||
void addToken(TokenType type, QString text, const TokenValue & value);
|
||||
|
|
|
@ -70,6 +70,7 @@ void SettingsDialog::LoadSettings()
|
|||
settings.disasmOnlyCipAutoComments = false;
|
||||
settings.disasmTabBetweenMnemonicAndArguments = false;
|
||||
settings.disasmNoCurrentModuleText = false;
|
||||
settings.disasm0xPrefixValues = false;
|
||||
settings.guiNoForegroundWindow = true;
|
||||
|
||||
//Events tab
|
||||
|
@ -196,6 +197,7 @@ void SettingsDialog::LoadSettings()
|
|||
GetSettingBool("Disassembler", "NoHighlightOperands", &settings.disasmNoHighlightOperands);
|
||||
GetSettingBool("Disassembler", "PermanentHighlightingMode", &settings.disasmPermanentHighlightingMode);
|
||||
GetSettingBool("Disassembler", "NoCurrentModuleText", &settings.disasmNoCurrentModuleText);
|
||||
GetSettingBool("Disassembler", "0xPrefixValues", &settings.disasm0xPrefixValues);
|
||||
ui->chkArgumentSpaces->setChecked(settings.disasmArgumentSpaces);
|
||||
ui->chkMemorySpaces->setChecked(settings.disasmMemorySpaces);
|
||||
ui->chkUppercase->setChecked(settings.disasmUppercase);
|
||||
|
@ -204,6 +206,7 @@ void SettingsDialog::LoadSettings()
|
|||
ui->chkNoHighlightOperands->setChecked(settings.disasmNoHighlightOperands);
|
||||
ui->chkPermanentHighlightingMode->setChecked(settings.disasmPermanentHighlightingMode);
|
||||
ui->chkNoCurrentModuleText->setChecked(settings.disasmNoCurrentModuleText);
|
||||
ui->chk0xPrefixValues->setChecked(settings.disasm0xPrefixValues);
|
||||
|
||||
//Gui tab
|
||||
GetSettingBool("Gui", "FpuRegistersLittleEndian", &settings.guiFpuRegistersLittleEndian);
|
||||
|
@ -336,6 +339,7 @@ void SettingsDialog::SaveSettings()
|
|||
BridgeSettingSetUint("Disassembler", "NoHighlightOperands", settings.disasmNoHighlightOperands);
|
||||
BridgeSettingSetUint("Disassembler", "PermanentHighlightingMode", settings.disasmPermanentHighlightingMode);
|
||||
BridgeSettingSetUint("Disassembler", "NoCurrentModuleText", settings.disasmNoCurrentModuleText);
|
||||
BridgeSettingSetUint("Disassembler", "0xPrefixValues", settings.disasm0xPrefixValues);
|
||||
|
||||
//Gui tab
|
||||
BridgeSettingSetUint("Gui", "FpuRegistersLittleEndian", settings.guiFpuRegistersLittleEndian);
|
||||
|
@ -780,3 +784,9 @@ void SettingsDialog::on_chkNoCurrentModuleText_toggled(bool checked)
|
|||
bTokenizerConfigUpdated = true;
|
||||
settings.disasmNoCurrentModuleText = checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_chk0xPrefixValues_toggled(bool checked)
|
||||
{
|
||||
bTokenizerConfigUpdated = true;
|
||||
settings.disasm0xPrefixValues = checked;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ private slots:
|
|||
void on_chkNoHighlightOperands_toggled(bool checked);
|
||||
void on_chkNoCurrentModuleText_toggled(bool checked);
|
||||
void on_chkPermanentHighlightingMode_toggled(bool checked);
|
||||
void on_chk0xPrefixValues_toggled(bool checked);
|
||||
//Gui Tab
|
||||
void on_chkFpuRegistersLittleEndian_stateChanged(int arg1);
|
||||
void on_chkSaveColumnOrder_stateChanged(int arg1);
|
||||
|
@ -156,6 +157,7 @@ private:
|
|||
bool disasmNoHighlightOperands;
|
||||
bool disasmNoCurrentModuleText;
|
||||
bool disasmPermanentHighlightingMode;
|
||||
bool disasm0xPrefixValues;
|
||||
//Gui Tab
|
||||
bool guiFpuRegistersLittleEndian;
|
||||
bool guiSaveColumnOrder;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>508</height>
|
||||
<height>514</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -33,7 +33,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabEvents">
|
||||
<attribute name="title">
|
||||
|
@ -531,6 +531,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chk0xPrefixValues">
|
||||
<property name="text">
|
||||
<string>0x prefix for values</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -237,6 +237,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
disassemblyBool.insert("LongDataInstruction", false);
|
||||
disassemblyBool.insert("NoHighlightOperands", false);
|
||||
disassemblyBool.insert("PermanentHighlightingMode", false);
|
||||
disassemblyBool.insert("0xPrefixValues", false);
|
||||
disassemblyBool.insert("NoCurrentModuleText", false);
|
||||
defaultBools.insert("Disassembler", disassemblyBool);
|
||||
|
||||
|
|
Loading…
Reference in New Issue