Merge pull request #3233 from x64dbg/fix-3198
Fix #3198: Implement GuiSelectionSet for GUI_MEMMAPdevelopment
commit
56ee888a0b
|
@ -576,6 +576,9 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
case GUI_STACK:
|
||||
emit selectionStackSet(selection);
|
||||
break;
|
||||
case GUI_MEMMAP:
|
||||
emit selectionMemmapSet(selection);
|
||||
break;
|
||||
default:
|
||||
return (void*)false;
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ signals:
|
|||
void selectionStackSet(const SELECTIONDATA* selection);
|
||||
void selectionGraphGet(SELECTIONDATA* selection);
|
||||
void selectionMemmapGet(SELECTIONDATA* selection);
|
||||
void selectionMemmapSet(const SELECTIONDATA* selection);
|
||||
void selectionSymmodGet(SELECTIONDATA* selection);
|
||||
void getStrWindow(const QString title, QString* text);
|
||||
void autoCompleteAddCmd(const QString cmd);
|
||||
|
|
|
@ -37,6 +37,7 @@ MemoryMapView::MemoryMapView(StdTable* parent)
|
|||
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(stateChangedSlot(DBGSTATE)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectInMemoryMap(duint)), this, SLOT(selectAddress(duint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionMemmapGet(SELECTIONDATA*)), this, SLOT(selectionGetSlot(SELECTIONDATA*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionMemmapSet(const SELECTIONDATA*)), this, SLOT(selectionSetSlot(const SELECTIONDATA*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(disassembleAt(duint, duint)), this, SLOT(disassembleAtSlot(duint, duint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(focusMemmap()), this, SLOT(setFocus()));
|
||||
connect(this, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(contextMenuSlot(QPoint)));
|
||||
|
@ -736,6 +737,47 @@ void MemoryMapView::selectionGetSlot(SELECTIONDATA* selection)
|
|||
Bridge::getBridge()->setResult(BridgeResult::SelectionGet, 1);
|
||||
}
|
||||
|
||||
void MemoryMapView::selectionSetSlot(const SELECTIONDATA* selection)
|
||||
{
|
||||
const auto rowCount = getRowCount();
|
||||
if(rowCount == 0)
|
||||
{
|
||||
Bridge::getBridge()->setResult(BridgeResult::SelectionSet, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto badIndex = (duint) - 1;
|
||||
duint firstIdx = badIndex;
|
||||
duint lastIdx = badIndex;
|
||||
|
||||
for(duint row = 0; row < rowCount; row++)
|
||||
{
|
||||
const duint addrStart = getCellUserdata(row, ColAddress);
|
||||
if(addrStart < selection->start)
|
||||
continue;
|
||||
|
||||
const duint addrEnd = addrStart + getCellUserdata(row, ColSize);
|
||||
if(addrEnd > selection->end)
|
||||
break;
|
||||
|
||||
if(firstIdx == badIndex)
|
||||
firstIdx = row;
|
||||
|
||||
lastIdx = row;
|
||||
}
|
||||
|
||||
if(firstIdx == badIndex || lastIdx == badIndex)
|
||||
{
|
||||
Bridge::getBridge()->setResult(BridgeResult::SelectionSet, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
setSingleSelection(firstIdx);
|
||||
expandSelectionUpTo(lastIdx);
|
||||
reloadData();
|
||||
Bridge::getBridge()->setResult(BridgeResult::SelectionSet, 1);
|
||||
}
|
||||
|
||||
void MemoryMapView::disassembleAtSlot(duint va, duint cip)
|
||||
{
|
||||
Q_UNUSED(va)
|
||||
|
|
|
@ -39,6 +39,7 @@ public slots:
|
|||
void addVirtualModSlot();
|
||||
void findReferencesSlot();
|
||||
void selectionGetSlot(SELECTIONDATA* selection);
|
||||
void selectionSetSlot(const SELECTIONDATA* selection);
|
||||
void disassembleAtSlot(duint va, duint cip);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue