1
0
Fork 0

GUI: save entire block preference

This commit is contained in:
Duncan Ogilvie 2020-04-19 13:10:20 +02:00
parent 2bd139d89f
commit 3e8b9682bf
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
3 changed files with 10 additions and 4 deletions

View File

@ -97,9 +97,10 @@ HexEditDialog::~HexEditDialog()
delete ui;
}
void HexEditDialog::showEntireBlock(bool show)
void HexEditDialog::showEntireBlock(bool show, bool checked)
{
ui->chkEntireBlock->setVisible(show);
ui->chkEntireBlock->setChecked(checked);
}
void HexEditDialog::showKeepSize(bool show)

View File

@ -17,7 +17,7 @@ public:
explicit HexEditDialog(QWidget* parent = 0);
~HexEditDialog();
void showEntireBlock(bool show);
void showEntireBlock(bool show, bool checked = false);
void showKeepSize(bool show);
void isDataCopiable(bool copyDataEnabled);
void updateCodepage();

View File

@ -543,14 +543,19 @@ void MemoryMapView::memoryAllocateSlot()
void MemoryMapView::findPatternSlot()
{
HexEditDialog hexEdit(this);
hexEdit.showEntireBlock(true);
duint entireBlockEnabled = 0;
BridgeSettingGetUint("Gui", "MemoryMapEntireBlock", &entireBlockEnabled);
hexEdit.showEntireBlock(true, entireBlockEnabled);
hexEdit.showKeepSize(false);
hexEdit.isDataCopiable(false);
hexEdit.mHexEdit->setOverwriteMode(false);
hexEdit.setWindowTitle(tr("Find Pattern..."));
if(hexEdit.exec() != QDialog::Accepted)
return;
duint addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
if(hexEdit.entireBlock())
entireBlockEnabled = hexEdit.entireBlock();
BridgeSettingSetUint("Gui", "MemoryMapEntireBlock", entireBlockEnabled);
if(entireBlockEnabled)
addr = 0;
QString addrText = ToPtrString(addr);
DbgCmdExec(QString("findmemall " + addrText + ", \"" + hexEdit.mHexEdit->pattern() + "\", &data&").toUtf8().constData());