mirror of
https://github.com/x64dbg/x64dbg.git
synced 2024-11-23 21:10:14 +00:00
Find Pattern searches now begin at start of current region
This commit is contained in:
parent
a4be9f87f5
commit
ca637fad33
@ -1217,7 +1217,6 @@ void CPUDisassembly::findCallsSlot()
|
||||
void CPUDisassembly::findPatternSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.showEntireBlock(true);
|
||||
hexEdit.isDataCopiable(false);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
hexEdit.setWindowTitle(tr("Find Pattern..."));
|
||||
@ -1225,12 +1224,11 @@ void CPUDisassembly::findPatternSlot()
|
||||
return;
|
||||
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
|
||||
QString command;
|
||||
if(sender() == mFindPatternRegion)
|
||||
{
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
command = QString("findall %1, %2").arg(ToHexString(addr), hexEdit.mHexEdit->pattern());
|
||||
}
|
||||
else if(sender() == mFindPatternModule)
|
||||
|
@ -1443,15 +1443,13 @@ void CPUDump::binarySaveToFileSlot()
|
||||
void CPUDump::findPattern()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.showEntireBlock(true);
|
||||
hexEdit.isDataCopiable(false);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
hexEdit.setWindowTitle(tr("Find Pattern..."));
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
QString addrText = ToPtrString(addr);
|
||||
DbgCmdExec(QString("findall " + addrText + ", " + hexEdit.mHexEdit->pattern() + ", &data&"));
|
||||
emit displayReferencesWidget();
|
||||
|
@ -865,15 +865,15 @@ void CPUStack::binaryPasteIgnoreSizeSlot()
|
||||
void CPUStack::findPattern()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.showEntireBlock(true);
|
||||
hexEdit.isDataCopiable(false);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
hexEdit.setWindowTitle(tr("Find Pattern..."));
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
|
||||
QString addrText = ToPtrString(addr);
|
||||
DbgCmdExec(QString("findall " + addrText + ", " + hexEdit.mHexEdit->pattern() + ", &data&"));
|
||||
emit displayReferencesWidget();
|
||||
|
@ -612,12 +612,23 @@ void MemoryMapView::findPatternSlot()
|
||||
hexEdit.setWindowTitle(tr("Find Pattern..."));
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
duint addr = getSelectionAddr();
|
||||
|
||||
entireBlockEnabled = hexEdit.entireBlock();
|
||||
BridgeSettingSetUint("Gui", "MemoryMapEntireBlock", entireBlockEnabled);
|
||||
if(entireBlockEnabled)
|
||||
addr = 0;
|
||||
DbgCmdExec(QString("findallmem %1, %2, &data&").arg(ToPtrString(addr)).arg(hexEdit.mHexEdit->pattern()));
|
||||
{
|
||||
DbgCmdExec(QString("findallmem 0, %2").arg(hexEdit.mHexEdit->pattern()));
|
||||
}
|
||||
else
|
||||
{
|
||||
QList<duint> selection = getSelection();
|
||||
if(selection.isEmpty())
|
||||
return;
|
||||
duint addrFirst = getCellUserdata(selection.first(), ColAddress);
|
||||
duint addrLast = getCellUserdata(selection.last(), ColAddress);
|
||||
duint size = getCellUserdata(selection.last(), ColSize);
|
||||
DbgCmdExec(QString("findallmem %1, %2, %3").arg(ToPtrString(addrFirst)).arg(hexEdit.mHexEdit->pattern()).arg(ToHexString(addrLast - addrFirst + size)));
|
||||
}
|
||||
emit showReferences();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user