Skip to content

Commit

Permalink
Merge pull request #2001 from torusrxxx/patch0000008f
Browse files Browse the repository at this point in the history
Use keys to select in dump
  • Loading branch information
mrexodia committed Aug 12, 2018
2 parents 7526b7e + f6216e2 commit 80c303d
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 112 deletions.
6 changes: 3 additions & 3 deletions src/gui/Src/BasicView/AbstractStdTable.cpp
Expand Up @@ -590,12 +590,12 @@ void AbstractStdTable::setSingleSelection(int index)
emit selectionChangedSignal(index);
}

int AbstractStdTable::getInitialSelection()
int AbstractStdTable::getInitialSelection() const
{
return mSelection.firstSelectedIndex;
}

QList<int> AbstractStdTable::getSelection()
QList<int> AbstractStdTable::getSelection() const
{
QList<int> selection;
selection.reserve(mSelection.toIndex - mSelection.fromIndex);
Expand Down Expand Up @@ -657,7 +657,7 @@ void AbstractStdTable::selectAll()
emit selectionChangedSignal(index);
}

bool AbstractStdTable::isSelected(int base, int offset)
bool AbstractStdTable::isSelected(int base, int offset) const
{
int wIndex = base + offset;

Expand Down
6 changes: 3 additions & 3 deletions src/gui/Src/BasicView/AbstractStdTable.h
Expand Up @@ -27,14 +27,14 @@ class AbstractStdTable : public AbstractTableView
void expandTop();
void expandBottom();
void setSingleSelection(int index);
int getInitialSelection();
QList<int> getSelection();
int getInitialSelection() const;
QList<int> getSelection() const;
void selectStart();
void selectEnd();
void selectNext();
void selectPrevious();
void selectAll();
bool isSelected(int base, int offset);
bool isSelected(int base, int offset) const;
bool scrollSelect(int offset);

// Data Management
Expand Down
22 changes: 11 additions & 11 deletions src/gui/Src/BasicView/Disassembly.cpp
Expand Up @@ -1567,22 +1567,22 @@ void Disassembly::setSingleSelection(dsint index)
emit selectionChanged(rvaToVa(index));
}

dsint Disassembly::getInitialSelection()
dsint Disassembly::getInitialSelection() const
{
return mSelection.firstSelectedIndex;
}

dsint Disassembly::getSelectionSize()
dsint Disassembly::getSelectionSize() const
{
return mSelection.toIndex - mSelection.fromIndex + 1;
}

dsint Disassembly::getSelectionStart()
dsint Disassembly::getSelectionStart() const
{
return mSelection.fromIndex;
}

dsint Disassembly::getSelectionEnd()
dsint Disassembly::getSelectionEnd() const
{
return mSelection.toIndex;
}
Expand Down Expand Up @@ -1670,7 +1670,7 @@ bool Disassembly::isSelected(dsint base, dsint offset)
return false;
}

bool Disassembly::isSelected(QList<Instruction_t>* buffer, int index)
bool Disassembly::isSelected(QList<Instruction_t>* buffer, int index) const
{
if(buffer->size() > 0 && index >= 0 && index < buffer->size())
{
Expand All @@ -1685,7 +1685,7 @@ bool Disassembly::isSelected(QList<Instruction_t>* buffer, int index)
}
}

duint Disassembly::getSelectedVa()
duint Disassembly::getSelectedVa() const
{
// Wrapper around commonly used code:
// Converts the selected index to a valid virtual address
Expand Down Expand Up @@ -2010,12 +2010,12 @@ const duint Disassembly::getBase() const
return mMemPage->getBase();
}

duint Disassembly::getSize()
duint Disassembly::getSize() const
{
return mMemPage->getSize();
}

duint Disassembly::getTableOffsetRva()
duint Disassembly::getTableOffsetRva() const
{
return mInstBuffer.size() ? mInstBuffer.at(0).rva : 0;
}
Expand Down Expand Up @@ -2056,14 +2056,14 @@ void Disassembly::historyNext()
GuiUpdateAllViews();
}

bool Disassembly::historyHasPrevious()
bool Disassembly::historyHasPrevious() const
{
if(!mCurrentVa || !mVaHistory.size()) //we are at the earliest history entry
return false;
return true;
}

bool Disassembly::historyHasNext()
bool Disassembly::historyHasNext() const
{
int size = mVaHistory.size();
if(!size || mCurrentVa >= mVaHistory.size() - 1) //we are at the newest history entry
Expand Down Expand Up @@ -2164,7 +2164,7 @@ bool Disassembly::hightlightToken(const CapstoneTokenizer::SingleToken & token)
return true;
}

bool Disassembly::isHighlightMode()
bool Disassembly::isHighlightMode() const
{
return mHighlightingMode;
}
22 changes: 11 additions & 11 deletions src/gui/Src/BasicView/Disassembly.h
Expand Up @@ -61,15 +61,15 @@ class Disassembly : public AbstractTableView
// Selection Management
void expandSelectionUpTo(dsint to);
void setSingleSelection(dsint index);
dsint getInitialSelection();
dsint getSelectionSize();
dsint getSelectionStart();
dsint getSelectionEnd();
dsint getInitialSelection() const;
dsint getSelectionSize() const;
dsint getSelectionStart() const;
dsint getSelectionEnd() const;
void selectNext(bool expand);
void selectPrevious(bool expand);
bool isSelected(dsint base, dsint offset);
bool isSelected(QList<Instruction_t>* buffer, int index);
duint getSelectedVa();
bool isSelected(QList<Instruction_t>* buffer, int index) const;
duint getSelectedVa() const;

// Update/Reload/Refresh/Repaint
void prepareData() override;
Expand All @@ -79,15 +79,15 @@ class Disassembly : public AbstractTableView
duint rvaToVa(dsint rva) const;
void disassembleClear();
const duint getBase() const;
duint getSize();
duint getTableOffsetRva();
duint getSize() const;
duint getTableOffsetRva() const;

// history management
void historyClear();
void historyPrevious();
void historyNext();
bool historyHasPrevious();
bool historyHasNext();
bool historyHasPrevious() const;
bool historyHasNext() const;

//disassemble
void disassembleAt(dsint parVA, dsint parCIP, bool history, dsint newTableOffset);
Expand All @@ -106,7 +106,7 @@ class Disassembly : public AbstractTableView
void unfold(dsint rva);
void ShowDisassemblyPopup(duint addr, int x, int y);
bool hightlightToken(const CapstoneTokenizer::SingleToken & token);
bool isHighlightMode();
bool isHighlightMode() const;

signals:
void selectionChanged(dsint parVA);
Expand Down

0 comments on commit 80c303d

Please sign in to comment.