1
0
Fork 0

BRIDGE: added GuiReferenceSetSearchStartCol

DBG: only search the strings
GUI: fixed a bug with printDumpAt (the selection would change when you changed the view mode)
GUI: added API for changing the search start col
GUI: fixed a bug the search list view (it would only copy the first three columns)
This commit is contained in:
Mr. eXoDia 2014-04-05 16:37:21 +02:00
parent 9dd6056d31
commit 47e0f53565
10 changed files with 50 additions and 12 deletions

View File

@ -749,6 +749,11 @@ BRIDGE_IMPEXP void GuiReferenceSetProgress(int progress)
_gui_sendmessage(GUI_REF_SETPROGRESS, (void*)(duint)progress, 0);
}
BRIDGE_IMPEXP void GuiReferenceSetSearchStartCol(int col)
{
_gui_sendmessage(GUI_REF_SETSEARCHSTARTCOL, (void*)(duint)col, 0);
}
BRIDGE_IMPEXP void GuiStackDumpAt(duint addr, duint csp)
{
_gui_sendmessage(GUI_STACK_DUMP_AT, (void*)addr, (void*)csp);

View File

@ -495,6 +495,7 @@ enum GUIMSG
GUI_REF_RELOADDATA, // param1=unused, param2=unused
GUI_REF_SETSINGLESELECTION, // param1=int index, param2=bool scroll
GUI_REF_SETPROGRESS, // param1=int progress, param2=unused
GUI_REF_SETSEARCHSTARTCOL, // param1=int col param2=unused
GUI_STACK_DUMP_AT, // param1=duint addr, param2=duint csp
GUI_UPDATE_DUMP_VIEW, // param1=unused, param2=unused
GUI_UPDATE_THREAD_VIEW, // param1=unused, param2=unused
@ -544,6 +545,7 @@ BRIDGE_IMPEXP const char* GuiReferenceGetCellContent(int row, int col);
BRIDGE_IMPEXP void GuiReferenceReloadData();
BRIDGE_IMPEXP void GuiReferenceSetSingleSelection(int index, bool scroll);
BRIDGE_IMPEXP void GuiReferenceSetProgress(int progress);
BRIDGE_IMPEXP void GuiReferenceSetSearchStartCol(int col);
BRIDGE_IMPEXP void GuiStackDumpAt(duint addr, duint csp);
BRIDGE_IMPEXP void GuiUpdateDumpView();
BRIDGE_IMPEXP void GuiUpdateThreadView();

View File

@ -808,6 +808,7 @@ bool cbRefStr(DISASM* disasm, BASIC_INSTRUCTION_INFO* basicinfo, REFINFO* refinf
GuiReferenceAddColumn(2*sizeof(uint), "Address");
GuiReferenceAddColumn(64, "Disassembly");
GuiReferenceAddColumn(0, "String");
GuiReferenceSetSearchStartCol(2); //only search the strings
GuiReferenceReloadData();
return true;
}

View File

@ -21,7 +21,7 @@ HexDump::HexDump(QWidget *parent) : AbstractTableView(parent)
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(debugStateChanged(DBGSTATE)));
}
void HexDump::printDumpAt(int_t parVA)
void HexDump::printDumpAt(int_t parVA, bool select)
{
int_t wBase = DbgMemFindBaseAddr(parVA, 0); //get memory base
int_t wSize = DbgMemGetPageSize(wBase); //get page size
@ -49,11 +49,17 @@ void HexDump::printDumpAt(int_t parVA)
setTableOffset((wRVA + mByteOffset) / wBytePerRowCount); //change the displayed offset
setSingleSelection(wRVA);
if(select)
setSingleSelection(wRVA);
reloadData();
}
void HexDump::printDumpAt(int_t parVA)
{
printDumpAt(parVA, true);
}
void HexDump::mouseMoveEvent(QMouseEvent* event)
{
bool wAccept = true;
@ -161,7 +167,7 @@ QString HexDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
{
// Reset byte offset when base address is reached
if(rowBase == 0 && mByteOffset != 0)
printDumpAt(mBase);
printDumpAt(mBase, false);
// Compute RVA
int wBytePerRowCount = getBytePerRowCount();
@ -857,7 +863,7 @@ void HexDump::appendResetDescriptor(int width, QString title, bool clickable, Co
int_t wRVA = getTableOffset() * getBytePerRowCount() - mByteOffset;
clearDescriptors();
appendDescriptor(width, title, clickable, descriptor);
printDumpAt(wRVA + mBase);
printDumpAt(wRVA + mBase, false);
}
else
appendDescriptor(width, title, clickable, descriptor);

View File

@ -127,6 +127,8 @@ public:
void appendDescriptor(int width, QString title, bool clickable, ColumnDescriptor_t descriptor);
void appendResetDescriptor(int width, QString title, bool clickable, ColumnDescriptor_t descriptor);
void clearDescriptors();
void printDumpAt(int_t parVA, bool select);
public slots:
void printDumpAt(int_t parVA);

View File

@ -22,6 +22,7 @@ ReferenceView::ReferenceView()
connect(Bridge::getBridge(), SIGNAL(referenceReloadData()), this, SLOT(reloadData()));
connect(Bridge::getBridge(), SIGNAL(referenceSetSingleSelection(int,bool)), this, SLOT(setSingleSelection(int,bool)));
connect(Bridge::getBridge(), SIGNAL(referenceSetProgress(int)), mSearchProgress, SLOT(setValue(int)));
connect(Bridge::getBridge(), SIGNAL(referenceSetSearchStartCol(int)), this, SLOT(setSearchStartCol(int)));
connect(this, SIGNAL(listContextMenuSignal(QPoint)), this, SLOT(referenceContextMenu(QPoint)));
connect(this, SIGNAL(enterPressedSignal()), this, SLOT(followAddress()));
@ -64,6 +65,7 @@ void ReferenceView::deleteAllColumns()
mList->setSingleSelection(0);
mList->deleteAllColumns();
mList->reloadData();
mSearchStartCol = 1;
}
void ReferenceView::setCellContent(int r, int c, QString s)
@ -86,6 +88,12 @@ void ReferenceView::setSingleSelection(int index, bool scroll)
mList->setTableOffset(index);
}
void ReferenceView::setSearchStartCol(int col)
{
if(col < mList->getColumnCount())
this->mSearchStartCol = col;
}
void ReferenceView::referenceContextMenu(const QPoint &pos)
{
if(!this->mCurList->getRowCount())

View File

@ -21,6 +21,7 @@ private slots:
void setCellContent(int r, int c, QString s);
void reloadData();
void setSingleSelection(int index, bool scroll);
void setSearchStartCol(int col);
void referenceContextMenu(const QPoint & pos);
void followAddress();
void followDumpAddress();

View File

@ -121,25 +121,25 @@ void SearchListView::searchTextChanged(const QString &arg1)
mCurList=mList;
}
mSearchList->setRowCount(0);
int count=mList->getRowCount();
for(int i=0,j=0; i<count; i++)
int rows=mList->getRowCount();
int columns=mList->getColumnCount();
for(int i=0,j=0; i<rows; i++)
{
if(findTextInList(mList, arg1, i, mSearchStartCol, false))
{
mSearchList->setRowCount(j+1);
mSearchList->setCellContent(j, 0, mList->getCellContent(i, 0));
mSearchList->setCellContent(j, 1, mList->getCellContent(i, 1));
mSearchList->setCellContent(j, 2, mList->getCellContent(i, 2));
for(int k=0; k<columns; k++)
mSearchList->setCellContent(j, k, mList->getCellContent(i, k));
j++;
}
}
count=mSearchList->getRowCount();
rows=mSearchList->getRowCount();
mSearchList->setTableOffset(0);
for(int i=0; i<count; i++)
for(int i=0; i<rows; i++)
{
if(findTextInList(mSearchList, arg1, i, mSearchStartCol, true))
{
if(count>mSearchList->getViewableRowsCount())
if(rows>mSearchList->getViewableRowsCount())
{
int cur=i-mSearchList->getViewableRowsCount()/2;
if(!mSearchList->isValidIndex(cur, 0))

View File

@ -188,6 +188,11 @@ void Bridge::emitReferenceSetProgress(int progress)
emit referenceSetProgress(progress);
}
void Bridge::emitReferenceSetSearchStartCol(int col)
{
emit referenceSetSearchStartCol(col);
}
void Bridge::emitStackDumpAt(uint_t va, uint_t csp)
{
emit stackDumpAt(va, csp);
@ -425,6 +430,12 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
}
break;
case GUI_REF_SETSEARCHSTARTCOL:
{
Bridge::getBridge()->emitReferenceSetSearchStartCol((int)(int_t)param1);
}
break;
case GUI_STACK_DUMP_AT:
{
Bridge::getBridge()->emitStackDumpAt((uint_t)param1, (uint_t)param2);

View File

@ -55,6 +55,7 @@ public:
void emitReferenceReloadData();
void emitReferenceSetSingleSelection(int index, bool scroll);
void emitReferenceSetProgress(int progress);
void emitReferenceSetSearchStartCol(int col);
void emitStackDumpAt(uint_t va, uint_t csp);
void emitUpdateDump();
void emitUpdateThreads();
@ -96,6 +97,7 @@ signals:
void referenceReloadData();
void referenceSetSingleSelection(int index, bool scroll);
void referenceSetProgress(int progress);
void referenceSetSearchStartCol(int col);
void stackDumpAt(uint_t va, uint_t csp);
void updateDump();
void updateThreads();