GUI: Replacing uint_t and int_t
This commit is contained in:
parent
b48fd41967
commit
33dea5d705
|
@ -460,7 +460,7 @@ void AbstractTableView::keyPressEvent(QKeyEvent* event)
|
|||
*/
|
||||
void AbstractTableView::vertSliderActionSlot(int action)
|
||||
{
|
||||
int_t wDelta = 0;
|
||||
dsint wDelta = 0;
|
||||
int wSliderPos = verticalScrollBar()->sliderPosition();
|
||||
int wNewScrollBarValue;
|
||||
|
||||
|
@ -531,11 +531,11 @@ void AbstractTableView::vertSliderActionSlot(int action)
|
|||
*
|
||||
* @return Return the value of the new table offset.
|
||||
*/
|
||||
int_t AbstractTableView::sliderMovedHook(int type, int_t value, int_t delta)
|
||||
dsint AbstractTableView::sliderMovedHook(int type, dsint value, dsint delta)
|
||||
{
|
||||
Q_UNUSED(type);
|
||||
int_t wValue = value + delta;
|
||||
int_t wMax = getRowCount() - getViewableRowsCount() + 1;
|
||||
dsint wValue = value + delta;
|
||||
dsint wMax = getRowCount() - getViewableRowsCount() + 1;
|
||||
|
||||
// Bounding
|
||||
wValue = wValue > wMax ? wMax : wValue;
|
||||
|
@ -553,17 +553,17 @@ int_t AbstractTableView::sliderMovedHook(int type, int_t value, int_t delta)
|
|||
* @return 32bits integer.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
int AbstractTableView::scaleFromUint64ToScrollBarRange(int_t value)
|
||||
int AbstractTableView::scaleFromUint64ToScrollBarRange(dsint value)
|
||||
{
|
||||
if(mScrollBarAttributes.is64 == true)
|
||||
{
|
||||
int_t wValue = ((int_t)value) >> mScrollBarAttributes.rightShiftCount;
|
||||
int_t wValueMax = ((int_t)getRowCount() - 1) >> mScrollBarAttributes.rightShiftCount;
|
||||
dsint wValue = ((dsint)value) >> mScrollBarAttributes.rightShiftCount;
|
||||
dsint wValueMax = ((dsint)getRowCount() - 1) >> mScrollBarAttributes.rightShiftCount;
|
||||
|
||||
if(value == ((int_t)getRowCount() - 1))
|
||||
if(value == ((dsint)getRowCount() - 1))
|
||||
return (int)(verticalScrollBar()->maximum());
|
||||
else
|
||||
return (int)((int_t)((int_t)verticalScrollBar()->maximum() * (int_t)wValue) / (int_t)wValueMax);
|
||||
return (int)((dsint)((dsint)verticalScrollBar()->maximum() * (dsint)wValue) / (dsint)wValueMax);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -581,20 +581,20 @@ int AbstractTableView::scaleFromUint64ToScrollBarRange(int_t value)
|
|||
* @return 64bits integer.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
int_t AbstractTableView::scaleFromScrollBarRangeToUint64(int value)
|
||||
dsint AbstractTableView::scaleFromScrollBarRangeToUint64(int value)
|
||||
{
|
||||
if(mScrollBarAttributes.is64 == true)
|
||||
{
|
||||
int_t wValueMax = ((int_t)getRowCount() - 1) >> mScrollBarAttributes.rightShiftCount;
|
||||
dsint wValueMax = ((dsint)getRowCount() - 1) >> mScrollBarAttributes.rightShiftCount;
|
||||
|
||||
if(value == (int)0x7FFFFFFF)
|
||||
return (int_t)(getRowCount() - 1);
|
||||
return (dsint)(getRowCount() - 1);
|
||||
else
|
||||
return (int_t)(((int_t)((int_t)wValueMax * (int_t)value) / (int_t)0x7FFFFFFF) << mScrollBarAttributes.rightShiftCount);
|
||||
return (dsint)(((dsint)((dsint)wValueMax * (dsint)value) / (dsint)0x7FFFFFFF) << mScrollBarAttributes.rightShiftCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (int_t)value;
|
||||
return (dsint)value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -607,14 +607,14 @@ int_t AbstractTableView::scaleFromScrollBarRangeToUint64(int value)
|
|||
*
|
||||
* @return 32bits integer.
|
||||
*/
|
||||
void AbstractTableView::updateScrollBarRange(int_t range)
|
||||
void AbstractTableView::updateScrollBarRange(dsint range)
|
||||
{
|
||||
int_t wMax = range - getViewableRowsCount() + 1;
|
||||
dsint wMax = range - getViewableRowsCount() + 1;
|
||||
|
||||
if(wMax > 0)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
if((uint_t)wMax < (uint_t)0x0000000080000000)
|
||||
if((duint)wMax < (duint)0x0000000080000000)
|
||||
{
|
||||
mScrollBarAttributes.is64 = false;
|
||||
mScrollBarAttributes.rightShiftCount = 0;
|
||||
|
@ -622,13 +622,13 @@ void AbstractTableView::updateScrollBarRange(int_t range)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint_t wMask = 0x8000000000000000;
|
||||
duint wMask = 0x8000000000000000;
|
||||
int wLeadingZeroCount;
|
||||
|
||||
// Count leading zeros
|
||||
for(wLeadingZeroCount = 0; wLeadingZeroCount < 64; wLeadingZeroCount++)
|
||||
{
|
||||
if((uint_t)wMax < wMask)
|
||||
if((duint)wMax < wMask)
|
||||
{
|
||||
wMask = wMask >> 1;
|
||||
}
|
||||
|
@ -760,8 +760,8 @@ int AbstractTableView::getViewableRowsCount()
|
|||
int AbstractTableView::getLineToPrintcount()
|
||||
{
|
||||
int wViewableRowsCount = getViewableRowsCount();
|
||||
int_t wRemainingRowsCount = getRowCount() - mTableOffset;
|
||||
int wCount = (int_t)wRemainingRowsCount > (int_t)wViewableRowsCount ? (int)wViewableRowsCount : (int)wRemainingRowsCount;
|
||||
dsint wRemainingRowsCount = getRowCount() - mTableOffset;
|
||||
int wCount = (dsint)wRemainingRowsCount > (dsint)wViewableRowsCount ? (int)wViewableRowsCount : (int)wRemainingRowsCount;
|
||||
return wCount;
|
||||
}
|
||||
|
||||
|
@ -794,7 +794,7 @@ void AbstractTableView::addColumnAt(int width, QString title, bool isClickable)
|
|||
mColumnList.append(wColumn);
|
||||
}
|
||||
|
||||
void AbstractTableView::setRowCount(int_t count)
|
||||
void AbstractTableView::setRowCount(dsint count)
|
||||
{
|
||||
updateScrollBarRange(count);
|
||||
mRowCount = count;
|
||||
|
@ -825,7 +825,7 @@ QString AbstractTableView::getColTitle(int index)
|
|||
/************************************************************************************
|
||||
Getter & Setter
|
||||
************************************************************************************/
|
||||
int_t AbstractTableView::getRowCount()
|
||||
dsint AbstractTableView::getRowCount()
|
||||
{
|
||||
return mRowCount;
|
||||
}
|
||||
|
@ -906,15 +906,15 @@ int AbstractTableView::getCharWidth()
|
|||
/************************************************************************************
|
||||
Table Offset Management
|
||||
************************************************************************************/
|
||||
int_t AbstractTableView::getTableOffset()
|
||||
dsint AbstractTableView::getTableOffset()
|
||||
{
|
||||
return mTableOffset;
|
||||
}
|
||||
|
||||
|
||||
void AbstractTableView::setTableOffset(int_t val)
|
||||
void AbstractTableView::setTableOffset(dsint val)
|
||||
{
|
||||
int_t wMaxOffset = getRowCount() - getViewableRowsCount() + 1;
|
||||
dsint wMaxOffset = getRowCount() - getViewableRowsCount() + 1;
|
||||
wMaxOffset = wMaxOffset > 0 ? wMaxOffset : 0;
|
||||
if(val > wMaxOffset)
|
||||
return;
|
||||
|
@ -957,6 +957,6 @@ void AbstractTableView::repaint()
|
|||
void AbstractTableView::prepareData()
|
||||
{
|
||||
int wViewableRowsCount = getViewableRowsCount();
|
||||
int_t wRemainingRowsCount = getRowCount() - mTableOffset;
|
||||
mNbrOfLineToPrint = (int_t)wRemainingRowsCount > (int_t)wViewableRowsCount ? (int)wViewableRowsCount : (int)wRemainingRowsCount;
|
||||
dsint wRemainingRowsCount = getRowCount() - mTableOffset;
|
||||
mNbrOfLineToPrint = (dsint)wRemainingRowsCount > (dsint)wViewableRowsCount ? (int)wViewableRowsCount : (int)wRemainingRowsCount;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual void fontsUpdated();
|
||||
|
||||
// Pure Virtual Methods
|
||||
virtual QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h) = 0;
|
||||
virtual QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h) = 0;
|
||||
|
||||
// Painting Stuff
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
@ -62,10 +62,10 @@ public:
|
|||
void keyPressEvent(QKeyEvent* event);
|
||||
|
||||
// ScrollBar Management
|
||||
virtual int_t sliderMovedHook(int type, int_t value, int_t delta);
|
||||
int scaleFromUint64ToScrollBarRange(int_t value);
|
||||
int_t scaleFromScrollBarRangeToUint64(int value);
|
||||
void updateScrollBarRange(int_t range);
|
||||
virtual dsint sliderMovedHook(int type, dsint value, dsint delta);
|
||||
int scaleFromUint64ToScrollBarRange(dsint value);
|
||||
dsint scaleFromScrollBarRangeToUint64(int value);
|
||||
void updateScrollBarRange(dsint range);
|
||||
|
||||
|
||||
// Coordinates Utils
|
||||
|
@ -78,13 +78,13 @@ public:
|
|||
|
||||
// New Columns/New Size
|
||||
virtual void addColumnAt(int width, QString title, bool isClickable);
|
||||
virtual void setRowCount(int_t count);
|
||||
virtual void setRowCount(dsint count);
|
||||
virtual void deleteAllColumns();
|
||||
void setColTitle(int index, QString title);
|
||||
QString getColTitle(int index);
|
||||
|
||||
// Getter & Setter
|
||||
int_t getRowCount();
|
||||
dsint getRowCount();
|
||||
int getColumnCount();
|
||||
int getRowHeight();
|
||||
int getColumnWidth(int index);
|
||||
|
@ -98,8 +98,8 @@ public:
|
|||
int getCharWidth();
|
||||
|
||||
// Table Offset Management
|
||||
int_t getTableOffset();
|
||||
void setTableOffset(int_t val);
|
||||
dsint getTableOffset();
|
||||
void setTableOffset(dsint val);
|
||||
|
||||
// Update/Reload/Refresh/Repaint
|
||||
virtual void prepareData();
|
||||
|
@ -108,7 +108,7 @@ signals:
|
|||
void enterPressedSignal();
|
||||
void headerButtonPressed(int col);
|
||||
void headerButtonReleased(int col);
|
||||
void tableOffsetChanged(int_t i);
|
||||
void tableOffsetChanged(dsint i);
|
||||
void viewableRows(int rows);
|
||||
void repainted();
|
||||
|
||||
|
@ -166,16 +166,16 @@ private:
|
|||
|
||||
QList<Column_t> mColumnList;
|
||||
|
||||
int_t mRowCount;
|
||||
dsint mRowCount;
|
||||
|
||||
int mMouseWheelScrollDelta;
|
||||
|
||||
int_t mTableOffset;
|
||||
dsint mTableOffset;
|
||||
Header_t mHeader;
|
||||
|
||||
int mNbrOfLineToPrint;
|
||||
|
||||
int_t mPrevTableOffset;
|
||||
dsint mPrevTableOffset;
|
||||
|
||||
bool mShouldReload;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Disassembly::Disassembly(QWidget* parent) : AbstractTableView(parent)
|
|||
|
||||
setRowCount(mMemPage->getSize());
|
||||
|
||||
addColumnAt(getCharWidth() * 2 * sizeof(int_t) + 8, "", false); //address
|
||||
addColumnAt(getCharWidth() * 2 * sizeof(dsint) + 8, "", false); //address
|
||||
addColumnAt(getCharWidth() * 2 * 12 + 8, "", false); //bytes
|
||||
addColumnAt(getCharWidth() * 40, "", false); //disassembly
|
||||
addColumnAt(1000, "", false); //comments
|
||||
|
@ -73,7 +73,7 @@ void Disassembly::fontsUpdated()
|
|||
*
|
||||
* @return String to paint.
|
||||
*/
|
||||
QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
Q_UNUSED(rowBase)
|
||||
if(mHighlightingMode)
|
||||
|
@ -85,7 +85,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
rect.adjust(1, 1, -1, -1);
|
||||
painter->drawRect(rect);
|
||||
}
|
||||
int_t wRVA = mInstBuffer.at(rowOffset).rva;
|
||||
dsint wRVA = mInstBuffer.at(rowOffset).rva;
|
||||
bool wIsSelected = isSelected(&mInstBuffer, rowOffset);
|
||||
|
||||
// Highlight if selected
|
||||
|
@ -97,7 +97,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
case 0: // Draw address (+ label)
|
||||
{
|
||||
char label[MAX_LABEL_SIZE] = "";
|
||||
int_t cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
dsint cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
QString addrText = getAddrText(cur_addr, label);
|
||||
BPXTYPE bpxtype = DbgGetBpxTypeAt(cur_addr);
|
||||
bool isbookmark = DbgGetBookmarkAt(cur_addr);
|
||||
|
@ -280,7 +280,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
case 1: //draw bytes (TODO: some spaces between bytes)
|
||||
{
|
||||
//draw functions
|
||||
int_t cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
dsint cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
Function_t funcType;
|
||||
FUNCTYPE funcFirst = DbgGetFunctionTypeAt(cur_addr);
|
||||
FUNCTYPE funcLast = DbgGetFunctionTypeAt(cur_addr + mInstBuffer.at(rowOffset).length - 1);
|
||||
|
@ -334,7 +334,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse
|
|||
|
||||
case 2: //draw disassembly (with colours needed)
|
||||
{
|
||||
int_t cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
dsint cur_addr = rvaToVa(mInstBuffer.at(rowOffset).rva);
|
||||
int loopsize = 0;
|
||||
int depth = 0;
|
||||
|
||||
|
@ -447,8 +447,8 @@ void Disassembly::mouseMoveEvent(QMouseEvent* event)
|
|||
wI = wI >= mInstBuffer.size() ? mInstBuffer.size() - 1 : wI;
|
||||
wI = wI < 0 ? 0 : wI;
|
||||
|
||||
int_t wRowIndex = mInstBuffer.at(wI).rva;
|
||||
int_t wInstrSize = getInstructionRVA(wRowIndex, 1) - wRowIndex - 1;
|
||||
dsint wRowIndex = mInstBuffer.at(wI).rva;
|
||||
dsint wInstrSize = getInstructionRVA(wRowIndex, 1) - wRowIndex - 1;
|
||||
|
||||
if(wRowIndex < getRowCount())
|
||||
{
|
||||
|
@ -521,8 +521,8 @@ void Disassembly::mousePressEvent(QMouseEvent* event)
|
|||
}
|
||||
else if(event->y() > getHeaderHeight())
|
||||
{
|
||||
int_t wRowIndex = getInstructionRVA(getTableOffset(), getIndexOffsetFromY(transY(event->y())));
|
||||
int_t wInstrSize = getInstructionRVA(wRowIndex, 1) - wRowIndex - 1;
|
||||
dsint wRowIndex = getInstructionRVA(getTableOffset(), getIndexOffsetFromY(transY(event->y())));
|
||||
dsint wInstrSize = getInstructionRVA(wRowIndex, 1) - wRowIndex - 1;
|
||||
|
||||
if(wRowIndex < getRowCount())
|
||||
{
|
||||
|
@ -600,8 +600,8 @@ void Disassembly::keyPressEvent(QKeyEvent* event)
|
|||
|
||||
if(key == Qt::Key_Up || key == Qt::Key_Down)
|
||||
{
|
||||
int_t botRVA = getTableOffset();
|
||||
int_t topRVA = getInstructionRVA(getTableOffset(), getNbrOfLineToPrint() - 1);
|
||||
dsint botRVA = getTableOffset();
|
||||
dsint topRVA = getInstructionRVA(getTableOffset(), getNbrOfLineToPrint() - 1);
|
||||
|
||||
bool expand = false;
|
||||
if(event->modifiers() & Qt::ShiftModifier) //SHIFT pressed
|
||||
|
@ -625,10 +625,10 @@ void Disassembly::keyPressEvent(QKeyEvent* event)
|
|||
}
|
||||
else if(key == Qt::Key_Return || key == Qt::Key_Enter)
|
||||
{
|
||||
uint_t dest = DbgGetBranchDestination(rvaToVa(getInitialSelection()));
|
||||
duint dest = DbgGetBranchDestination(rvaToVa(getInitialSelection()));
|
||||
if(!dest)
|
||||
return;
|
||||
QString cmd = "disasm " + QString("%1").arg(dest, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString cmd = "disasm " + QString("%1").arg(dest, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(cmd.toUtf8().constData());
|
||||
}
|
||||
else
|
||||
|
@ -649,9 +649,9 @@ void Disassembly::keyPressEvent(QKeyEvent* event)
|
|||
*
|
||||
* @return Return the value of the new table offset.
|
||||
*/
|
||||
int_t Disassembly::sliderMovedHook(int type, int_t value, int_t delta)
|
||||
dsint Disassembly::sliderMovedHook(int type, dsint value, dsint delta)
|
||||
{
|
||||
int_t wNewValue;
|
||||
dsint wNewValue;
|
||||
|
||||
if(type == QAbstractSlider::SliderNoAction) // QAbstractSlider::SliderNoAction is used to disassembe at a specific address
|
||||
{
|
||||
|
@ -689,10 +689,10 @@ int_t Disassembly::sliderMovedHook(int type, int_t value, int_t delta)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, int_t addr)
|
||||
int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, dsint addr)
|
||||
{
|
||||
int_t selHeadRVA = mSelection.fromIndex;
|
||||
int_t rva = addr;
|
||||
dsint selHeadRVA = mSelection.fromIndex;
|
||||
dsint rva = addr;
|
||||
Instruction_t instruction = DisassembleAt(selHeadRVA);
|
||||
Int32 branchType = instruction.disasm.Instruction.BranchType;
|
||||
|
||||
|
@ -700,12 +700,12 @@ int Disassembly::paintJumpsGraphic(QPainter* painter, int x, int y, int_t addr)
|
|||
|
||||
if(branchType && branchType != RetType && branchType != CallType)
|
||||
{
|
||||
int_t destRVA = (int_t)DbgGetBranchDestination(rvaToVa(instruction.rva));
|
||||
dsint destRVA = (dsint)DbgGetBranchDestination(rvaToVa(instruction.rva));
|
||||
|
||||
int_t base = mMemPage->getBase();
|
||||
if(destRVA >= base && destRVA < base + (int_t)mMemPage->getSize())
|
||||
dsint base = mMemPage->getBase();
|
||||
if(destRVA >= base && destRVA < base + (dsint)mMemPage->getSize())
|
||||
{
|
||||
destRVA -= (int_t)mMemPage->getBase();
|
||||
destRVA -= (dsint)mMemPage->getBase();
|
||||
|
||||
if(destRVA < selHeadRVA)
|
||||
{
|
||||
|
@ -889,24 +889,24 @@ int Disassembly::paintFunctionGraphic(QPainter* painter, int x, int y, Function_
|
|||
*
|
||||
* @return RVA of count-th instructions before the given instruction RVA.
|
||||
*/
|
||||
int_t Disassembly::getPreviousInstructionRVA(int_t rva, uint_t count)
|
||||
dsint Disassembly::getPreviousInstructionRVA(dsint rva, duint count)
|
||||
{
|
||||
QByteArray wBuffer;
|
||||
int_t wBottomByteRealRVA;
|
||||
int_t wVirtualRVA;
|
||||
int_t wMaxByteCountToRead ;
|
||||
dsint wBottomByteRealRVA;
|
||||
dsint wVirtualRVA;
|
||||
dsint wMaxByteCountToRead ;
|
||||
|
||||
wBottomByteRealRVA = (int_t)rva - 16 * (count + 3);
|
||||
wBottomByteRealRVA = (dsint)rva - 16 * (count + 3);
|
||||
wBottomByteRealRVA = wBottomByteRealRVA < 0 ? 0 : wBottomByteRealRVA;
|
||||
|
||||
wVirtualRVA = (int_t)rva - wBottomByteRealRVA;
|
||||
wVirtualRVA = (dsint)rva - wBottomByteRealRVA;
|
||||
|
||||
wMaxByteCountToRead = wVirtualRVA + 1 + 16;
|
||||
wBuffer.resize(wMaxByteCountToRead);
|
||||
|
||||
mMemPage->read(reinterpret_cast<byte_t*>(wBuffer.data()), wBottomByteRealRVA, wMaxByteCountToRead);
|
||||
|
||||
int_t addr = mDisasm->DisassembleBack(reinterpret_cast<byte_t*>(wBuffer.data()), 0, wMaxByteCountToRead, wVirtualRVA, count);
|
||||
dsint addr = mDisasm->DisassembleBack(reinterpret_cast<byte_t*>(wBuffer.data()), 0, wMaxByteCountToRead, wVirtualRVA, count);
|
||||
|
||||
addr += rva - wVirtualRVA;
|
||||
|
||||
|
@ -922,15 +922,15 @@ int_t Disassembly::getPreviousInstructionRVA(int_t rva, uint_t count)
|
|||
*
|
||||
* @return RVA of count-th instructions after the given instruction RVA.
|
||||
*/
|
||||
int_t Disassembly::getNextInstructionRVA(int_t rva, uint_t count)
|
||||
dsint Disassembly::getNextInstructionRVA(dsint rva, duint count)
|
||||
{
|
||||
QByteArray wBuffer;
|
||||
int_t wVirtualRVA = 0;
|
||||
int_t wRemainingBytes;
|
||||
int_t wMaxByteCountToRead;
|
||||
int_t wNewRVA;
|
||||
dsint wVirtualRVA = 0;
|
||||
dsint wRemainingBytes;
|
||||
dsint wMaxByteCountToRead;
|
||||
dsint wNewRVA;
|
||||
|
||||
if(mMemPage->getSize() < (uint_t)rva)
|
||||
if(mMemPage->getSize() < (duint)rva)
|
||||
return rva;
|
||||
wRemainingBytes = mMemPage->getSize() - rva;
|
||||
|
||||
|
@ -955,9 +955,9 @@ int_t Disassembly::getNextInstructionRVA(int_t rva, uint_t count)
|
|||
*
|
||||
* @return RVA of count-th instructions before/after the given instruction RVA.
|
||||
*/
|
||||
int_t Disassembly::getInstructionRVA(int_t index, int_t count)
|
||||
dsint Disassembly::getInstructionRVA(dsint index, dsint count)
|
||||
{
|
||||
int_t wAddr = 0;
|
||||
dsint wAddr = 0;
|
||||
|
||||
if(count == 0)
|
||||
wAddr = index;
|
||||
|
@ -983,15 +983,15 @@ int_t Disassembly::getInstructionRVA(int_t index, int_t count)
|
|||
*
|
||||
* @return Return the disassembled instruction.
|
||||
*/
|
||||
Instruction_t Disassembly::DisassembleAt(int_t rva)
|
||||
Instruction_t Disassembly::DisassembleAt(dsint rva)
|
||||
{
|
||||
QByteArray wBuffer;
|
||||
int_t base = mMemPage->getBase();
|
||||
int_t wMaxByteCountToRead = 16 * 2;
|
||||
dsint base = mMemPage->getBase();
|
||||
dsint wMaxByteCountToRead = 16 * 2;
|
||||
|
||||
// Bounding
|
||||
//TODO: fix problems with negative sizes
|
||||
int_t size = getSize();
|
||||
dsint size = getSize();
|
||||
if(!size)
|
||||
size = rva;
|
||||
|
||||
|
@ -1014,7 +1014,7 @@ Instruction_t Disassembly::DisassembleAt(int_t rva)
|
|||
*
|
||||
* @return Return the disassembled instruction.
|
||||
*/
|
||||
Instruction_t Disassembly::DisassembleAt(int_t rva, int_t count)
|
||||
Instruction_t Disassembly::DisassembleAt(dsint rva, dsint count)
|
||||
{
|
||||
rva = getNextInstructionRVA(rva, count);
|
||||
return DisassembleAt(rva);
|
||||
|
@ -1024,7 +1024,7 @@ Instruction_t Disassembly::DisassembleAt(int_t rva, int_t count)
|
|||
/************************************************************************************
|
||||
Selection Management
|
||||
************************************************************************************/
|
||||
void Disassembly::expandSelectionUpTo(int_t to)
|
||||
void Disassembly::expandSelectionUpTo(dsint to)
|
||||
{
|
||||
if(to < mSelection.firstSelectedIndex)
|
||||
{
|
||||
|
@ -1040,7 +1040,7 @@ void Disassembly::expandSelectionUpTo(int_t to)
|
|||
}
|
||||
}
|
||||
|
||||
void Disassembly::setSingleSelection(int_t index)
|
||||
void Disassembly::setSingleSelection(dsint index)
|
||||
{
|
||||
mSelection.firstSelectedIndex = index;
|
||||
mSelection.fromIndex = index;
|
||||
|
@ -1049,30 +1049,30 @@ void Disassembly::setSingleSelection(int_t index)
|
|||
}
|
||||
|
||||
|
||||
int_t Disassembly::getInitialSelection()
|
||||
dsint Disassembly::getInitialSelection()
|
||||
{
|
||||
return mSelection.firstSelectedIndex;
|
||||
}
|
||||
|
||||
int_t Disassembly::getSelectionSize()
|
||||
dsint Disassembly::getSelectionSize()
|
||||
{
|
||||
return mSelection.toIndex - mSelection.fromIndex;
|
||||
}
|
||||
|
||||
int_t Disassembly::getSelectionStart()
|
||||
dsint Disassembly::getSelectionStart()
|
||||
{
|
||||
return mSelection.fromIndex;
|
||||
}
|
||||
|
||||
int_t Disassembly::getSelectionEnd()
|
||||
dsint Disassembly::getSelectionEnd()
|
||||
{
|
||||
return mSelection.toIndex;
|
||||
}
|
||||
|
||||
void Disassembly::selectNext(bool expand)
|
||||
{
|
||||
int_t wAddr;
|
||||
int_t wStart = getInstructionRVA(getSelectionStart(), 1) - 1;
|
||||
dsint wAddr;
|
||||
dsint wStart = getInstructionRVA(getSelectionStart(), 1) - 1;
|
||||
if(expand)
|
||||
{
|
||||
if(getSelectionEnd() == getInitialSelection() && wStart != getSelectionEnd()) //decrease down
|
||||
|
@ -1083,7 +1083,7 @@ void Disassembly::selectNext(bool expand)
|
|||
else //expand down
|
||||
{
|
||||
wAddr = getSelectionEnd() + 1;
|
||||
int_t wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
expandSelectionUpTo(wAddr + wInstrSize);
|
||||
}
|
||||
}
|
||||
|
@ -1091,7 +1091,7 @@ void Disassembly::selectNext(bool expand)
|
|||
{
|
||||
wAddr = getSelectionEnd() + 1;
|
||||
setSingleSelection(wAddr);
|
||||
int_t wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
expandSelectionUpTo(wAddr + wInstrSize);
|
||||
}
|
||||
}
|
||||
|
@ -1099,14 +1099,14 @@ void Disassembly::selectNext(bool expand)
|
|||
|
||||
void Disassembly::selectPrevious(bool expand)
|
||||
{
|
||||
int_t wAddr;
|
||||
int_t wStart = getInstructionRVA(getSelectionStart(), 1) - 1;
|
||||
dsint wAddr;
|
||||
dsint wStart = getInstructionRVA(getSelectionStart(), 1) - 1;
|
||||
if(expand)
|
||||
{
|
||||
if(getSelectionStart() == getInitialSelection() && wStart != getSelectionEnd()) //decrease up
|
||||
{
|
||||
wAddr = getInstructionRVA(getSelectionEnd() + 1, -2);
|
||||
int_t wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
expandSelectionUpTo(wAddr + wInstrSize);
|
||||
}
|
||||
else //expand up
|
||||
|
@ -1119,15 +1119,15 @@ void Disassembly::selectPrevious(bool expand)
|
|||
{
|
||||
wAddr = getInstructionRVA(getSelectionStart(), -1);
|
||||
setSingleSelection(wAddr);
|
||||
int_t wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wAddr, 1) - wAddr - 1;
|
||||
expandSelectionUpTo(wAddr + wInstrSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Disassembly::isSelected(int_t base, int_t offset)
|
||||
bool Disassembly::isSelected(dsint base, dsint offset)
|
||||
{
|
||||
int_t wAddr = base;
|
||||
dsint wAddr = base;
|
||||
|
||||
if(offset < 0)
|
||||
wAddr = getPreviousInstructionRVA(getTableOffset(), offset);
|
||||
|
@ -1145,7 +1145,7 @@ bool Disassembly::isSelected(QList<Instruction_t>* buffer, int index)
|
|||
{
|
||||
if(buffer->size() > 0 && index >= 0 && index < buffer->size())
|
||||
{
|
||||
if((int_t)buffer->at(index).rva >= mSelection.fromIndex && (int_t)buffer->at(index).rva <= mSelection.toIndex)
|
||||
if((dsint)buffer->at(index).rva >= mSelection.fromIndex && (dsint)buffer->at(index).rva <= mSelection.toIndex)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
@ -1161,7 +1161,7 @@ bool Disassembly::isSelected(QList<Instruction_t>* buffer, int index)
|
|||
Update/Reload/Refresh/Repaint
|
||||
************************************************************************************/
|
||||
|
||||
void Disassembly::prepareDataCount(int_t wRVA, int wCount, QList<Instruction_t>* instBuffer)
|
||||
void Disassembly::prepareDataCount(dsint wRVA, int wCount, QList<Instruction_t>* instBuffer)
|
||||
{
|
||||
instBuffer->clear();
|
||||
Instruction_t wInst;
|
||||
|
@ -1173,14 +1173,14 @@ void Disassembly::prepareDataCount(int_t wRVA, int wCount, QList<Instruction_t>*
|
|||
}
|
||||
}
|
||||
|
||||
void Disassembly::prepareDataRange(int_t startRva, int_t endRva, QList<Instruction_t>* instBuffer)
|
||||
void Disassembly::prepareDataRange(dsint startRva, dsint endRva, QList<Instruction_t>* instBuffer)
|
||||
{
|
||||
if(startRva == endRva)
|
||||
prepareDataCount(startRva, 1, instBuffer);
|
||||
else
|
||||
{
|
||||
int wCount = 0;
|
||||
int_t addr = startRva;
|
||||
dsint addr = startRva;
|
||||
while(addr <= endRva)
|
||||
{
|
||||
addr = getNextInstructionRVA(addr, 1);
|
||||
|
@ -1192,10 +1192,10 @@ void Disassembly::prepareDataRange(int_t startRva, int_t endRva, QList<Instructi
|
|||
|
||||
void Disassembly::prepareData()
|
||||
{
|
||||
int_t wViewableRowsCount = getViewableRowsCount();
|
||||
dsint wViewableRowsCount = getViewableRowsCount();
|
||||
|
||||
int_t wAddrPrev = getTableOffset();
|
||||
int_t wAddr = wAddrPrev;
|
||||
dsint wAddrPrev = getTableOffset();
|
||||
dsint wAddr = wAddrPrev;
|
||||
|
||||
int wCount = 0;
|
||||
|
||||
|
@ -1227,19 +1227,19 @@ void Disassembly::reloadData()
|
|||
/************************************************************************************
|
||||
Public Methods
|
||||
************************************************************************************/
|
||||
uint_t Disassembly::rvaToVa(int_t rva)
|
||||
duint Disassembly::rvaToVa(dsint rva)
|
||||
{
|
||||
return mMemPage->va(rva);
|
||||
}
|
||||
|
||||
void Disassembly::disassembleAt(int_t parVA, int_t parCIP, bool history, int_t newTableOffset)
|
||||
void Disassembly::disassembleAt(dsint parVA, dsint parCIP, bool history, dsint newTableOffset)
|
||||
{
|
||||
int_t wBase = DbgMemFindBaseAddr(parVA, 0);
|
||||
int_t wSize = DbgMemGetPageSize(wBase);
|
||||
dsint wBase = DbgMemFindBaseAddr(parVA, 0);
|
||||
dsint wSize = DbgMemGetPageSize(wBase);
|
||||
if(!wBase || !wSize)
|
||||
return;
|
||||
int_t wRVA = parVA - wBase;
|
||||
int_t wCipRva = parCIP - wBase;
|
||||
dsint wRVA = parVA - wBase;
|
||||
dsint wCipRva = parCIP - wBase;
|
||||
|
||||
HistoryData_t newHistory;
|
||||
|
||||
|
@ -1253,8 +1253,8 @@ void Disassembly::disassembleAt(int_t parVA, int_t parCIP, bool history, int_t n
|
|||
//NOTE: mCurrentVa always points to the last entry of the list
|
||||
|
||||
//add the currently selected address to the history
|
||||
int_t selectionVA = rvaToVa(getInitialSelection()); //currently selected VA
|
||||
int_t selectionTableOffset = getTableOffset();
|
||||
dsint selectionVA = rvaToVa(getInitialSelection()); //currently selected VA
|
||||
dsint selectionTableOffset = getTableOffset();
|
||||
if(selectionVA && mVaHistory.size() && mVaHistory.last().va != selectionVA) //do not have 2x the same va in a row
|
||||
{
|
||||
if(mVaHistory.size() >= 1024) //max 1024 in the history
|
||||
|
@ -1278,7 +1278,7 @@ void Disassembly::disassembleAt(int_t parVA, int_t parCIP, bool history, int_t n
|
|||
setRowCount(wSize);
|
||||
|
||||
setSingleSelection(wRVA); // Selects disassembled instruction
|
||||
int_t wInstrSize = getInstructionRVA(wRVA, 1) - wRVA - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wRVA, 1) - wRVA - 1;
|
||||
expandSelectionUpTo(wRVA + wInstrSize);
|
||||
|
||||
//set CIP rva
|
||||
|
@ -1287,7 +1287,7 @@ void Disassembly::disassembleAt(int_t parVA, int_t parCIP, bool history, int_t n
|
|||
if(newTableOffset == -1) //nothing specified
|
||||
{
|
||||
// Update table offset depending on the location of the instruction to disassemble
|
||||
if(mInstBuffer.size() > 0 && wRVA >= (int_t)mInstBuffer.first().rva && wRVA < (int_t)mInstBuffer.last().rva)
|
||||
if(mInstBuffer.size() > 0 && wRVA >= (dsint)mInstBuffer.first().rva && wRVA < (dsint)mInstBuffer.last().rva)
|
||||
{
|
||||
int wI;
|
||||
bool wIsAligned = false;
|
||||
|
@ -1311,7 +1311,7 @@ void Disassembly::disassembleAt(int_t parVA, int_t parCIP, bool history, int_t n
|
|||
setTableOffset(wRVA);
|
||||
}
|
||||
}
|
||||
else if(mInstBuffer.size() > 0 && wRVA == (int_t)mInstBuffer.last().rva)
|
||||
else if(mInstBuffer.size() > 0 && wRVA == (dsint)mInstBuffer.last().rva)
|
||||
{
|
||||
setTableOffset(mInstBuffer.first().rva + mInstBuffer.first().length);
|
||||
}
|
||||
|
@ -1365,13 +1365,13 @@ QList<Instruction_t>* Disassembly::instructionsBuffer()
|
|||
return &mInstBuffer;
|
||||
}
|
||||
|
||||
const int_t Disassembly::currentEIP() const
|
||||
const dsint Disassembly::currentEIP() const
|
||||
{
|
||||
return mCipRva;
|
||||
}
|
||||
|
||||
|
||||
void Disassembly::disassembleAt(int_t parVA, int_t parCIP)
|
||||
void Disassembly::disassembleAt(dsint parVA, dsint parCIP)
|
||||
{
|
||||
disassembleAt(parVA, parCIP, true, -1);
|
||||
}
|
||||
|
@ -1407,12 +1407,12 @@ void Disassembly::debugStateChangedSlot(DBGSTATE state)
|
|||
}
|
||||
}
|
||||
|
||||
const int_t Disassembly::getBase() const
|
||||
const dsint Disassembly::getBase() const
|
||||
{
|
||||
return mMemPage->getBase();
|
||||
}
|
||||
|
||||
int_t Disassembly::getSize()
|
||||
dsint Disassembly::getSize()
|
||||
{
|
||||
return mMemPage->getSize();
|
||||
}
|
||||
|
@ -1455,12 +1455,12 @@ bool Disassembly::historyHasNext()
|
|||
return true;
|
||||
}
|
||||
|
||||
QString Disassembly::getAddrText(int_t cur_addr, char label[MAX_LABEL_SIZE])
|
||||
QString Disassembly::getAddrText(dsint cur_addr, char label[MAX_LABEL_SIZE])
|
||||
{
|
||||
QString addrText = "";
|
||||
if(mRvaDisplayEnabled) //RVA display
|
||||
{
|
||||
int_t rva = cur_addr - mRvaDisplayBase;
|
||||
dsint rva = cur_addr - mRvaDisplayBase;
|
||||
if(rva == 0)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
void fontsUpdated();
|
||||
|
||||
// Reimplemented Functions
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
|
||||
// Mouse Management
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
|
@ -25,10 +25,10 @@ public:
|
|||
void keyPressEvent(QKeyEvent* event);
|
||||
|
||||
// ScrollBar Management
|
||||
int_t sliderMovedHook(int type, int_t value, int_t delta);
|
||||
dsint sliderMovedHook(int type, dsint value, dsint delta);
|
||||
|
||||
// Jumps Graphic
|
||||
int paintJumpsGraphic(QPainter* painter, int x, int y, int_t addr);
|
||||
int paintJumpsGraphic(QPainter* painter, int x, int y, dsint addr);
|
||||
|
||||
// Function Graphic
|
||||
|
||||
|
@ -45,22 +45,22 @@ public:
|
|||
int paintFunctionGraphic(QPainter* painter, int x, int y, Function_t funcType, bool loop);
|
||||
|
||||
// Instructions Management
|
||||
int_t getPreviousInstructionRVA(int_t rva, uint_t count);
|
||||
int_t getNextInstructionRVA(int_t rva, uint_t count);
|
||||
int_t getInstructionRVA(int_t index, int_t count);
|
||||
Instruction_t DisassembleAt(int_t rva);
|
||||
Instruction_t DisassembleAt(int_t rva, int_t count);
|
||||
dsint getPreviousInstructionRVA(dsint rva, duint count);
|
||||
dsint getNextInstructionRVA(dsint rva, duint count);
|
||||
dsint getInstructionRVA(dsint index, dsint count);
|
||||
Instruction_t DisassembleAt(dsint rva);
|
||||
Instruction_t DisassembleAt(dsint rva, dsint count);
|
||||
|
||||
// Selection Management
|
||||
void expandSelectionUpTo(int_t to);
|
||||
void setSingleSelection(int_t index);
|
||||
int_t getInitialSelection();
|
||||
int_t getSelectionSize();
|
||||
int_t getSelectionStart();
|
||||
int_t getSelectionEnd();
|
||||
void expandSelectionUpTo(dsint to);
|
||||
void setSingleSelection(dsint index);
|
||||
dsint getInitialSelection();
|
||||
dsint getSelectionSize();
|
||||
dsint getSelectionStart();
|
||||
dsint getSelectionEnd();
|
||||
void selectNext(bool expand);
|
||||
void selectPrevious(bool expand);
|
||||
bool isSelected(int_t base, int_t offset);
|
||||
bool isSelected(dsint base, dsint offset);
|
||||
bool isSelected(QList<Instruction_t>* buffer, int index);
|
||||
|
||||
// Update/Reload/Refresh/Repaint
|
||||
|
@ -68,10 +68,10 @@ public:
|
|||
void reloadData();
|
||||
|
||||
// Public Methods
|
||||
uint_t rvaToVa(int_t rva);
|
||||
duint rvaToVa(dsint rva);
|
||||
void disassembleClear();
|
||||
const int_t getBase() const;
|
||||
int_t getSize();
|
||||
const dsint getBase() const;
|
||||
dsint getSize();
|
||||
|
||||
// history management
|
||||
void historyClear();
|
||||
|
@ -81,22 +81,22 @@ public:
|
|||
bool historyHasNext();
|
||||
|
||||
//disassemble
|
||||
void disassembleAt(int_t parVA, int_t parCIP, bool history, int_t newTableOffset);
|
||||
void disassembleAt(dsint parVA, dsint parCIP, bool history, dsint newTableOffset);
|
||||
|
||||
QList<Instruction_t>* instructionsBuffer();
|
||||
const int_t baseAddress() const;
|
||||
const int_t currentEIP() const;
|
||||
const dsint baseAddress() const;
|
||||
const dsint currentEIP() const;
|
||||
|
||||
QString getAddrText(int_t cur_addr, char label[MAX_LABEL_SIZE]);
|
||||
void prepareDataCount(int_t wRVA, int wCount, QList<Instruction_t>* instBuffer);
|
||||
void prepareDataRange(int_t startRva, int_t endRva, QList<Instruction_t>* instBuffer);
|
||||
QString getAddrText(dsint cur_addr, char label[MAX_LABEL_SIZE]);
|
||||
void prepareDataCount(dsint wRVA, int wCount, QList<Instruction_t>* instBuffer);
|
||||
void prepareDataRange(dsint startRva, dsint endRva, QList<Instruction_t>* instBuffer);
|
||||
|
||||
signals:
|
||||
void selectionChanged(int_t parVA);
|
||||
void disassembledAt(int_t parVA, int_t parCIP, bool history, int_t newTableOffset);
|
||||
void selectionChanged(dsint parVA);
|
||||
void disassembledAt(dsint parVA, dsint parCIP, bool history, dsint newTableOffset);
|
||||
|
||||
public slots:
|
||||
void disassembleAt(int_t parVA, int_t parCIP);
|
||||
void disassembleAt(dsint parVA, dsint parCIP);
|
||||
void debugStateChangedSlot(DBGSTATE state);
|
||||
|
||||
private:
|
||||
|
@ -105,9 +105,9 @@ private:
|
|||
|
||||
typedef struct _SelectionData_t
|
||||
{
|
||||
int_t firstSelectedIndex;
|
||||
int_t fromIndex;
|
||||
int_t toIndex;
|
||||
dsint firstSelectedIndex;
|
||||
dsint fromIndex;
|
||||
dsint toIndex;
|
||||
} SelectionData_t;
|
||||
|
||||
QBeaEngine* mDisasm;
|
||||
|
@ -119,14 +119,14 @@ private:
|
|||
|
||||
GuiState_t mGuiState;
|
||||
|
||||
int_t mCipRva;
|
||||
dsint mCipRva;
|
||||
|
||||
QList<Instruction_t> mInstBuffer;
|
||||
|
||||
typedef struct _HistoryData_t
|
||||
{
|
||||
int_t va;
|
||||
int_t tableOffset;
|
||||
dsint va;
|
||||
dsint tableOffset;
|
||||
} HistoryData_t;
|
||||
|
||||
QList<HistoryData_t> mVaHistory;
|
||||
|
@ -135,8 +135,8 @@ private:
|
|||
|
||||
protected:
|
||||
bool mRvaDisplayEnabled;
|
||||
uint_t mRvaDisplayBase;
|
||||
int_t mRvaDisplayPageBase;
|
||||
duint mRvaDisplayBase;
|
||||
dsint mRvaDisplayPageBase;
|
||||
bool mHighlightingMode;
|
||||
MemoryPage* mMemPage;
|
||||
};
|
||||
|
|
|
@ -43,18 +43,18 @@ void HexDump::fontsUpdated()
|
|||
setFont(ConfigFont("HexDump"));
|
||||
}
|
||||
|
||||
void HexDump::printDumpAt(int_t parVA, bool select, bool repaint)
|
||||
void HexDump::printDumpAt(dsint parVA, bool select, bool repaint)
|
||||
{
|
||||
int_t wBase = DbgMemFindBaseAddr(parVA, 0); //get memory base
|
||||
int_t wSize = DbgMemGetPageSize(wBase); //get page size
|
||||
dsint wBase = DbgMemFindBaseAddr(parVA, 0); //get memory base
|
||||
dsint wSize = DbgMemGetPageSize(wBase); //get page size
|
||||
if(!wBase || !wSize)
|
||||
return;
|
||||
int_t wRVA = parVA - wBase; //calculate rva
|
||||
dsint wRVA = parVA - wBase; //calculate rva
|
||||
int wBytePerRowCount = getBytePerRowCount(); //get the number of bytes per row
|
||||
int_t wRowCount;
|
||||
dsint wRowCount;
|
||||
|
||||
// Byte offset used to be aligned on the given RVA
|
||||
mByteOffset = (int)((int_t)wRVA % (int_t)wBytePerRowCount);
|
||||
mByteOffset = (int)((dsint)wRVA % (dsint)wBytePerRowCount);
|
||||
mByteOffset = mByteOffset > 0 ? wBytePerRowCount - mByteOffset : 0;
|
||||
|
||||
// Compute row count
|
||||
|
@ -75,7 +75,7 @@ void HexDump::printDumpAt(int_t parVA, bool select, bool repaint)
|
|||
if(select)
|
||||
{
|
||||
setSingleSelection(wRVA);
|
||||
int_t wEndingAddress = wRVA + getSizeOf(mDescriptor.at(0).data.itemSize) - 1;
|
||||
dsint wEndingAddress = wRVA + getSizeOf(mDescriptor.at(0).data.itemSize) - 1;
|
||||
expandSelectionUpTo(wEndingAddress);
|
||||
}
|
||||
|
||||
|
@ -83,12 +83,12 @@ void HexDump::printDumpAt(int_t parVA, bool select, bool repaint)
|
|||
reloadData();
|
||||
}
|
||||
|
||||
void HexDump::printDumpAt(int_t parVA)
|
||||
void HexDump::printDumpAt(dsint parVA)
|
||||
{
|
||||
printDumpAt(parVA, true);
|
||||
}
|
||||
|
||||
uint_t HexDump::rvaToVa(int_t rva)
|
||||
duint HexDump::rvaToVa(dsint rva)
|
||||
{
|
||||
return mMemPage->va(rva);
|
||||
}
|
||||
|
@ -118,11 +118,11 @@ void HexDump::mouseMoveEvent(QMouseEvent* event)
|
|||
|
||||
if(wColIndex > 0) // No selection for first column (addresses)
|
||||
{
|
||||
int_t wStartingAddress = getItemStartingAddress(x, y);
|
||||
int_t dataSize = getSizeOf(mDescriptor.at(wColIndex - 1).data.itemSize) - 1;
|
||||
int_t wEndingAddress = wStartingAddress + dataSize;
|
||||
dsint wStartingAddress = getItemStartingAddress(x, y);
|
||||
dsint dataSize = getSizeOf(mDescriptor.at(wColIndex - 1).data.itemSize) - 1;
|
||||
dsint wEndingAddress = wStartingAddress + dataSize;
|
||||
|
||||
if(wEndingAddress < (int_t)mMemPage->getSize())
|
||||
if(wEndingAddress < (dsint)mMemPage->getSize())
|
||||
{
|
||||
if(wStartingAddress < getInitialSelection())
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ void HexDump::mousePressEvent(QMouseEvent* event)
|
|||
if(!DbgIsDebugging())
|
||||
return;
|
||||
MessageBeep(MB_OK);
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
Bridge::CopyToClipboard(addrText);
|
||||
return;
|
||||
}
|
||||
|
@ -182,11 +182,11 @@ void HexDump::mousePressEvent(QMouseEvent* event)
|
|||
|
||||
if(wColIndex > 0 && mDescriptor.at(wColIndex - 1).isData == true) // No selection for first column (addresses) and no data columns
|
||||
{
|
||||
int_t wStartingAddress = getItemStartingAddress(x, y);
|
||||
int_t dataSize = getSizeOf(mDescriptor.at(wColIndex - 1).data.itemSize) - 1;
|
||||
int_t wEndingAddress = wStartingAddress + dataSize;
|
||||
dsint wStartingAddress = getItemStartingAddress(x, y);
|
||||
dsint dataSize = getSizeOf(mDescriptor.at(wColIndex - 1).data.itemSize) - 1;
|
||||
dsint wEndingAddress = wStartingAddress + dataSize;
|
||||
|
||||
if(wEndingAddress < (int_t)mMemPage->getSize())
|
||||
if(wEndingAddress < (dsint)mMemPage->getSize())
|
||||
{
|
||||
bool bUpdateTo = false;
|
||||
if(!(event->modifiers() & Qt::ShiftModifier))
|
||||
|
@ -238,7 +238,7 @@ void HexDump::mouseReleaseEvent(QMouseEvent* event)
|
|||
AbstractTableView::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
QString HexDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString HexDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
// Reset byte offset when base address is reached
|
||||
if(rowBase == 0 && mByteOffset != 0)
|
||||
|
@ -246,12 +246,12 @@ QString HexDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
|
|||
|
||||
// Compute RVA
|
||||
int wBytePerRowCount = getBytePerRowCount();
|
||||
int_t wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
dsint wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
|
||||
QString wStr = "";
|
||||
if(col == 0) // Addresses
|
||||
{
|
||||
wStr += QString("%1").arg(rvaToVa(wRva), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wStr += QString("%1").arg(rvaToVa(wRva), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else if(mDescriptor.at(col - 1).isData == true) //paint data
|
||||
{
|
||||
|
@ -267,13 +267,13 @@ QString HexDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
|
|||
return wStr;
|
||||
}
|
||||
|
||||
void HexDump::printSelected(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
void HexDump::printSelected(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
if((col > 0) && ((col - 1) < mDescriptor.size()))
|
||||
{
|
||||
ColumnDescriptor_t curDescriptor = mDescriptor.at(col - 1);
|
||||
int wBytePerRowCount = getBytePerRowCount();
|
||||
int_t wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
dsint wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
int wItemPixWidth = getItemPixelWidth(curDescriptor);
|
||||
int wCharWidth = getCharWidth();
|
||||
if(wItemPixWidth == wCharWidth)
|
||||
|
@ -302,7 +302,7 @@ void HexDump::printSelected(QPainter* painter, int_t rowBase, int rowOffset, int
|
|||
/************************************************************************************
|
||||
Selection Management
|
||||
************************************************************************************/
|
||||
void HexDump::expandSelectionUpTo(int_t rva)
|
||||
void HexDump::expandSelectionUpTo(dsint rva)
|
||||
{
|
||||
if(rva < mSelection.firstSelectedIndex)
|
||||
{
|
||||
|
@ -322,7 +322,7 @@ void HexDump::expandSelectionUpTo(int_t rva)
|
|||
}
|
||||
}
|
||||
|
||||
void HexDump::setSingleSelection(int_t rva)
|
||||
void HexDump::setSingleSelection(dsint rva)
|
||||
{
|
||||
mSelection.firstSelectedIndex = rva;
|
||||
mSelection.fromIndex = rva;
|
||||
|
@ -330,22 +330,22 @@ void HexDump::setSingleSelection(int_t rva)
|
|||
emit selectionUpdated();
|
||||
}
|
||||
|
||||
int_t HexDump::getInitialSelection()
|
||||
dsint HexDump::getInitialSelection()
|
||||
{
|
||||
return mSelection.firstSelectedIndex;
|
||||
}
|
||||
|
||||
int_t HexDump::getSelectionStart()
|
||||
dsint HexDump::getSelectionStart()
|
||||
{
|
||||
return mSelection.fromIndex;
|
||||
}
|
||||
|
||||
int_t HexDump::getSelectionEnd()
|
||||
dsint HexDump::getSelectionEnd()
|
||||
{
|
||||
return mSelection.toIndex;
|
||||
}
|
||||
|
||||
bool HexDump::isSelected(int_t rva)
|
||||
bool HexDump::isSelected(dsint rva)
|
||||
{
|
||||
if(rva >= mSelection.fromIndex && rva <= mSelection.toIndex)
|
||||
return true;
|
||||
|
@ -353,7 +353,7 @@ bool HexDump::isSelected(int_t rva)
|
|||
return false;
|
||||
}
|
||||
|
||||
void HexDump::getString(int col, int_t rva, QList<RichTextPainter::CustomRichText_t>* richText)
|
||||
void HexDump::getString(int col, dsint rva, QList<RichTextPainter::CustomRichText_t>* richText)
|
||||
{
|
||||
int wI;
|
||||
QString wStr = "";
|
||||
|
@ -361,7 +361,7 @@ void HexDump::getString(int col, int_t rva, QList<RichTextPainter::CustomRichTex
|
|||
int wByteCount = getSizeOf(mDescriptor.at(col).data.itemSize);
|
||||
int wBufferByteCount = mDescriptor.at(col).itemCount * wByteCount;
|
||||
|
||||
wBufferByteCount = wBufferByteCount > (int_t)(mMemPage->getSize() - rva) ? mMemPage->getSize() - rva : wBufferByteCount;
|
||||
wBufferByteCount = wBufferByteCount > (dsint)(mMemPage->getSize() - rva) ? mMemPage->getSize() - rva : wBufferByteCount;
|
||||
|
||||
byte_t* wData = new byte_t[wBufferByteCount];
|
||||
//byte_t wData[mDescriptor.at(col).itemCount * wByteCount];
|
||||
|
@ -374,19 +374,19 @@ void HexDump::getString(int col, int_t rva, QList<RichTextPainter::CustomRichTex
|
|||
|
||||
QColor highlightColor = ConfigColor("HexDumpModifiedBytesColor");
|
||||
|
||||
for(wI = 0; wI < mDescriptor.at(col).itemCount && (rva + wI) < (int_t)mMemPage->getSize(); wI++)
|
||||
for(wI = 0; wI < mDescriptor.at(col).itemCount && (rva + wI) < (dsint)mMemPage->getSize(); wI++)
|
||||
{
|
||||
int maxLen = getStringMaxLength(mDescriptor.at(col).data);
|
||||
QString append = " ";
|
||||
if(!maxLen)
|
||||
append = "";
|
||||
if((rva + wI + wByteCount - 1) < (int_t)mMemPage->getSize())
|
||||
if((rva + wI + wByteCount - 1) < (dsint)mMemPage->getSize())
|
||||
wStr = toString(mDescriptor.at(col).data, (void*)(wData + wI * wByteCount)).rightJustified(maxLen, ' ') + append;
|
||||
else
|
||||
wStr = QString("?").rightJustified(maxLen, ' ') + append;
|
||||
curData.text = wStr;
|
||||
int_t start = rvaToVa(rva + wI * wByteCount);
|
||||
int_t end = start + wByteCount - 1;
|
||||
dsint start = rvaToVa(rva + wI * wByteCount);
|
||||
dsint end = start + wByteCount - 1;
|
||||
curData.textColor = DbgFunctions()->PatchInRange(start, end) ? highlightColor : textColor;
|
||||
richText->push_back(curData);
|
||||
}
|
||||
|
@ -937,12 +937,12 @@ int HexDump::getItemIndexFromX(int x)
|
|||
}
|
||||
}
|
||||
|
||||
int_t HexDump::getItemStartingAddress(int x, int y)
|
||||
dsint HexDump::getItemStartingAddress(int x, int y)
|
||||
{
|
||||
int wRowOffset = getIndexOffsetFromY(transY(y));
|
||||
int wItemIndex = getItemIndexFromX(x);
|
||||
int wColIndex = getColumnIndexFromX(x);
|
||||
int_t wStartingAddress = 0;
|
||||
dsint wStartingAddress = 0;
|
||||
|
||||
if(wColIndex > 0)
|
||||
{
|
||||
|
@ -978,7 +978,7 @@ void HexDump::appendResetDescriptor(int width, QString title, bool clickable, Co
|
|||
mAllowPainting = false;
|
||||
if(mDescriptor.size())
|
||||
{
|
||||
int_t wRVA = getTableOffset() * getBytePerRowCount() - mByteOffset;
|
||||
dsint wRVA = getTableOffset() * getBytePerRowCount() - mByteOffset;
|
||||
clearDescriptors();
|
||||
appendDescriptor(width, title, clickable, descriptor);
|
||||
printDumpAt(rvaToVa(wRVA), true, false);
|
||||
|
@ -993,7 +993,7 @@ void HexDump::clearDescriptors()
|
|||
deleteAllColumns();
|
||||
mDescriptor.clear();
|
||||
int charwidth = getCharWidth();
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(uint_t), "Address", false); //address
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(duint), "Address", false); //address
|
||||
}
|
||||
|
||||
void HexDump::debugStateChanged(DBGSTATE state)
|
||||
|
|
|
@ -85,20 +85,20 @@ public:
|
|||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void paintGraphicDump(QPainter* painter, int x, int y, int addr);
|
||||
|
||||
void printSelected(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void printSelected(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
|
||||
// Selection Management
|
||||
void expandSelectionUpTo(int_t rva);
|
||||
void setSingleSelection(int_t rva);
|
||||
int_t getInitialSelection();
|
||||
int_t getSelectionStart();
|
||||
int_t getSelectionEnd();
|
||||
bool isSelected(int_t rva);
|
||||
void expandSelectionUpTo(dsint rva);
|
||||
void setSingleSelection(dsint rva);
|
||||
dsint getInitialSelection();
|
||||
dsint getSelectionStart();
|
||||
dsint getSelectionEnd();
|
||||
bool isSelected(dsint rva);
|
||||
|
||||
void getString(int col, int_t rva, QList<RichTextPainter::CustomRichText_t>* richText);
|
||||
void getString(int col, dsint rva, QList<RichTextPainter::CustomRichText_t>* richText);
|
||||
int getSizeOf(DataSize_e size);
|
||||
|
||||
QString toString(DataDescriptor_t desc, void* data);
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
int twordStringMaxLength(TwordViewMode_e mode);
|
||||
|
||||
int getItemIndexFromX(int x);
|
||||
int_t getItemStartingAddress(int x, int y);
|
||||
dsint getItemStartingAddress(int x, int y);
|
||||
|
||||
int getBytePerRowCount();
|
||||
int getItemPixelWidth(ColumnDescriptor_t desc);
|
||||
|
@ -128,14 +128,14 @@ public:
|
|||
void appendResetDescriptor(int width, QString title, bool clickable, ColumnDescriptor_t descriptor);
|
||||
void clearDescriptors();
|
||||
|
||||
void printDumpAt(int_t parVA, bool select, bool repaint = true);
|
||||
uint_t rvaToVa(int_t rva);
|
||||
void printDumpAt(dsint parVA, bool select, bool repaint = true);
|
||||
duint rvaToVa(dsint rva);
|
||||
|
||||
signals:
|
||||
void selectionUpdated();
|
||||
|
||||
public slots:
|
||||
void printDumpAt(int_t parVA);
|
||||
void printDumpAt(dsint parVA);
|
||||
void debugStateChanged(DBGSTATE state);
|
||||
|
||||
private:
|
||||
|
@ -143,9 +143,9 @@ private:
|
|||
|
||||
typedef struct _RowDescriptor_t
|
||||
{
|
||||
int_t firstSelectedIndex;
|
||||
int_t fromIndex;
|
||||
int_t toIndex;
|
||||
dsint firstSelectedIndex;
|
||||
dsint fromIndex;
|
||||
dsint toIndex;
|
||||
} SelectionData_t;
|
||||
|
||||
SelectionData_t mSelection;
|
||||
|
@ -158,8 +158,8 @@ protected:
|
|||
QList<ColumnDescriptor_t> mDescriptor;
|
||||
int mForceColumn;
|
||||
bool mRvaDisplayEnabled;
|
||||
uint_t mRvaDisplayBase;
|
||||
int_t mRvaDisplayPageBase;
|
||||
duint mRvaDisplayBase;
|
||||
dsint mRvaDisplayPageBase;
|
||||
};
|
||||
|
||||
#endif // _HEXDUMP_H
|
||||
|
|
|
@ -32,7 +32,7 @@ ReferenceView::ReferenceView()
|
|||
|
||||
// Setup signals
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceAddColumnAt(int, QString)), this, SLOT(addColumnAt(int, QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(int_t)), this, SLOT(setRowCount(int_t)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(dsint)), this, SLOT(setRowCount(dsint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetCellContent(int, int, QString)), this, SLOT(setCellContent(int, int, QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceReloadData()), this, SLOT(reloadData()));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetSingleSelection(int, bool)), this, SLOT(setSingleSelection(int, bool)));
|
||||
|
@ -76,7 +76,7 @@ void ReferenceView::setupContextMenu()
|
|||
void ReferenceView::disconnectBridge()
|
||||
{
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceAddColumnAt(int, QString)), this, SLOT(addColumnAt(int, QString)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(int_t)), this, SLOT(setRowCount(int_t)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(dsint)), this, SLOT(setRowCount(dsint)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetCellContent(int, int, QString)), this, SLOT(setCellContent(int, int, QString)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceReloadData()), this, SLOT(reloadData()));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetSingleSelection(int, bool)), this, SLOT(setSingleSelection(int, bool)));
|
||||
|
@ -107,7 +107,7 @@ void ReferenceView::addColumnAt(int width, QString title)
|
|||
mSearchList->addColumnAt(width, title, true);
|
||||
}
|
||||
|
||||
void ReferenceView::setRowCount(int_t count)
|
||||
void ReferenceView::setRowCount(dsint count)
|
||||
{
|
||||
emit mCountLabel->setText(QString("%1").arg(count));
|
||||
mSearchBox->setText("");
|
||||
|
@ -173,7 +173,7 @@ void ReferenceView::followDumpAddress()
|
|||
|
||||
void ReferenceView::followApiAddress()
|
||||
{
|
||||
int_t apiValue = apiAddressFromString(mCurList->getCellContent(mCurList->getInitialSelection(), 1));
|
||||
dsint apiValue = apiAddressFromString(mCurList->getCellContent(mCurList->getInitialSelection(), 1));
|
||||
DbgCmdExecDirect(QString("disasm " + QString().sprintf("%p", apiValue)).toUtf8().constData());
|
||||
emit showCpu();
|
||||
}
|
||||
|
@ -205,11 +205,11 @@ void ReferenceView::toggleBreakpoint()
|
|||
|
||||
if((wBpType & bp_normal) == bp_normal)
|
||||
{
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -245,7 +245,7 @@ void ReferenceView::toggleBookmark()
|
|||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
int_t ReferenceView::apiAddressFromString(const QString & s)
|
||||
dsint ReferenceView::apiAddressFromString(const QString & s)
|
||||
{
|
||||
QRegExp regEx("call.+<(.+)>");
|
||||
regEx.indexIn(s);
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
|
||||
private slots:
|
||||
void addColumnAt(int width, QString title);
|
||||
void setRowCount(int_t count);
|
||||
void setRowCount(dsint count);
|
||||
void setCellContent(int r, int c, QString s);
|
||||
void reloadData();
|
||||
void setSingleSelection(int index, bool scroll);
|
||||
|
@ -43,7 +43,7 @@ private:
|
|||
bool mFollowDumpDefault;
|
||||
QLabel* mCountLabel;
|
||||
|
||||
int_t apiAddressFromString(const QString & s);
|
||||
dsint apiAddressFromString(const QString & s);
|
||||
};
|
||||
|
||||
#endif // REFERENCEVIEW_H
|
||||
|
|
|
@ -7,7 +7,7 @@ SearchListViewTable::SearchListViewTable(StdTable* parent) : StdTable(parent)
|
|||
highlightText = "";
|
||||
}
|
||||
|
||||
QString SearchListViewTable::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString SearchListViewTable::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
bool isaddr = true;
|
||||
QString text = StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
|
@ -16,7 +16,7 @@ QString SearchListViewTable::paintContent(QPainter* painter, int_t rowBase, int
|
|||
if(!getRowCount())
|
||||
isaddr = false;
|
||||
ULONGLONG val = 0;
|
||||
uint_t wVA;
|
||||
duint wVA;
|
||||
if(sscanf_s(text.toUtf8().constData(), "%llX", &val) != 1)
|
||||
isaddr = false;
|
||||
else
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
QString highlightText;
|
||||
|
||||
protected:
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
};
|
||||
|
||||
#endif // SEARCHLISTVIEWTABLE_H
|
||||
|
|
|
@ -24,7 +24,7 @@ StdTable::StdTable(QWidget* parent) : AbstractTableView(parent)
|
|||
connect(this, SIGNAL(headerButtonPressed(int)), this, SLOT(headerButtonPressedSlot(int)));
|
||||
}
|
||||
|
||||
QString StdTable::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString StdTable::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
if(isSelected(rowBase, rowOffset) == true)
|
||||
painter->fillRect(QRect(x, y, w, h), QBrush(selectionColor));
|
||||
|
@ -128,8 +128,8 @@ void StdTable::keyPressEvent(QKeyEvent* event)
|
|||
|
||||
if(key == Qt::Key_Up || key == Qt::Key_Down)
|
||||
{
|
||||
int_t wBotIndex = getTableOffset();
|
||||
int_t wTopIndex = wBotIndex + getNbrOfLineToPrint() - 1;
|
||||
dsint wBotIndex = getTableOffset();
|
||||
dsint wTopIndex = wBotIndex + getNbrOfLineToPrint() - 1;
|
||||
|
||||
if(key == Qt::Key_Up)
|
||||
selectPrevious();
|
||||
|
|
|
@ -8,7 +8,7 @@ class StdTable : public AbstractTableView
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit StdTable(QWidget* parent = 0);
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void reloadData();
|
||||
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
|
|
|
@ -34,7 +34,7 @@ void Bridge::CopyToClipboard(const QString & text)
|
|||
clipboard->setText(text);
|
||||
}
|
||||
|
||||
void Bridge::setResult(int_t result)
|
||||
void Bridge::setResult(dsint result)
|
||||
{
|
||||
bridgeResult = result;
|
||||
hasBridgeResult = true;
|
||||
|
@ -85,11 +85,11 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
switch(type)
|
||||
{
|
||||
case GUI_DISASSEMBLE_AT:
|
||||
emit disassembleAt((int_t)param1, (int_t)param2);
|
||||
emit disassembleAt((dsint)param1, (dsint)param2);
|
||||
break;
|
||||
|
||||
case GUI_SET_DEBUG_STATE:
|
||||
emit dbgStateChanged((DBGSTATE)(int_t)param1);
|
||||
emit dbgStateChanged((DBGSTATE)(dsint)param1);
|
||||
break;
|
||||
|
||||
case GUI_ADD_MSG_TO_LOG:
|
||||
|
@ -120,7 +120,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
return winId;
|
||||
|
||||
case GUI_DUMP_AT:
|
||||
emit dumpAt((int_t)param1);
|
||||
emit dumpAt((dsint)param1);
|
||||
break;
|
||||
|
||||
case GUI_SCRIPT_ADD:
|
||||
|
@ -196,7 +196,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
break;
|
||||
|
||||
case GUI_REF_SETROWCOUNT:
|
||||
emit referenceSetRowCount((int_t)param1);
|
||||
emit referenceSetRowCount((dsint)param1);
|
||||
break;
|
||||
|
||||
case GUI_REF_GETROWCOUNT:
|
||||
|
@ -241,7 +241,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
break;
|
||||
|
||||
case GUI_STACK_DUMP_AT:
|
||||
emit stackDumpAt((uint_t)param1, (uint_t)param2);
|
||||
emit stackDumpAt((duint)param1, (duint)param2);
|
||||
break;
|
||||
|
||||
case GUI_UPDATE_DUMP_VIEW:
|
||||
|
@ -266,7 +266,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
|
||||
case GUI_GET_DISASSEMBLY:
|
||||
{
|
||||
uint_t parVA = (uint_t)param1;
|
||||
duint parVA = (duint)param1;
|
||||
char* text = (char*)param2;
|
||||
if(!text || !parVA || !DbgIsDebugging())
|
||||
return 0;
|
||||
|
@ -342,7 +342,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
|
|||
result.Wait();
|
||||
if(selection->start > selection->end) //swap start and end
|
||||
{
|
||||
int_t temp = selection->end;
|
||||
dsint temp = selection->end;
|
||||
selection->end = selection->start;
|
||||
selection->start = temp;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
static void CopyToClipboard(const QString & text);
|
||||
|
||||
//result function
|
||||
void setResult(int_t result = 0);
|
||||
void setResult(dsint result = 0);
|
||||
|
||||
//helper functions
|
||||
void emitLoadSourceFile(const QString path, int line = 0, int selection = 0);
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
ReferenceManager* referenceManager;
|
||||
|
||||
signals:
|
||||
void disassembleAt(int_t va, int_t eip);
|
||||
void disassembleAt(dsint va, dsint eip);
|
||||
void repaintGui();
|
||||
void dbgStateChanged(DBGSTATE state);
|
||||
void addMsgToLog(QString msg);
|
||||
|
@ -51,7 +51,7 @@ signals:
|
|||
void updateRegisters();
|
||||
void updateBreakpoints();
|
||||
void updateWindowTitle(QString filename);
|
||||
void dumpAt(int_t va);
|
||||
void dumpAt(dsint va);
|
||||
void scriptAdd(int count, const char** lines);
|
||||
void scriptClear();
|
||||
void scriptSetIp(int line);
|
||||
|
@ -66,14 +66,14 @@ signals:
|
|||
void clearSymbolLog();
|
||||
void setSymbolProgress(int progress);
|
||||
void referenceAddColumnAt(int width, QString title);
|
||||
void referenceSetRowCount(int_t count);
|
||||
void referenceSetRowCount(dsint count);
|
||||
void referenceSetCellContent(int r, int c, QString s);
|
||||
void referenceReloadData();
|
||||
void referenceSetSingleSelection(int index, bool scroll);
|
||||
void referenceSetProgress(int progress);
|
||||
void referenceSetSearchStartCol(int col);
|
||||
void referenceInitialize(QString name);
|
||||
void stackDumpAt(uint_t va, uint_t csp);
|
||||
void stackDumpAt(duint va, duint csp);
|
||||
void updateDump();
|
||||
void updateThreads();
|
||||
void updateMemory();
|
||||
|
@ -117,7 +117,7 @@ signals:
|
|||
|
||||
private:
|
||||
QMutex* mBridgeMutex;
|
||||
int_t bridgeResult;
|
||||
dsint bridgeResult;
|
||||
volatile bool hasBridgeResult;
|
||||
volatile bool dbgStopped;
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ BridgeResult::~BridgeResult()
|
|||
Bridge::getBridge()->mBridgeMutex->unlock();
|
||||
}
|
||||
|
||||
int_t BridgeResult::Wait()
|
||||
dsint BridgeResult::Wait()
|
||||
{
|
||||
while(!Bridge::getBridge()->hasBridgeResult) //wait for thread completion
|
||||
Sleep(100);
|
||||
|
|
|
@ -8,7 +8,7 @@ class BridgeResult
|
|||
public:
|
||||
BridgeResult();
|
||||
~BridgeResult();
|
||||
int_t Wait();
|
||||
dsint Wait();
|
||||
};
|
||||
|
||||
#endif // BRIDGERESULT_H
|
||||
|
|
|
@ -77,7 +77,7 @@ void BeaTokenizer::StringInstructionMemory(BeaInstructionToken* instr, int size,
|
|||
AddToken(instr, TokenMemorySegment, segment, 0);
|
||||
AddToken(instr, TokenUncategorized, ":", 0);
|
||||
AddToken(instr, TokenMemoryBrackets, "[", 0);
|
||||
AddToken(instr, TokenMemoryBaseRegister, RegisterToString(sizeof(int_t) * 8, reg), 0); //EDI/RDI
|
||||
AddToken(instr, TokenMemoryBaseRegister, RegisterToString(sizeof(dsint) * 8, reg), 0); //EDI/RDI
|
||||
AddToken(instr, TokenMemoryBrackets, "]", 0);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ QString BeaTokenizer::PrintValue(const BeaTokenValue* value, bool module, int ma
|
|||
char labelText[MAX_LABEL_SIZE] = "";
|
||||
char module_[MAX_MODULE_SIZE] = "";
|
||||
QString moduleText;
|
||||
int_t addr = value->value;
|
||||
dsint addr = value->value;
|
||||
bool bHasLabel = DbgGetLabelAt(addr, SEG_DEFAULT, labelText);
|
||||
bool bHasModule = (module && DbgGetModuleAt(addr, module_) && !QString(labelText).startsWith("JMP.&"));
|
||||
moduleText = QString(module_);
|
||||
|
@ -186,7 +186,7 @@ QString BeaTokenizer::PrintValue(const BeaTokenValue* value, bool module, int ma
|
|||
if(moduleText.length())
|
||||
moduleText += ".";
|
||||
QString addrText;
|
||||
addrText = QString("%1").arg(addr & (uint_t) - 1, 0, 16, QChar('0')).toUpper();
|
||||
addrText = QString("%1").arg(addr & (duint) - 1, 0, 16, QChar('0')).toUpper();
|
||||
QString finalText;
|
||||
if(bHasLabel && bHasModule) //<module.label>
|
||||
finalText = QString("<%1%2>").arg(moduleText).arg(labelText);
|
||||
|
@ -244,7 +244,7 @@ void BeaTokenizer::Argument(BeaInstructionToken* instr, const DISASM* disasm, co
|
|||
bool prependPlusMinus = false;
|
||||
if(arg->Memory.BaseRegister) //base register
|
||||
{
|
||||
AddToken(instr, TokenMemoryBaseRegister, RegisterToString(sizeof(int_t) * 8, arg->Memory.BaseRegister), 0);
|
||||
AddToken(instr, TokenMemoryBaseRegister, RegisterToString(sizeof(dsint) * 8, arg->Memory.BaseRegister), 0);
|
||||
prependPlusMinus = true;
|
||||
}
|
||||
if(arg->Memory.IndexRegister) //index register + scale
|
||||
|
@ -255,7 +255,7 @@ void BeaTokenizer::Argument(BeaInstructionToken* instr, const DISASM* disasm, co
|
|||
AddToken(instr, TokenMemoryOperator, "+", 0);
|
||||
AddToken(instr, TokenMemoryOperatorSpace, " ", 0);
|
||||
}
|
||||
AddToken(instr, TokenMemoryIndexRegister, RegisterToString(sizeof(int_t) * 8, arg->Memory.IndexRegister), 0);
|
||||
AddToken(instr, TokenMemoryIndexRegister, RegisterToString(sizeof(dsint) * 8, arg->Memory.IndexRegister), 0);
|
||||
int scale = arg->Memory.Scale;
|
||||
if(scale > 1) //eax * 1 = eax
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
struct BeaTokenValue
|
||||
{
|
||||
int size; //value size
|
||||
int_t value; //value
|
||||
dsint value; //value
|
||||
};
|
||||
|
||||
struct BeaSingleToken
|
||||
|
|
|
@ -20,14 +20,14 @@ QBeaEngine::QBeaEngine(int maxModuleSize)
|
|||
*
|
||||
* @return Return the RVA (Relative to the data pointer) of the nth instruction before the instruction pointed by ip
|
||||
*/
|
||||
ulong QBeaEngine::DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t ip, int n)
|
||||
ulong QBeaEngine::DisassembleBack(byte_t* data, duint base, duint size, duint ip, int n)
|
||||
{
|
||||
|
||||
const unsigned int max_instructions = 128;
|
||||
|
||||
Q_UNUSED(base);
|
||||
int i;
|
||||
uint_t abuf[131], addr, back, cmdsize;
|
||||
duint abuf[131], addr, back, cmdsize;
|
||||
byte_t* pdata;
|
||||
int len;
|
||||
|
||||
|
@ -56,7 +56,7 @@ ulong QBeaEngine::DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t
|
|||
if(n == 0)
|
||||
return ip;
|
||||
|
||||
if(ip < (uint_t)n)
|
||||
if(ip < (duint)n)
|
||||
return ip;
|
||||
|
||||
back = 16 * (n + 3); // Instruction length limited to 16
|
||||
|
@ -99,11 +99,11 @@ ulong QBeaEngine::DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t
|
|||
*
|
||||
* @return Return the RVA (Relative to the data pointer) of the nth instruction after the instruction pointed by ip
|
||||
*/
|
||||
ulong QBeaEngine::DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t ip, int n)
|
||||
ulong QBeaEngine::DisassembleNext(byte_t* data, duint base, duint size, duint ip, int n)
|
||||
{
|
||||
Q_UNUSED(base);
|
||||
int i;
|
||||
uint_t cmdsize;
|
||||
duint cmdsize;
|
||||
byte_t* pdata;
|
||||
int len;
|
||||
|
||||
|
@ -153,7 +153,7 @@ ulong QBeaEngine::DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t
|
|||
*
|
||||
* @return Return the disassembled instruction
|
||||
*/
|
||||
Instruction_t QBeaEngine::DisassembleAt(byte_t* data, uint_t size, uint_t instIndex, uint_t origBase, uint_t origInstRVA)
|
||||
Instruction_t QBeaEngine::DisassembleAt(byte_t* data, duint size, duint instIndex, duint origBase, duint origInstRVA)
|
||||
{
|
||||
Instruction_t wInst;
|
||||
int len;
|
||||
|
@ -166,9 +166,9 @@ Instruction_t QBeaEngine::DisassembleAt(byte_t* data, uint_t size, uint_t instIn
|
|||
#endif
|
||||
mDisasmStruct.Options = NoformatNumeral | ShowSegmentRegs;
|
||||
|
||||
mDisasmStruct.EIP = (UIntPtr)((uint_t)data + (uint_t)instIndex);
|
||||
mDisasmStruct.EIP = (UIntPtr)((duint)data + (duint)instIndex);
|
||||
mDisasmStruct.VirtualAddr = origBase + origInstRVA;
|
||||
mDisasmStruct.SecurityBlock = (UIntPtr)((uint_t)size - instIndex);
|
||||
mDisasmStruct.SecurityBlock = (UIntPtr)((duint)size - instIndex);
|
||||
|
||||
len = Disasm(&mDisasmStruct);
|
||||
len = (len < 1) ? 1 : len ;
|
||||
|
|
|
@ -9,7 +9,7 @@ typedef struct _Instruction_t
|
|||
{
|
||||
QString instStr;
|
||||
QByteArray dump;
|
||||
uint_t rva;
|
||||
duint rva;
|
||||
int length;
|
||||
DISASM disasm;
|
||||
BeaTokenizer::BeaInstructionToken tokens;
|
||||
|
@ -19,9 +19,9 @@ class QBeaEngine
|
|||
{
|
||||
public:
|
||||
explicit QBeaEngine(int maxModuleSize);
|
||||
ulong DisassembleBack(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
||||
ulong DisassembleNext(byte_t* data, uint_t base, uint_t size, uint_t ip, int n);
|
||||
Instruction_t DisassembleAt(byte_t* data, uint_t size, uint_t instIndex, uint_t origBase, uint_t origInstRVA);
|
||||
ulong DisassembleBack(byte_t* data, duint base, duint size, duint ip, int n);
|
||||
ulong DisassembleNext(byte_t* data, duint base, duint size, duint ip, int n);
|
||||
Instruction_t DisassembleAt(byte_t* data, duint size, duint instIndex, duint origBase, duint origInstRVA);
|
||||
|
||||
private:
|
||||
DISASM mDisasmStruct;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef NEWTYPES_H
|
||||
#define NEWTYPES_H
|
||||
|
||||
#include "Imports.h"
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
typedef duint uint_t;
|
||||
typedef dsint int_t;
|
||||
|
||||
typedef unsigned char byte_t;
|
||||
|
||||
#endif // NEWTYPES_H
|
|
@ -9,7 +9,7 @@ BreakpointsView::BreakpointsView(QWidget* parent) : QWidget(parent)
|
|||
mSoftBPTable = new StdTable(this);
|
||||
int wCharWidth = mSoftBPTable->getCharWidth();
|
||||
mSoftBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mSoftBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(uint_t), "Software", false, "Address");
|
||||
mSoftBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(duint), "Software", false, "Address");
|
||||
mSoftBPTable->addColumnAt(8 + wCharWidth * 32, "Name", false);
|
||||
mSoftBPTable->addColumnAt(8 + wCharWidth * 32, "Module/Label", false);
|
||||
mSoftBPTable->addColumnAt(8 + wCharWidth * 8, "State", false);
|
||||
|
@ -18,7 +18,7 @@ BreakpointsView::BreakpointsView(QWidget* parent) : QWidget(parent)
|
|||
// Hardware
|
||||
mHardBPTable = new StdTable(this);
|
||||
mHardBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mHardBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(uint_t), "Hardware", false, "Address");
|
||||
mHardBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(duint), "Hardware", false, "Address");
|
||||
mHardBPTable->addColumnAt(8 + wCharWidth * 32, "Name", false);
|
||||
mHardBPTable->addColumnAt(8 + wCharWidth * 32, "Module/Label", false);
|
||||
mHardBPTable->addColumnAt(8 + wCharWidth * 8, "State", false);
|
||||
|
@ -27,7 +27,7 @@ BreakpointsView::BreakpointsView(QWidget* parent) : QWidget(parent)
|
|||
// Memory
|
||||
mMemBPTable = new StdTable(this);
|
||||
mMemBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mMemBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(uint_t), "Memory", false, "Address");
|
||||
mMemBPTable->addColumnAt(8 + wCharWidth * 2 * sizeof(duint), "Memory", false, "Address");
|
||||
mMemBPTable->addColumnAt(8 + wCharWidth * 32, "Name", false);
|
||||
mMemBPTable->addColumnAt(8 + wCharWidth * 32, "Module/Label", false);
|
||||
mMemBPTable->addColumnAt(8 + wCharWidth * 8, "State", false);
|
||||
|
@ -79,7 +79,7 @@ void BreakpointsView::reloadData()
|
|||
mHardBPTable->setRowCount(wBPList.count);
|
||||
for(wI = 0; wI < wBPList.count; wI++)
|
||||
{
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
mHardBPTable->setCellContent(wI, 0, addr_text);
|
||||
mHardBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
|
||||
|
||||
|
@ -118,7 +118,7 @@ void BreakpointsView::reloadData()
|
|||
mSoftBPTable->setRowCount(wBPList.count);
|
||||
for(wI = 0; wI < wBPList.count; wI++)
|
||||
{
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
mSoftBPTable->setCellContent(wI, 0, addr_text);
|
||||
mSoftBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
|
||||
|
||||
|
@ -157,7 +157,7 @@ void BreakpointsView::reloadData()
|
|||
mMemBPTable->setRowCount(wBPList.count);
|
||||
for(wI = 0; wI < wBPList.count; wI++)
|
||||
{
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wBPList.bp[wI].addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
mMemBPTable->setCellContent(wI, 0, addr_text);
|
||||
mMemBPTable->setCellContent(wI, 1, QString(wBPList.bp[wI].name));
|
||||
|
||||
|
@ -234,7 +234,7 @@ void BreakpointsView::hardwareBPContextMenuSlot(const QPoint & pos)
|
|||
{
|
||||
int wI = 0;
|
||||
QMenu* wMenu = new QMenu(this);
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
BPMAP wBPList;
|
||||
|
||||
// Remove
|
||||
|
@ -288,7 +288,7 @@ void BreakpointsView::hardwareBPContextMenuSlot(const QPoint & pos)
|
|||
void BreakpointsView::removeHardBPActionSlot()
|
||||
{
|
||||
StdTable* table = mHardBPTable;
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
Breakpoints::removeBP(bp_hardware, wVA);
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ void BreakpointsView::softwareBPContextMenuSlot(const QPoint & pos)
|
|||
{
|
||||
int wI = 0;
|
||||
QMenu* wMenu = new QMenu(this);
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
BPMAP wBPList;
|
||||
|
||||
// Remove
|
||||
|
@ -396,7 +396,7 @@ void BreakpointsView::softwareBPContextMenuSlot(const QPoint & pos)
|
|||
void BreakpointsView::removeSoftBPActionSlot()
|
||||
{
|
||||
StdTable* table = mSoftBPTable;
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
Breakpoints::removeBP(bp_normal, wVA);
|
||||
}
|
||||
|
||||
|
@ -450,7 +450,7 @@ void BreakpointsView::memoryBPContextMenuSlot(const QPoint & pos)
|
|||
{
|
||||
int wI = 0;
|
||||
QMenu* wMenu = new QMenu(this);
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
BPMAP wBPList;
|
||||
|
||||
// Remove
|
||||
|
@ -504,7 +504,7 @@ void BreakpointsView::memoryBPContextMenuSlot(const QPoint & pos)
|
|||
void BreakpointsView::removeMemBPActionSlot()
|
||||
{
|
||||
StdTable* table = mMemBPTable;
|
||||
uint_t wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint wVA = table->getCellContent(table->getInitialSelection(), 0).toULongLong(0, 16);
|
||||
Breakpoints::removeBP(bp_memory, wVA);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ CPUDisassembly::CPUDisassembly(QWidget* parent) : Disassembly(parent)
|
|||
// Create the action list for the right click context menu
|
||||
setupRightClickContextMenu();
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(disassembleAt(int_t, int_t)), this, SLOT(disassembleAt(int_t, int_t)));
|
||||
connect(Bridge::getBridge(), SIGNAL(disassembleAt(dsint, dsint)), this, SLOT(disassembleAt(dsint, dsint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(debugStateChangedSlot(DBGSTATE)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionDisasmGet(SELECTIONDATA*)), this, SLOT(selectionGet(SELECTIONDATA*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionDisasmSet(const SELECTIONDATA*)), this, SLOT(selectionSet(const SELECTIONDATA*)));
|
||||
|
@ -49,7 +49,7 @@ void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
{
|
||||
case 0: //address
|
||||
{
|
||||
int_t mSelectedVa = rvaToVa(getInitialSelection());
|
||||
dsint mSelectedVa = rvaToVa(getInitialSelection());
|
||||
if(mRvaDisplayEnabled && mSelectedVa == mRvaDisplayBase)
|
||||
mRvaDisplayEnabled = false;
|
||||
else
|
||||
|
@ -86,7 +86,7 @@ void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void CPUDisassembly::addFollowReferenceMenuItem(QString name, int_t value, QMenu* menu, bool isReferences)
|
||||
void CPUDisassembly::addFollowReferenceMenuItem(QString name, dsint value, QMenu* menu, bool isReferences)
|
||||
{
|
||||
foreach(QAction * action, menu->actions()) //check for duplicate action
|
||||
if(action->text() == name)
|
||||
|
@ -94,11 +94,11 @@ void CPUDisassembly::addFollowReferenceMenuItem(QString name, int_t value, QMenu
|
|||
QAction* newAction = new QAction(name, this);
|
||||
newAction->setFont(QFont("Courier New", 8));
|
||||
menu->addAction(newAction);
|
||||
newAction->setObjectName(QString(isReferences ? "REF|" : "DUMP|") + QString("%1").arg(value, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
newAction->setObjectName(QString(isReferences ? "REF|" : "DUMP|") + QString("%1").arg(value, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
connect(newAction, SIGNAL(triggered()), this, SLOT(followActionSlot()));
|
||||
}
|
||||
|
||||
void CPUDisassembly::setupFollowReferenceMenu(int_t wVA, QMenu* menu, bool isReferences)
|
||||
void CPUDisassembly::setupFollowReferenceMenu(dsint wVA, QMenu* menu, bool isReferences)
|
||||
{
|
||||
//remove previous actions
|
||||
QList<QAction*> list = menu->actions();
|
||||
|
@ -171,14 +171,14 @@ void CPUDisassembly::contextMenuEvent(QContextMenuEvent* event)
|
|||
{
|
||||
int wI;
|
||||
QMenu* wMenu = new QMenu(this);
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
BPXTYPE wBpType = DbgGetBpxTypeAt(wVA);
|
||||
|
||||
// Build Menu
|
||||
wMenu->addMenu(mBinaryMenu);
|
||||
wMenu->addMenu(mCopyMenu);
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
wMenu->addAction(mUndoSelection);
|
||||
|
||||
|
@ -260,8 +260,8 @@ void CPUDisassembly::contextMenuEvent(QContextMenuEvent* event)
|
|||
wMenu->addAction(mSetComment);
|
||||
wMenu->addAction(mSetBookmark);
|
||||
|
||||
uint_t selection_start = rvaToVa(getSelectionStart());
|
||||
uint_t selection_end = rvaToVa(getSelectionEnd());
|
||||
duint selection_start = rvaToVa(getSelectionStart());
|
||||
duint selection_end = rvaToVa(getSelectionEnd());
|
||||
if(!DbgFunctionOverlaps(selection_start, selection_end))
|
||||
{
|
||||
mToggleFunction->setText("Add function");
|
||||
|
@ -656,17 +656,17 @@ void CPUDisassembly::toggleInt3BPAction()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
BPXTYPE wBpType = DbgGetBpxTypeAt(wVA);
|
||||
QString wCmd;
|
||||
|
||||
if((wBpType & bp_normal) == bp_normal)
|
||||
{
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -676,17 +676,17 @@ void CPUDisassembly::toggleInt3BPAction()
|
|||
|
||||
void CPUDisassembly::toggleHwBpActionSlot()
|
||||
{
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
BPXTYPE wBpType = DbgGetBpxTypeAt(wVA);
|
||||
QString wCmd;
|
||||
|
||||
if((wBpType & bp_hardware) == bp_hardware)
|
||||
{
|
||||
wCmd = "bphwc " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphwc " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
wCmd = "bphws " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphws " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -713,7 +713,7 @@ void CPUDisassembly::setHwBpOnSlot3ActionSlot()
|
|||
setHwBpAt(rvaToVa(getInitialSelection()), 3);
|
||||
}
|
||||
|
||||
void CPUDisassembly::setHwBpAt(uint_t va, int slot)
|
||||
void CPUDisassembly::setHwBpAt(duint va, int slot)
|
||||
{
|
||||
BPXTYPE wBpType = DbgGetBpxTypeAt(va);
|
||||
|
||||
|
@ -742,17 +742,17 @@ void CPUDisassembly::setHwBpAt(uint_t va, int slot)
|
|||
|
||||
if(wSlotIndex < 0) // Slot not used
|
||||
{
|
||||
wCmd = "bphws " + QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphws " + QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
}
|
||||
else // Slot used
|
||||
{
|
||||
wCmd = "bphwc " + QString("%1").arg((uint_t)(wBPList.bp[wSlotIndex].addr), sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphwc " + QString("%1").arg((duint)(wBPList.bp[wSlotIndex].addr), sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
||||
Sleep(200);
|
||||
|
||||
wCmd = "bphws " + QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphws " + QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
}
|
||||
if(wBPList.count)
|
||||
|
@ -763,8 +763,8 @@ void CPUDisassembly::setNewOriginHereActionSlot()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
QString wCmd = "cip=" + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
QString wCmd = "cip=" + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
}
|
||||
|
||||
|
@ -772,9 +772,9 @@ void CPUDisassembly::setLabel()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
LineEditDialog mLineEdit(this);
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
char label_text[MAX_COMMENT_SIZE] = "";
|
||||
if(DbgGetLabelAt((duint)wVA, SEG_DEFAULT, label_text))
|
||||
mLineEdit.setText(QString(label_text));
|
||||
|
@ -796,9 +796,9 @@ void CPUDisassembly::setComment()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
LineEditDialog mLineEdit(this);
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
char comment_text[MAX_COMMENT_SIZE] = "";
|
||||
if(DbgGetCommentAt((duint)wVA, comment_text))
|
||||
{
|
||||
|
@ -825,7 +825,7 @@ void CPUDisassembly::setBookmark()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t wVA = rvaToVa(getInitialSelection());
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
bool result;
|
||||
if(DbgGetBookmarkAt(wVA))
|
||||
result = DbgSetBookmarkAt(wVA, false);
|
||||
|
@ -846,14 +846,14 @@ void CPUDisassembly::toggleFunction()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t start = rvaToVa(getSelectionStart());
|
||||
uint_t end = rvaToVa(getSelectionEnd());
|
||||
uint_t function_start = 0;
|
||||
uint_t function_end = 0;
|
||||
duint start = rvaToVa(getSelectionStart());
|
||||
duint end = rvaToVa(getSelectionEnd());
|
||||
duint function_start = 0;
|
||||
duint function_end = 0;
|
||||
if(!DbgFunctionOverlaps(start, end))
|
||||
{
|
||||
QString start_text = QString("%1").arg(start, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString end_text = QString("%1").arg(end, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString start_text = QString("%1").arg(start, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString end_text = QString("%1").arg(end, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
char labeltext[MAX_LABEL_SIZE] = "";
|
||||
QString label_text = "";
|
||||
if(DbgGetLabelAt(start, SEG_DEFAULT, labeltext))
|
||||
|
@ -870,13 +870,13 @@ void CPUDisassembly::toggleFunction()
|
|||
}
|
||||
else
|
||||
{
|
||||
for(uint_t i = start; i <= end; i++)
|
||||
for(duint i = start; i <= end; i++)
|
||||
{
|
||||
if(DbgFunctionGet(i, &function_start, &function_end))
|
||||
break;
|
||||
}
|
||||
QString start_text = QString("%1").arg(function_start, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString end_text = QString("%1").arg(function_end, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString start_text = QString("%1").arg(function_start, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString end_text = QString("%1").arg(function_end, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
char labeltext[MAX_LABEL_SIZE] = "";
|
||||
QString label_text = "";
|
||||
if(DbgGetLabelAt(function_start, SEG_DEFAULT, labeltext))
|
||||
|
@ -901,16 +901,16 @@ void CPUDisassembly::assembleAt()
|
|||
|
||||
do
|
||||
{
|
||||
int_t wRVA = getInitialSelection();
|
||||
uint_t wVA = rvaToVa(wRVA);
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
dsint wRVA = getInitialSelection();
|
||||
duint wVA = rvaToVa(wRVA);
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
|
||||
QByteArray wBuffer;
|
||||
|
||||
int_t wMaxByteCountToRead = 16 * 2;
|
||||
dsint wMaxByteCountToRead = 16 * 2;
|
||||
|
||||
//TODO: fix size problems
|
||||
int_t size = getSize();
|
||||
dsint size = getSize();
|
||||
if(!size)
|
||||
size = wRVA;
|
||||
|
||||
|
@ -963,10 +963,10 @@ void CPUDisassembly::assembleAt()
|
|||
//select next instruction after assembling
|
||||
setSingleSelection(wRVA);
|
||||
|
||||
int_t botRVA = getTableOffset();
|
||||
int_t topRVA = getInstructionRVA(getTableOffset(), getNbrOfLineToPrint() - 1);
|
||||
dsint botRVA = getTableOffset();
|
||||
dsint topRVA = getInstructionRVA(getTableOffset(), getNbrOfLineToPrint() - 1);
|
||||
|
||||
int_t wInstrSize = getInstructionRVA(wRVA, 1) - wRVA - 1;
|
||||
dsint wInstrSize = getInstructionRVA(wRVA, 1) - wRVA - 1;
|
||||
|
||||
expandSelectionUpTo(wRVA + wInstrSize);
|
||||
selectNext(false);
|
||||
|
@ -1010,20 +1010,20 @@ void CPUDisassembly::gotoFileOffset()
|
|||
mGotoDialog.setWindowTitle("Goto File Offset in " + QString(modname));
|
||||
if(mGotoDialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
uint_t value = DbgValFromString(mGotoDialog.expressionText.toUtf8().constData());
|
||||
duint value = DbgValFromString(mGotoDialog.expressionText.toUtf8().constData());
|
||||
value = DbgFunctions()->FileOffsetToVa(modname, value);
|
||||
DbgCmdExec(QString().sprintf("disasm \"%p\"", value).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDisassembly::gotoStartSlot()
|
||||
{
|
||||
uint_t dest = mMemPage->getBase();
|
||||
duint dest = mMemPage->getBase();
|
||||
DbgCmdExec(QString().sprintf("disasm \"%p\"", dest).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDisassembly::gotoEndSlot()
|
||||
{
|
||||
uint_t dest = mMemPage->getBase() + mMemPage->getSize() - (getViewableRowsCount() * 16);
|
||||
duint dest = mMemPage->getBase() + mMemPage->getSize() - (getViewableRowsCount() * 16);
|
||||
DbgCmdExec(QString().sprintf("disasm \"%p\"", dest).toUtf8().constData());
|
||||
}
|
||||
|
||||
|
@ -1036,7 +1036,7 @@ void CPUDisassembly::followActionSlot()
|
|||
DbgCmdExec(QString().sprintf("dump \"%s\"", action->objectName().mid(5).toUtf8().constData()).toUtf8().constData());
|
||||
else if(action->objectName().startsWith("REF|"))
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString value = action->objectName().mid(4);
|
||||
DbgCmdExec(QString("findref \"" + value + "\", " + addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
|
@ -1055,9 +1055,9 @@ void CPUDisassembly::gotoNext()
|
|||
|
||||
void CPUDisassembly::findReferences()
|
||||
{
|
||||
QString addrStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrDisasm = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrDisasm = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findrefrange " + addrStart + ", " + addrEnd + ", " + addrDisasm).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1065,25 +1065,25 @@ void CPUDisassembly::findReferences()
|
|||
void CPUDisassembly::findConstant()
|
||||
{
|
||||
WordEditDialog wordEdit(this);
|
||||
wordEdit.setup("Enter Constant", 0, sizeof(int_t));
|
||||
wordEdit.setup("Enter Constant", 0, sizeof(dsint));
|
||||
if(wordEdit.exec() != QDialog::Accepted) //cancel pressed
|
||||
return;
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString constText = QString("%1").arg(wordEdit.getVal(), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString constText = QString("%1").arg(wordEdit.getVal(), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findref " + constText + ", " + addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
||||
void CPUDisassembly::findStrings()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("strref " + addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
||||
void CPUDisassembly::findCalls()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("modcallfind " + addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1096,10 +1096,10 @@ void CPUDisassembly::findPattern()
|
|||
hexEdit.setWindowTitle("Find Pattern...");
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t addr = rvaToVa(getSelectionStart());
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
QString addrText = QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findall " + addrText + ", " + hexEdit.mHexEdit->pattern()).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1113,10 +1113,10 @@ void CPUDisassembly::selectionGet(SELECTIONDATA* selection)
|
|||
|
||||
void CPUDisassembly::selectionSet(const SELECTIONDATA* selection)
|
||||
{
|
||||
int_t selMin = getBase();
|
||||
int_t selMax = selMin + getSize();
|
||||
int_t start = selection->start;
|
||||
int_t end = selection->end;
|
||||
dsint selMin = getBase();
|
||||
dsint selMax = selMin + getSize();
|
||||
dsint start = selection->start;
|
||||
dsint end = selection->end;
|
||||
if(start < selMin || start >= selMax || end < selMin || end >= selMax) //selection out of range
|
||||
{
|
||||
Bridge::getBridge()->setResult(0);
|
||||
|
@ -1140,17 +1140,17 @@ void CPUDisassembly::enableHighlightingMode()
|
|||
void CPUDisassembly::binaryEditSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
delete [] data;
|
||||
hexEdit.setWindowTitle("Edit code at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
hexEdit.setWindowTitle("Edit code at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t dataSize = hexEdit.mHexEdit->data().size();
|
||||
int_t newSize = selSize > dataSize ? selSize : dataSize;
|
||||
dsint dataSize = hexEdit.mHexEdit->data().size();
|
||||
dsint newSize = selSize > dataSize ? selSize : dataSize;
|
||||
data = new byte_t[newSize];
|
||||
mMemPage->read(data, selStart, newSize);
|
||||
QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, newSize));
|
||||
|
@ -1162,12 +1162,12 @@ void CPUDisassembly::binaryFillSlot()
|
|||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
int_t selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill code at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
dsint selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill code at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
QString pattern = hexEdit.mHexEdit->pattern();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -1181,8 +1181,8 @@ void CPUDisassembly::binaryFillSlot()
|
|||
void CPUDisassembly::binaryFillNopsSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -1196,8 +1196,8 @@ void CPUDisassembly::binaryFillNopsSlot()
|
|||
void CPUDisassembly::binaryCopySlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -1208,8 +1208,8 @@ void CPUDisassembly::binaryCopySlot()
|
|||
void CPUDisassembly::binaryPasteSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -1224,8 +1224,8 @@ void CPUDisassembly::binaryPasteSlot()
|
|||
|
||||
void CPUDisassembly::undoSelectionSlot()
|
||||
{
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(!DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
return;
|
||||
DbgFunctions()->PatchRestoreRange(start, end);
|
||||
|
@ -1235,8 +1235,8 @@ void CPUDisassembly::undoSelectionSlot()
|
|||
void CPUDisassembly::binaryPasteIgnoreSizeSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -1258,7 +1258,7 @@ void CPUDisassembly::yaraSlot()
|
|||
YaraRuleSelectionDialog yaraDialog(this);
|
||||
if(yaraDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("yara \"%0\",%1").arg(yaraDialog.getSelectedFile()).arg(addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1276,7 +1276,7 @@ void CPUDisassembly::copySelection(bool copyBytes)
|
|||
{
|
||||
if(i)
|
||||
clipboard += "\r\n";
|
||||
int_t cur_addr = rvaToVa(instBuffer.at(i).rva);
|
||||
dsint cur_addr = rvaToVa(instBuffer.at(i).rva);
|
||||
QString address = getAddrText(cur_addr, 0);
|
||||
QString bytes;
|
||||
for(int j = 0; j < instBuffer.at(i).dump.size(); j++)
|
||||
|
@ -1318,14 +1318,14 @@ void CPUDisassembly::copySelectionNoBytes()
|
|||
|
||||
void CPUDisassembly::copyAddress()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
Bridge::CopyToClipboard(addrText);
|
||||
}
|
||||
|
||||
void CPUDisassembly::copyRva()
|
||||
{
|
||||
uint_t addr = rvaToVa(getInitialSelection());
|
||||
uint_t base = DbgFunctions()->ModBaseFromAddr(addr);
|
||||
duint addr = rvaToVa(getInitialSelection());
|
||||
duint base = DbgFunctions()->ModBaseFromAddr(addr);
|
||||
if(base)
|
||||
{
|
||||
QString addrText = QString("%1").arg(addr - base, 0, 16, QChar('0')).toUpper();
|
||||
|
@ -1368,7 +1368,7 @@ void CPUDisassembly::findCommand()
|
|||
char error[MAX_ERROR_SIZE] = "";
|
||||
unsigned char dest[16];
|
||||
int asmsize = 0;
|
||||
uint_t va = rvaToVa(getInitialSelection());
|
||||
duint va = rvaToVa(getInitialSelection());
|
||||
|
||||
if(!DbgFunctions()->Assemble(va + mMemPage->getSize() / 2, dest, &asmsize, mLineEdit.editText.toUtf8().constData(), error))
|
||||
{
|
||||
|
@ -1380,11 +1380,11 @@ void CPUDisassembly::findCommand()
|
|||
return;
|
||||
}
|
||||
|
||||
QString addr_text = QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
|
||||
if(!mLineEdit.bChecked)
|
||||
{
|
||||
int_t size = mMemPage->getSize();
|
||||
dsint size = mMemPage->getSize();
|
||||
DbgCmdExec(QString("findasm \"%1\", %2, .%3").arg(mLineEdit.editText).arg(addr_text).arg(size).toUtf8().constData());
|
||||
}
|
||||
else
|
||||
|
@ -1405,15 +1405,15 @@ void CPUDisassembly::openSource()
|
|||
|
||||
void CPUDisassembly::decompileSelection()
|
||||
{
|
||||
int_t addr = rvaToVa(getSelectionStart());
|
||||
int_t size = getSelectionSize();
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
dsint size = getSelectionSize();
|
||||
emit displaySnowmanWidget();
|
||||
emit decompileAt(addr, addr + size);
|
||||
}
|
||||
|
||||
void CPUDisassembly::decompileFunction()
|
||||
{
|
||||
int_t addr = rvaToVa(getInitialSelection());
|
||||
dsint addr = rvaToVa(getInitialSelection());
|
||||
duint start;
|
||||
duint end;
|
||||
if(DbgFunctionGet(addr, &start, &end))
|
||||
|
|
|
@ -18,9 +18,9 @@ public:
|
|||
|
||||
// Context Menu Management
|
||||
void setupRightClickContextMenu();
|
||||
void addFollowReferenceMenuItem(QString name, int_t value, QMenu* menu, bool isReferences);
|
||||
void setupFollowReferenceMenu(int_t wVA, QMenu* menu, bool isReferences);
|
||||
void setHwBpAt(uint_t va, int slot);
|
||||
void addFollowReferenceMenuItem(QString name, dsint value, QMenu* menu, bool isReferences);
|
||||
void setupFollowReferenceMenu(dsint wVA, QMenu* menu, bool isReferences);
|
||||
void setHwBpAt(duint va, int slot);
|
||||
|
||||
void copySelection(bool copyBytes);
|
||||
|
||||
|
@ -28,7 +28,7 @@ signals:
|
|||
void displayReferencesWidget();
|
||||
void displaySourceManagerWidget();
|
||||
void showPatches();
|
||||
void decompileAt(int_t start, int_t end);
|
||||
void decompileAt(dsint start, dsint end);
|
||||
void displaySnowmanWidget();
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -76,7 +76,7 @@ CPUDump::CPUDump(CPUDisassembly* disas, QWidget* parent) : HexDump(parent)
|
|||
break;
|
||||
}
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(dumpAt(int_t)), this, SLOT(printDumpAt(int_t)));
|
||||
connect(Bridge::getBridge(), SIGNAL(dumpAt(dsint)), this, SLOT(printDumpAt(dsint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionDumpGet(SELECTIONDATA*)), this, SLOT(selectionGet(SELECTIONDATA*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionDumpSet(const SELECTIONDATA*)), this, SLOT(selectionSet(const SELECTIONDATA*)));
|
||||
connect(this, SIGNAL(selectionUpdated()), this, SLOT(selectionUpdatedSlot()));
|
||||
|
@ -441,7 +441,7 @@ void CPUDump::refreshShortcutsSlot()
|
|||
mCopyAddress->setShortcut(ConfigShortcut("ActionCopyAddress"));
|
||||
}
|
||||
|
||||
QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString CPUDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
// Reset byte offset when base address is reached
|
||||
if(rowBase == 0 && mByteOffset != 0)
|
||||
|
@ -452,10 +452,10 @@ QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
|
|||
{
|
||||
char label[MAX_LABEL_SIZE] = "";
|
||||
QString addrText = "";
|
||||
int_t cur_addr = rvaToVa((rowBase + rowOffset) * getBytePerRowCount() - mByteOffset);
|
||||
dsint cur_addr = rvaToVa((rowBase + rowOffset) * getBytePerRowCount() - mByteOffset);
|
||||
if(mRvaDisplayEnabled) //RVA display
|
||||
{
|
||||
int_t rva = cur_addr - mRvaDisplayBase;
|
||||
dsint rva = cur_addr - mRvaDisplayBase;
|
||||
if(rva == 0)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
|
@ -481,7 +481,7 @@ QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
|
|||
#endif //_WIN64
|
||||
}
|
||||
}
|
||||
addrText += QString("%1").arg(cur_addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
addrText += QString("%1").arg(cur_addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) //has label
|
||||
{
|
||||
char module[MAX_MODULE_SIZE] = "";
|
||||
|
@ -510,9 +510,9 @@ QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i
|
|||
}
|
||||
else if(col && mDescriptor.at(col - 1).isData == false && mDescriptor.at(col - 1).itemCount == 1) //print comments
|
||||
{
|
||||
uint_t data = 0;
|
||||
int_t wRva = (rowBase + rowOffset) * getBytePerRowCount() - mByteOffset;
|
||||
mMemPage->read((byte_t*)&data, wRva, sizeof(uint_t));
|
||||
duint data = 0;
|
||||
dsint wRva = (rowBase + rowOffset) * getBytePerRowCount() - mByteOffset;
|
||||
mMemPage->read((byte_t*)&data, wRva, sizeof(duint));
|
||||
char modname[MAX_MODULE_SIZE] = "";
|
||||
if(!DbgGetModuleAt(data, modname))
|
||||
modname[0] = '\0';
|
||||
|
@ -532,21 +532,21 @@ void CPUDump::contextMenuEvent(QContextMenuEvent* event)
|
|||
if(!DbgIsDebugging())
|
||||
return;
|
||||
|
||||
int_t selectedAddr = rvaToVa(getInitialSelection());
|
||||
dsint selectedAddr = rvaToVa(getInitialSelection());
|
||||
|
||||
QMenu* wMenu = new QMenu(this); //create context menu
|
||||
wMenu->addMenu(mBinaryMenu);
|
||||
wMenu->addMenu(mCopyMenu);
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
wMenu->addAction(mUndoSelection);
|
||||
if(DbgMemIsValidReadPtr(start) && DbgMemFindBaseAddr(start, 0) == DbgMemFindBaseAddr(DbgValFromString("csp"), 0))
|
||||
wMenu->addAction(mFollowStack);
|
||||
wMenu->addAction(mFollowInDisasm);
|
||||
|
||||
uint_t ptr = 0;
|
||||
DbgMemRead(selectedAddr, (unsigned char*)&ptr, sizeof(uint_t));
|
||||
duint ptr = 0;
|
||||
DbgMemRead(selectedAddr, (unsigned char*)&ptr, sizeof(duint));
|
||||
if(DbgMemIsValidReadPtr(ptr))
|
||||
{
|
||||
wMenu->addAction(mFollowData);
|
||||
|
@ -614,10 +614,10 @@ void CPUDump::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
case 0: //address
|
||||
{
|
||||
//very ugly way to calculate the base of the current row (no clue why it works)
|
||||
int_t deltaRowBase = getInitialSelection() % getBytePerRowCount() + mByteOffset;
|
||||
dsint deltaRowBase = getInitialSelection() % getBytePerRowCount() + mByteOffset;
|
||||
if(deltaRowBase >= getBytePerRowCount())
|
||||
deltaRowBase -= getBytePerRowCount();
|
||||
int_t mSelectedVa = rvaToVa(getInitialSelection() - deltaRowBase);
|
||||
dsint mSelectedVa = rvaToVa(getInitialSelection() - deltaRowBase);
|
||||
if(mRvaDisplayEnabled && mSelectedVa == mRvaDisplayBase)
|
||||
mRvaDisplayEnabled = false;
|
||||
else
|
||||
|
@ -643,9 +643,9 @@ void CPUDump::setLabelSlot()
|
|||
if(!DbgIsDebugging())
|
||||
return;
|
||||
|
||||
uint_t wVA = rvaToVa(getSelectionStart());
|
||||
duint wVA = rvaToVa(getSelectionStart());
|
||||
LineEditDialog mLineEdit(this);
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
char label_text[MAX_COMMENT_SIZE] = "";
|
||||
if(DbgGetLabelAt((duint)wVA, SEG_DEFAULT, label_text))
|
||||
mLineEdit.setText(QString(label_text));
|
||||
|
@ -693,26 +693,26 @@ void CPUDump::gotoFileOffsetSlot()
|
|||
mGotoDialog.setWindowTitle("Goto File Offset in " + QString(modname));
|
||||
if(mGotoDialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
uint_t value = DbgValFromString(mGotoDialog.expressionText.toUtf8().constData());
|
||||
duint value = DbgValFromString(mGotoDialog.expressionText.toUtf8().constData());
|
||||
value = DbgFunctions()->FileOffsetToVa(modname, value);
|
||||
DbgCmdExec(QString().sprintf("dump \"%p\"", value).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::gotoStartSlot()
|
||||
{
|
||||
uint_t dest = mMemPage->getBase();
|
||||
duint dest = mMemPage->getBase();
|
||||
DbgCmdExec(QString().sprintf("dump \"%p\"", dest).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::gotoEndSlot()
|
||||
{
|
||||
uint_t dest = mMemPage->getBase() + mMemPage->getSize() - (getViewableRowsCount() * getBytePerRowCount());
|
||||
duint dest = mMemPage->getBase() + mMemPage->getSize() - (getViewableRowsCount() * getBytePerRowCount());
|
||||
DbgCmdExec(QString().sprintf("dump \"%p\"", dest).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hexAsciiSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewHexAscii);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewHexAscii);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -746,7 +746,7 @@ void CPUDump::hexAsciiSlot()
|
|||
|
||||
void CPUDump::hexUnicodeSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewHexUnicode);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewHexUnicode);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -780,7 +780,7 @@ void CPUDump::hexUnicodeSlot()
|
|||
|
||||
void CPUDump::textAsciiSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewTextAscii);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewTextAscii);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -806,7 +806,7 @@ void CPUDump::textAsciiSlot()
|
|||
|
||||
void CPUDump::textUnicodeSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewTextUnicode);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewTextUnicode);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -832,7 +832,7 @@ void CPUDump::textUnicodeSlot()
|
|||
|
||||
void CPUDump::integerSignedShortSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerSignedShort);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerSignedShort);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -857,7 +857,7 @@ void CPUDump::integerSignedShortSlot()
|
|||
|
||||
void CPUDump::integerSignedLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerSignedLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerSignedLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -882,7 +882,7 @@ void CPUDump::integerSignedLongSlot()
|
|||
|
||||
void CPUDump::integerSignedLongLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerSignedLongLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerSignedLongLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -907,7 +907,7 @@ void CPUDump::integerSignedLongLongSlot()
|
|||
|
||||
void CPUDump::integerUnsignedShortSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerUnsignedShort);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerUnsignedShort);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -932,7 +932,7 @@ void CPUDump::integerUnsignedShortSlot()
|
|||
|
||||
void CPUDump::integerUnsignedLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerUnsignedLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerUnsignedLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -957,7 +957,7 @@ void CPUDump::integerUnsignedLongSlot()
|
|||
|
||||
void CPUDump::integerUnsignedLongLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerUnsignedLongLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerUnsignedLongLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -982,7 +982,7 @@ void CPUDump::integerUnsignedLongLongSlot()
|
|||
|
||||
void CPUDump::integerHexShortSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerHexShort);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerHexShort);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1007,7 +1007,7 @@ void CPUDump::integerHexShortSlot()
|
|||
|
||||
void CPUDump::integerHexLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerHexLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerHexLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1032,7 +1032,7 @@ void CPUDump::integerHexLongSlot()
|
|||
|
||||
void CPUDump::integerHexLongLongSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewIntegerHexLongLong);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewIntegerHexLongLong);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1057,7 +1057,7 @@ void CPUDump::integerHexLongLongSlot()
|
|||
|
||||
void CPUDump::floatFloatSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewFloatFloat);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewFloatFloat);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1082,7 +1082,7 @@ void CPUDump::floatFloatSlot()
|
|||
|
||||
void CPUDump::floatDoubleSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewFloatDouble);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewFloatDouble);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1107,7 +1107,7 @@ void CPUDump::floatDoubleSlot()
|
|||
|
||||
void CPUDump::floatLongDoubleSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewFloatLongDouble);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewFloatLongDouble);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1132,7 +1132,7 @@ void CPUDump::floatLongDoubleSlot()
|
|||
|
||||
void CPUDump::addressSlot()
|
||||
{
|
||||
Config()->setUint("HexDump", "DefaultView", (uint_t)ViewAddress);
|
||||
Config()->setUint("HexDump", "DefaultView", (duint)ViewAddress);
|
||||
int charwidth = getCharWidth();
|
||||
ColumnDescriptor_t wColDesc;
|
||||
DataDescriptor_t dDesc;
|
||||
|
@ -1147,7 +1147,7 @@ void CPUDump::addressSlot()
|
|||
wColDesc.data.itemSize = Dword;
|
||||
wColDesc.data.dwordMode = HexDword;
|
||||
#endif
|
||||
appendResetDescriptor(8 + charwidth * 2 * sizeof(uint_t), "Address", false, wColDesc);
|
||||
appendResetDescriptor(8 + charwidth * 2 * sizeof(duint), "Address", false, wColDesc);
|
||||
|
||||
wColDesc.isData = false; //comments
|
||||
wColDesc.itemCount = 1;
|
||||
|
@ -1178,10 +1178,10 @@ void CPUDump::selectionGet(SELECTIONDATA* selection)
|
|||
|
||||
void CPUDump::selectionSet(const SELECTIONDATA* selection)
|
||||
{
|
||||
int_t selMin = mMemPage->getBase();
|
||||
int_t selMax = selMin + mMemPage->getSize();
|
||||
int_t start = selection->start;
|
||||
int_t end = selection->end;
|
||||
dsint selMin = mMemPage->getBase();
|
||||
dsint selMax = selMin + mMemPage->getSize();
|
||||
dsint start = selection->start;
|
||||
dsint end = selection->end;
|
||||
if(start < selMin || start >= selMax || end < selMin || end >= selMax) //selection out of range
|
||||
{
|
||||
Bridge::getBridge()->setResult(0);
|
||||
|
@ -1195,111 +1195,111 @@ void CPUDump::selectionSet(const SELECTIONDATA* selection)
|
|||
|
||||
void CPUDump::memoryAccessSingleshootSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 0, r").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryAccessRestoreSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 1, r").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryWriteSingleshootSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 0, w").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryWriteRestoreSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 1, w").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryExecuteSingleshootSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 0, x").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryExecuteRestoreSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 1, x").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::memoryRemoveSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bpmc " + addr_text).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareAccess1Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 1").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareAccess2Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 2").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareAccess4Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 4").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareAccess8Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 8").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareWrite1Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 1").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareWrite2Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 2").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareWrite4Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 4").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareWrite8Slot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 8").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareExecuteSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", x").toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::hardwareRemoveSlot()
|
||||
{
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addr_text = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("bphwc " + addr_text).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::findReferencesSlot()
|
||||
{
|
||||
QString addrStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrDisasm = QString("%1").arg(mDisas->rvaToVa(mDisas->getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrDisasm = QString("%1").arg(mDisas->rvaToVa(mDisas->getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findrefrange " + addrStart + ", " + addrEnd + ", " + addrDisasm).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1307,17 +1307,17 @@ void CPUDump::findReferencesSlot()
|
|||
void CPUDump::binaryEditSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
delete [] data;
|
||||
hexEdit.setWindowTitle("Edit data at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
hexEdit.setWindowTitle("Edit data at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t dataSize = hexEdit.mHexEdit->data().size();
|
||||
int_t newSize = selSize > dataSize ? selSize : dataSize;
|
||||
dsint dataSize = hexEdit.mHexEdit->data().size();
|
||||
dsint newSize = selSize > dataSize ? selSize : dataSize;
|
||||
data = new byte_t[newSize];
|
||||
mMemPage->read(data, selStart, newSize);
|
||||
QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, newSize));
|
||||
|
@ -1329,12 +1329,12 @@ void CPUDump::binaryFillSlot()
|
|||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
int_t selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill data at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
dsint selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill data at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
QString pattern = hexEdit.mHexEdit->pattern();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -1348,8 +1348,8 @@ void CPUDump::binaryFillSlot()
|
|||
void CPUDump::binaryCopySlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -1360,8 +1360,8 @@ void CPUDump::binaryCopySlot()
|
|||
void CPUDump::binaryPasteSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -1377,8 +1377,8 @@ void CPUDump::binaryPasteSlot()
|
|||
void CPUDump::binaryPasteIgnoreSizeSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -1398,18 +1398,18 @@ void CPUDump::findPattern()
|
|||
hexEdit.setWindowTitle("Find Pattern...");
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t addr = rvaToVa(getSelectionStart());
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
QString addrText = QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findall " + addrText + ", " + hexEdit.mHexEdit->pattern() + ", &data&").toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
||||
void CPUDump::undoSelectionSlot()
|
||||
{
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(!DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
return;
|
||||
DbgFunctions()->PatchRestoreRange(start, end);
|
||||
|
@ -1418,32 +1418,32 @@ void CPUDump::undoSelectionSlot()
|
|||
|
||||
void CPUDump::followStackSlot()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("sdump " + addrText).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::followInDisasmSlot()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("disasm " + addrText).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::followDataSlot()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("disasm [%1]").arg(addrText).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::followDataDumpSlot()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("dump [%1]").arg(addrText).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUDump::selectionUpdatedSlot()
|
||||
{
|
||||
QString selStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString selEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString selStart = QString("%1").arg(rvaToVa(getSelectionStart()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString selEnd = QString("%1").arg(rvaToVa(getSelectionEnd()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString info = "Dump";
|
||||
char mod[MAX_MODULE_SIZE] = "";
|
||||
if(DbgFunctions()->ModNameFromAddr(rvaToVa(getSelectionStart()), mod, true))
|
||||
|
@ -1456,7 +1456,7 @@ void CPUDump::yaraSlot()
|
|||
YaraRuleSelectionDialog yaraDialog(this);
|
||||
if(yaraDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("yara \"%0\",%1").arg(yaraDialog.getSelectedFile()).arg(addrText).toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
@ -1464,8 +1464,8 @@ void CPUDump::yaraSlot()
|
|||
|
||||
void CPUDump::dataCopySlot()
|
||||
{
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QVector<byte_t> data;
|
||||
data.resize(selSize);
|
||||
mMemPage->read(data.data(), selStart, selSize);
|
||||
|
@ -1475,8 +1475,8 @@ void CPUDump::dataCopySlot()
|
|||
|
||||
void CPUDump::entropySlot()
|
||||
{
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QVector<byte_t> data;
|
||||
data.resize(selSize);
|
||||
mMemPage->read(data.data(), selStart, selSize);
|
||||
|
@ -1490,14 +1490,14 @@ void CPUDump::entropySlot()
|
|||
|
||||
void CPUDump::copyAddressSlot()
|
||||
{
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
Bridge::CopyToClipboard(addrText);
|
||||
}
|
||||
|
||||
void CPUDump::copyRvaSlot()
|
||||
{
|
||||
uint_t addr = rvaToVa(getInitialSelection());
|
||||
uint_t base = DbgFunctions()->ModBaseFromAddr(addr);
|
||||
duint addr = rvaToVa(getInitialSelection());
|
||||
duint base = DbgFunctions()->ModBaseFromAddr(addr);
|
||||
if(base)
|
||||
{
|
||||
QString addrText = QString("%1").arg(addr - base, 0, 16, QChar('0')).toUpper();
|
||||
|
|
|
@ -10,7 +10,7 @@ class CPUDump : public HexDump
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit CPUDump(CPUDisassembly* disas, QWidget* parent = 0);
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void setupContextMenu();
|
||||
void contextMenuEvent(QContextMenuEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
|
|
|
@ -50,7 +50,7 @@ void CPUInfoBox::clear()
|
|||
setInfoLine(2, "");
|
||||
}
|
||||
|
||||
QString CPUInfoBox::getSymbolicName(int_t addr)
|
||||
QString CPUInfoBox::getSymbolicName(dsint addr)
|
||||
{
|
||||
char labelText[MAX_LABEL_SIZE] = "";
|
||||
char moduleText[MAX_MODULE_SIZE] = "";
|
||||
|
@ -59,7 +59,7 @@ QString CPUInfoBox::getSymbolicName(int_t addr)
|
|||
bool bHasLabel = DbgGetLabelAt(addr, SEG_DEFAULT, labelText);
|
||||
bool bHasModule = (DbgGetModuleAt(addr, moduleText) && !QString(labelText).startsWith("JMP.&"));
|
||||
QString addrText;
|
||||
addrText = QString("%1").arg(addr & (uint_t) - 1, 0, 16, QChar('0')).toUpper();
|
||||
addrText = QString("%1").arg(addr & (duint) - 1, 0, 16, QChar('0')).toUpper();
|
||||
QString finalText;
|
||||
if(bHasString)
|
||||
finalText = addrText + " " + QString(string);
|
||||
|
@ -88,7 +88,7 @@ QString CPUInfoBox::getSymbolicName(int_t addr)
|
|||
return finalText;
|
||||
}
|
||||
|
||||
void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
||||
void CPUInfoBox::disasmSelectionChanged(dsint parVA)
|
||||
{
|
||||
curAddr = parVA;
|
||||
if(!DbgIsDebugging() || !DbgMemIsValidReadPtr(parVA))
|
||||
|
@ -149,7 +149,7 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
|||
else
|
||||
{
|
||||
QString addrText;
|
||||
if(memsize == sizeof(int_t))
|
||||
if(memsize == sizeof(dsint))
|
||||
addrText = getSymbolicName(arg.memvalue);
|
||||
else
|
||||
addrText = QString("%1").arg(arg.memvalue, memsize * 2, 16, QChar('0')).toUpper();
|
||||
|
@ -175,7 +175,7 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA)
|
|||
char mod[MAX_MODULE_SIZE] = "";
|
||||
if(DbgFunctions()->ModNameFromAddr(parVA, mod, true))
|
||||
{
|
||||
int_t modbase = DbgFunctions()->ModBaseFromAddr(parVA);
|
||||
dsint modbase = DbgFunctions()->ModBaseFromAddr(parVA);
|
||||
if(modbase)
|
||||
info = QString(mod) + "[" + QString("%1").arg(parVA - modbase, 0, 16, QChar('0')).toUpper() + "] | ";
|
||||
else
|
||||
|
@ -204,7 +204,7 @@ void CPUInfoBox::followActionSlot()
|
|||
DbgCmdExec(QString().sprintf("dump \"%s\"", action->objectName().mid(5).toUtf8().constData()).toUtf8().constData());
|
||||
}
|
||||
|
||||
void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, int_t value)
|
||||
void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, dsint value)
|
||||
{
|
||||
foreach(QAction * action, menu->actions()) //check for duplicate action
|
||||
if(action->text() == name)
|
||||
|
@ -212,11 +212,11 @@ void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, int_t value)
|
|||
QAction* newAction = new QAction(name, this);
|
||||
newAction->setFont(QFont("Courier New", 8));
|
||||
menu->addAction(newAction);
|
||||
newAction->setObjectName(QString("DUMP|") + QString("%1").arg(value, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
newAction->setObjectName(QString("DUMP|") + QString("%1").arg(value, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
connect(newAction, SIGNAL(triggered()), this, SLOT(followActionSlot()));
|
||||
}
|
||||
|
||||
void CPUInfoBox::setupFollowMenu(QMenu* menu, int_t wVA)
|
||||
void CPUInfoBox::setupFollowMenu(QMenu* menu, dsint wVA)
|
||||
{
|
||||
//most basic follow action
|
||||
addFollowMenuItem(menu, "&Selection", wVA);
|
||||
|
|
|
@ -9,18 +9,18 @@ class CPUInfoBox : public StdTable
|
|||
public:
|
||||
explicit CPUInfoBox(StdTable* parent = 0);
|
||||
int getHeight();
|
||||
void addFollowMenuItem(QMenu* menu, QString name, int_t value);
|
||||
void setupFollowMenu(QMenu* menu, int_t wVA);
|
||||
void addFollowMenuItem(QMenu* menu, QString name, dsint value);
|
||||
void setupFollowMenu(QMenu* menu, dsint wVA);
|
||||
|
||||
public slots:
|
||||
void disasmSelectionChanged(int_t parVA);
|
||||
void disasmSelectionChanged(dsint parVA);
|
||||
void dbgStateChanged(DBGSTATE state);
|
||||
void contextMenuSlot(QPoint pos);
|
||||
void followActionSlot();
|
||||
|
||||
private:
|
||||
int_t curAddr;
|
||||
QString getSymbolicName(int_t addr);
|
||||
dsint curAddr;
|
||||
QString getSymbolicName(dsint addr);
|
||||
void setInfoLine(int line, QString text);
|
||||
QString getInfoLine(int line);
|
||||
void clear();
|
||||
|
|
|
@ -43,7 +43,7 @@ void CPUSideBar::repaint()
|
|||
viewport()->repaint();
|
||||
}
|
||||
|
||||
void CPUSideBar::changeTopmostAddress(int_t i)
|
||||
void CPUSideBar::changeTopmostAddress(dsint i)
|
||||
{
|
||||
if(i != topVA)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ void CPUSideBar::setViewableRows(int rows)
|
|||
viewableRows = rows;
|
||||
}
|
||||
|
||||
void CPUSideBar::setSelection(int_t selVA)
|
||||
void CPUSideBar::setSelection(dsint selVA)
|
||||
{
|
||||
if(selVA != selectedVA)
|
||||
{
|
||||
|
@ -73,9 +73,9 @@ bool CPUSideBar::isJump(int i) const
|
|||
int BranchType = InstrBuffer->at(i).disasm.Instruction.BranchType;
|
||||
if(BranchType && BranchType != RetType && BranchType != CallType)
|
||||
{
|
||||
uint_t start = CodePtr->getBase();
|
||||
uint_t end = start + CodePtr->getSize();
|
||||
uint_t addr = DbgGetBranchDestination(CodePtr->rvaToVa(InstrBuffer->at(i).rva));
|
||||
duint start = CodePtr->getBase();
|
||||
duint end = start + CodePtr->getSize();
|
||||
duint addr = DbgGetBranchDestination(CodePtr->rvaToVa(InstrBuffer->at(i).rva));
|
||||
return addr >= start && addr < end; //do not draw jumps that go out of the section
|
||||
}
|
||||
return false;
|
||||
|
@ -95,15 +95,15 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
|
|||
|
||||
int jumpoffset = 0;
|
||||
|
||||
int_t last_va = InstrBuffer->last().rva + CodePtr->getBase();
|
||||
int_t first_va = InstrBuffer->first().rva + CodePtr->getBase();
|
||||
dsint last_va = InstrBuffer->last().rva + CodePtr->getBase();
|
||||
dsint first_va = InstrBuffer->first().rva + CodePtr->getBase();
|
||||
|
||||
for(int line = 0; line < viewableRows; line++)
|
||||
{
|
||||
if(line >= InstrBuffer->size()) //at the end of the page it will crash otherwise
|
||||
break;
|
||||
Instruction_t instr = InstrBuffer->at(line);
|
||||
int_t instrVA = instr.rva + CodePtr->getBase();
|
||||
dsint instrVA = instr.rva + CodePtr->getBase();
|
||||
|
||||
// draw bullet
|
||||
drawBullets(&painter, line, DbgGetBpxTypeAt(instrVA) != bp_none, DbgIsBpDisabled(instrVA), DbgGetBookmarkAt(instrVA));
|
||||
|
@ -120,7 +120,7 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
|
|||
|
||||
jumpoffset++;
|
||||
|
||||
int_t destVA = (int_t)DbgGetBranchDestination(CodePtr->rvaToVa(instr.rva));
|
||||
dsint destVA = (dsint)DbgGetBranchDestination(CodePtr->rvaToVa(instr.rva));
|
||||
|
||||
if(instr.disasm.Instruction.Opcode == 0xFF)
|
||||
continue;
|
||||
|
@ -156,7 +156,7 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
|
|||
drawLabel(&painter, line, "EIP");
|
||||
#endif
|
||||
|
||||
const int_t cur_VA = CodePtr->getBase() + InstrBuffer->at(line).rva;
|
||||
const dsint cur_VA = CodePtr->getBase() + InstrBuffer->at(line).rva;
|
||||
#ifdef _WIN64
|
||||
if(cur_VA == regDump.regcontext.cax) drawLabel(&painter, line, "RAX");
|
||||
if(cur_VA == regDump.regcontext.cbx) drawLabel(&painter, line, "RBX");
|
||||
|
@ -196,7 +196,7 @@ void CPUSideBar::mouseReleaseEvent(QMouseEvent* e)
|
|||
return;
|
||||
|
||||
// calculate virtual adress of clicked line
|
||||
uint_t wVA = InstrBuffer->at(line).rva + CodePtr->getBase();
|
||||
duint wVA = InstrBuffer->at(line).rva + CodePtr->getBase();
|
||||
|
||||
QString wCmd;
|
||||
// create --> disable --> delete --> create --> ...
|
||||
|
@ -204,17 +204,17 @@ void CPUSideBar::mouseReleaseEvent(QMouseEvent* e)
|
|||
{
|
||||
case bp_enabled:
|
||||
// breakpoint exists and is enabled --> disable breakpoint
|
||||
wCmd = "bd " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bd " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
break;
|
||||
case bp_disabled:
|
||||
// is disabled --> delete
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
break;
|
||||
case bp_non_existent:
|
||||
// no breakpoint was found --> create breakpoint
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
break;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class CPUSideBar : public QAbstractScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
QPair<int_t, int_t> mHighlightedJump;
|
||||
QPair<dsint, dsint> mHighlightedJump;
|
||||
public:
|
||||
explicit CPUSideBar(CPUDisassembly* Ptr, QWidget* parent = 0);
|
||||
QSize sizeHint() const;
|
||||
|
@ -19,9 +19,9 @@ public:
|
|||
public slots:
|
||||
void debugStateChangedSlot(DBGSTATE state);
|
||||
void repaint();
|
||||
void changeTopmostAddress(int_t i);
|
||||
void changeTopmostAddress(dsint i);
|
||||
void setViewableRows(int rows);
|
||||
void setSelection(int_t selVA);
|
||||
void setSelection(dsint selVA);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* event);
|
||||
|
@ -33,8 +33,8 @@ protected:
|
|||
void drawJump(QPainter* painter, int startLine, int endLine, int jumpoffset, bool conditional, bool isexecute, bool isactive);
|
||||
|
||||
private:
|
||||
int_t topVA;
|
||||
int_t selectedVA;
|
||||
dsint topVA;
|
||||
dsint selectedVA;
|
||||
QFont m_DefaultFont;
|
||||
int fontWidth, fontHeight;
|
||||
int viewableRows;
|
||||
|
|
|
@ -25,7 +25,7 @@ CPUStack::CPUStack(QWidget* parent) : HexDump(parent)
|
|||
wColDesc.data.itemSize = Dword;
|
||||
wColDesc.data.dwordMode = HexDword;
|
||||
#endif
|
||||
appendDescriptor(8 + charwidth * 2 * sizeof(uint_t), "void*", false, wColDesc);
|
||||
appendDescriptor(8 + charwidth * 2 * sizeof(duint), "void*", false, wColDesc);
|
||||
|
||||
wColDesc.isData = false; //comments
|
||||
wColDesc.itemCount = 0;
|
||||
|
@ -35,7 +35,7 @@ CPUStack::CPUStack(QWidget* parent) : HexDump(parent)
|
|||
wColDesc.data = dDesc;
|
||||
appendDescriptor(2000, "Comments", false, wColDesc);
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(stackDumpAt(uint_t, uint_t)), this, SLOT(stackDumpAt(uint_t, uint_t)));
|
||||
connect(Bridge::getBridge(), SIGNAL(stackDumpAt(duint, duint)), this, SLOT(stackDumpAt(duint, duint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionStackGet(SELECTIONDATA*)), this, SLOT(selectionGet(SELECTIONDATA*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(selectionStackSet(const SELECTIONDATA*)), this, SLOT(selectionSet(const SELECTIONDATA*)));
|
||||
|
||||
|
@ -170,7 +170,7 @@ void CPUStack::refreshShortcutsSlot()
|
|||
mGotoExpression->setShortcut(ConfigShortcut("ActionGotoExpression"));
|
||||
}
|
||||
|
||||
QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString CPUStack::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
// Reset byte offset when base address is reached
|
||||
if(rowBase == 0 && mByteOffset != 0)
|
||||
|
@ -178,8 +178,8 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset,
|
|||
|
||||
// Compute RVA
|
||||
int wBytePerRowCount = getBytePerRowCount();
|
||||
int_t wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
uint_t wVa = rvaToVa(wRva);
|
||||
dsint wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
duint wVa = rvaToVa(wRva);
|
||||
|
||||
bool wIsSelected = isSelected(wRva);
|
||||
if(wIsSelected) //highlight if selected
|
||||
|
@ -195,10 +195,10 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset,
|
|||
{
|
||||
char label[MAX_LABEL_SIZE] = "";
|
||||
QString addrText = "";
|
||||
int_t cur_addr = rvaToVa((rowBase + rowOffset) * getBytePerRowCount() - mByteOffset);
|
||||
dsint cur_addr = rvaToVa((rowBase + rowOffset) * getBytePerRowCount() - mByteOffset);
|
||||
if(mRvaDisplayEnabled) //RVA display
|
||||
{
|
||||
int_t rva = cur_addr - mRvaDisplayBase;
|
||||
dsint rva = cur_addr - mRvaDisplayBase;
|
||||
if(rva == 0)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
|
@ -274,7 +274,7 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset,
|
|||
else if(mDescriptor.at(col - 1).isData == true) //paint stack data
|
||||
{
|
||||
int wBytePerRowCount = getBytePerRowCount();
|
||||
int_t wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
dsint wRva = (rowBase + rowOffset) * wBytePerRowCount - mByteOffset;
|
||||
printSelected(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
QList<RichTextPainter::CustomRichText_t> richText;
|
||||
getString(col - 1, wRva, &richText);
|
||||
|
@ -314,8 +314,8 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
|
|||
QMenu* wMenu = new QMenu(this); //create context menu
|
||||
wMenu->addAction(mModifyAction);
|
||||
wMenu->addMenu(mBinaryMenu);
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
wMenu->addAction(mUndoSelection);
|
||||
wMenu->addAction(mFindPatternAction);
|
||||
|
@ -323,12 +323,12 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
|
|||
wMenu->addAction(mGotoBp);
|
||||
wMenu->addAction(mGotoExpression);
|
||||
|
||||
uint_t selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(uint_t)))
|
||||
duint selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(duint)))
|
||||
if(DbgMemIsValidReadPtr(selectedData)) //data is a pointer
|
||||
{
|
||||
uint_t stackBegin = mMemPage->getBase();
|
||||
uint_t stackEnd = stackBegin + mMemPage->getSize();
|
||||
duint stackBegin = mMemPage->getBase();
|
||||
duint stackEnd = stackBegin + mMemPage->getSize();
|
||||
if(selectedData >= stackBegin && selectedData < stackEnd)
|
||||
wMenu->addAction(mFollowStack);
|
||||
else
|
||||
|
@ -351,10 +351,10 @@ void CPUStack::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
case 0: //address
|
||||
{
|
||||
//very ugly way to calculate the base of the current row (no clue why it works)
|
||||
int_t deltaRowBase = getInitialSelection() % getBytePerRowCount() + mByteOffset;
|
||||
dsint deltaRowBase = getInitialSelection() % getBytePerRowCount() + mByteOffset;
|
||||
if(deltaRowBase >= getBytePerRowCount())
|
||||
deltaRowBase -= getBytePerRowCount();
|
||||
int_t mSelectedVa = rvaToVa(getInitialSelection() - deltaRowBase);
|
||||
dsint mSelectedVa = rvaToVa(getInitialSelection() - deltaRowBase);
|
||||
if(mRvaDisplayEnabled && mSelectedVa == mRvaDisplayBase)
|
||||
mRvaDisplayEnabled = false;
|
||||
else
|
||||
|
@ -375,7 +375,7 @@ void CPUStack::mouseDoubleClickEvent(QMouseEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void CPUStack::stackDumpAt(uint_t addr, uint_t csp)
|
||||
void CPUStack::stackDumpAt(duint addr, duint csp)
|
||||
{
|
||||
mCsp = csp;
|
||||
printDumpAt(addr);
|
||||
|
@ -401,8 +401,8 @@ void CPUStack::gotoExpressionSlot()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
uint_t size = 0;
|
||||
uint_t base = DbgMemFindBaseAddr(mCsp, &size);
|
||||
duint size = 0;
|
||||
duint base = DbgMemFindBaseAddr(mCsp, &size);
|
||||
if(!mGoto)
|
||||
mGoto = new GotoDialog(this);
|
||||
mGoto->validRangeStart = base;
|
||||
|
@ -424,10 +424,10 @@ void CPUStack::selectionGet(SELECTIONDATA* selection)
|
|||
|
||||
void CPUStack::selectionSet(const SELECTIONDATA* selection)
|
||||
{
|
||||
int_t selMin = mMemPage->getBase();
|
||||
int_t selMax = selMin + mMemPage->getSize();
|
||||
int_t start = selection->start;
|
||||
int_t end = selection->end;
|
||||
dsint selMin = mMemPage->getBase();
|
||||
dsint selMax = selMin + mMemPage->getSize();
|
||||
dsint start = selection->start;
|
||||
dsint end = selection->end;
|
||||
if(start < selMin || start >= selMax || end < selMin || end >= selMax) //selection out of range
|
||||
{
|
||||
Bridge::getBridge()->setResult(0);
|
||||
|
@ -441,33 +441,33 @@ void CPUStack::selectionSet(const SELECTIONDATA* selection)
|
|||
|
||||
void CPUStack::followDisasmSlot()
|
||||
{
|
||||
uint_t selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(uint_t)))
|
||||
duint selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(duint)))
|
||||
if(DbgMemIsValidReadPtr(selectedData)) //data is a pointer
|
||||
{
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("disasm " + addrText).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
void CPUStack::followDumpSlot()
|
||||
{
|
||||
uint_t selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(uint_t)))
|
||||
duint selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(duint)))
|
||||
if(DbgMemIsValidReadPtr(selectedData)) //data is a pointer
|
||||
{
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("dump " + addrText).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
void CPUStack::followStackSlot()
|
||||
{
|
||||
uint_t selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(uint_t)))
|
||||
duint selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(duint)))
|
||||
if(DbgMemIsValidReadPtr(selectedData)) //data is a pointer
|
||||
{
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(selectedData, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("sdump " + addrText).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
@ -475,17 +475,17 @@ void CPUStack::followStackSlot()
|
|||
void CPUStack::binaryEditSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
delete [] data;
|
||||
hexEdit.setWindowTitle("Edit data at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
hexEdit.setWindowTitle("Edit data at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t dataSize = hexEdit.mHexEdit->data().size();
|
||||
int_t newSize = selSize > dataSize ? selSize : dataSize;
|
||||
dsint dataSize = hexEdit.mHexEdit->data().size();
|
||||
dsint newSize = selSize > dataSize ? selSize : dataSize;
|
||||
data = new byte_t[newSize];
|
||||
mMemPage->read(data, selStart, newSize);
|
||||
QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, newSize));
|
||||
|
@ -497,12 +497,12 @@ void CPUStack::binaryFillSlot()
|
|||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
hexEdit.mHexEdit->setOverwriteMode(false);
|
||||
int_t selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill data at " + QString("%1").arg(rvaToVa(selStart), sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
dsint selStart = getSelectionStart();
|
||||
hexEdit.setWindowTitle("Fill data at " + QString("%1").arg(rvaToVa(selStart), sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
QString pattern = hexEdit.mHexEdit->pattern();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -516,8 +516,8 @@ void CPUStack::binaryFillSlot()
|
|||
void CPUStack::binaryCopySlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
byte_t* data = new byte_t[selSize];
|
||||
mMemPage->read(data, selStart, selSize);
|
||||
hexEdit.mHexEdit->setData(QByteArray((const char*)data, selSize));
|
||||
|
@ -528,8 +528,8 @@ void CPUStack::binaryCopySlot()
|
|||
void CPUStack::binaryPasteSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -545,8 +545,8 @@ void CPUStack::binaryPasteSlot()
|
|||
void CPUStack::binaryPasteIgnoreSizeSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
int_t selStart = getSelectionStart();
|
||||
int_t selSize = getSelectionEnd() - selStart + 1;
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
hexEdit.mHexEdit->setData(clipboard->text());
|
||||
|
||||
|
@ -566,18 +566,18 @@ void CPUStack::findPattern()
|
|||
hexEdit.setWindowTitle("Find Pattern...");
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
int_t addr = rvaToVa(getSelectionStart());
|
||||
dsint addr = rvaToVa(getSelectionStart());
|
||||
if(hexEdit.entireBlock())
|
||||
addr = DbgMemFindBaseAddr(addr, 0);
|
||||
QString addrText = QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findall " + addrText + ", " + hexEdit.mHexEdit->pattern() + ", &data&").toUtf8().constData());
|
||||
emit displayReferencesWidget();
|
||||
}
|
||||
|
||||
void CPUStack::undoSelectionSlot()
|
||||
{
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
dsint start = rvaToVa(getSelectionStart());
|
||||
dsint end = rvaToVa(getSelectionEnd());
|
||||
if(!DbgFunctions()->PatchInRange(start, end)) //nothing patched in selected range
|
||||
return;
|
||||
DbgFunctions()->PatchRestoreRange(start, end);
|
||||
|
@ -586,14 +586,14 @@ void CPUStack::undoSelectionSlot()
|
|||
|
||||
void CPUStack::modifySlot()
|
||||
{
|
||||
int_t addr = getInitialSelection();
|
||||
dsint addr = getInitialSelection();
|
||||
WordEditDialog wEditDialog(this);
|
||||
int_t value = 0;
|
||||
mMemPage->read(&value, addr, sizeof(int_t));
|
||||
wEditDialog.setup("Modify", value, sizeof(int_t));
|
||||
dsint value = 0;
|
||||
mMemPage->read(&value, addr, sizeof(dsint));
|
||||
wEditDialog.setup("Modify", value, sizeof(dsint));
|
||||
if(wEditDialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
value = wEditDialog.getVal();
|
||||
mMemPage->write(&value, addr, sizeof(int_t));
|
||||
mMemPage->write(&value, addr, sizeof(dsint));
|
||||
reloadData();
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
explicit CPUStack(QWidget* parent = 0);
|
||||
void colorsUpdated();
|
||||
void fontsUpdated();
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void contextMenuEvent(QContextMenuEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
void setupContextMenu();
|
||||
|
@ -21,7 +21,7 @@ signals:
|
|||
|
||||
public slots:
|
||||
void refreshShortcutsSlot();
|
||||
void stackDumpAt(uint_t addr, uint_t csp);
|
||||
void stackDumpAt(duint addr, duint csp);
|
||||
void gotoSpSlot();
|
||||
void gotoBpSlot();
|
||||
void gotoExpressionSlot();
|
||||
|
@ -40,7 +40,7 @@ public slots:
|
|||
void modifySlot();
|
||||
|
||||
private:
|
||||
uint_t mCsp;
|
||||
duint mCsp;
|
||||
|
||||
QMenu* mBinaryMenu;
|
||||
QAction* mBinaryEditAction;
|
||||
|
|
|
@ -8,10 +8,10 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
|
||||
mDisas = new CPUDisassembly(0);
|
||||
mSideBar = new CPUSideBar(mDisas);
|
||||
connect(mDisas, SIGNAL(tableOffsetChanged(int_t)), mSideBar, SLOT(changeTopmostAddress(int_t)));
|
||||
connect(mDisas, SIGNAL(tableOffsetChanged(dsint)), mSideBar, SLOT(changeTopmostAddress(dsint)));
|
||||
connect(mDisas, SIGNAL(viewableRows(int)), mSideBar, SLOT(setViewableRows(int)));
|
||||
connect(mDisas, SIGNAL(repainted()), mSideBar, SLOT(repaint()));
|
||||
connect(mDisas, SIGNAL(selectionChanged(int_t)), mSideBar, SLOT(setSelection(int_t)));
|
||||
connect(mDisas, SIGNAL(selectionChanged(dsint)), mSideBar, SLOT(setSelection(dsint)));
|
||||
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), mSideBar, SLOT(debugStateChangedSlot(DBGSTATE)));
|
||||
connect(Bridge::getBridge(), SIGNAL(updateSideBar()), mSideBar, SLOT(repaint()));
|
||||
|
||||
|
@ -29,7 +29,7 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
ui->mTopLeftLowerFrame->setMinimumHeight(height + 2);
|
||||
ui->mTopLeftLowerFrame->setMaximumHeight(height + 2);
|
||||
|
||||
connect(mDisas, SIGNAL(selectionChanged(int_t)), mInfo, SLOT(disasmSelectionChanged(int_t)));
|
||||
connect(mDisas, SIGNAL(selectionChanged(dsint)), mInfo, SLOT(disasmSelectionChanged(dsint)));
|
||||
|
||||
mGeneralRegs = new RegistersView(0);
|
||||
mGeneralRegs->setFixedWidth(1000);
|
||||
|
|
|
@ -10,12 +10,12 @@ CalculatorDialog::CalculatorDialog(QWidget* parent) : QDialog(parent), ui(new Ui
|
|||
setFixedSize(this->size()); //fixed size
|
||||
connect(this, SIGNAL(validAddress(bool)), ui->btnGoto, SLOT(setEnabled(bool)));
|
||||
emit validAddress(false);
|
||||
ui->txtBin->setInputMask(QString("bbbb ").repeated(sizeof(uint_t) * 2));
|
||||
ui->txtBin->setInputMask(QString("bbbb ").repeated(sizeof(duint) * 2));
|
||||
ui->txtExpression->setText("0");
|
||||
ui->txtExpression->selectAll();
|
||||
ui->txtExpression->setFocus();
|
||||
mValidateThread = new ValidateExpressionThread(this);
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, int_t)), this, SLOT(expressionChanged(bool, bool, int_t)));
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, dsint)), this, SLOT(expressionChanged(bool, bool, dsint)));
|
||||
connect(ui->txtExpression, SIGNAL(textChanged(QString)), mValidateThread, SLOT(textChanged(QString)));
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ void CalculatorDialog::setExpressionFocus()
|
|||
ui->txtExpression->setFocus();
|
||||
}
|
||||
|
||||
void CalculatorDialog::expressionChanged(bool validExpression, bool validPointer, int_t value)
|
||||
void CalculatorDialog::expressionChanged(bool validExpression, bool validPointer, dsint value)
|
||||
{
|
||||
if(!validExpression)
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ void CalculatorDialog::on_txtExpression_textChanged(const QString & arg1)
|
|||
emit validAddress(false);
|
||||
}
|
||||
|
||||
QString CalculatorDialog::inFormat(const uint_t val, CalculatorDialog::NUMBERFORMAT NF) const
|
||||
QString CalculatorDialog::inFormat(const duint val, CalculatorDialog::NUMBERFORMAT NF) const
|
||||
{
|
||||
switch(NF)
|
||||
{
|
||||
|
@ -116,14 +116,14 @@ QString CalculatorDialog::inFormat(const uint_t val, CalculatorDialog::NUMBERFOR
|
|||
case N_HEX:
|
||||
return QString("%1").arg(val, 1, 16, QChar('0')).toUpper();
|
||||
case N_SDEC:
|
||||
return QString("%1").arg((int_t)val);
|
||||
return QString("%1").arg((dsint)val);
|
||||
case N_UDEC:
|
||||
return QString("%1").arg(val);
|
||||
case N_BIN:
|
||||
{
|
||||
QString binary = QString("%1").arg(val, 8 * sizeof(uint_t), 2, QChar('0')).toUpper();
|
||||
QString binary = QString("%1").arg(val, 8 * sizeof(duint), 2, QChar('0')).toUpper();
|
||||
QString ans = "";
|
||||
for(int i = 0; i < sizeof(uint_t) * 8; i++)
|
||||
for(int i = 0; i < sizeof(duint) * 8; i++)
|
||||
{
|
||||
if((i % 4 == 0) && (i != 0))
|
||||
ans += " ";
|
||||
|
|
|
@ -37,7 +37,7 @@ signals:
|
|||
void showCpu();
|
||||
|
||||
private slots:
|
||||
void expressionChanged(bool validExpression, bool validPointer, int_t value);
|
||||
void expressionChanged(bool validExpression, bool validPointer, dsint value);
|
||||
void on_btnGoto_clicked();
|
||||
void on_txtHex_textEdited(const QString & arg1);
|
||||
void on_txtSignedDec_textEdited(const QString & arg1);
|
||||
|
@ -51,7 +51,7 @@ private slots:
|
|||
private:
|
||||
ValidateExpressionThread* mValidateThread;
|
||||
Ui::CalculatorDialog* ui;
|
||||
QString inFormat(const uint_t val, CalculatorDialog::NUMBERFORMAT NF) const;
|
||||
QString inFormat(const duint val, CalculatorDialog::NUMBERFORMAT NF) const;
|
||||
};
|
||||
|
||||
#endif // CALCULATORDIALOG_H
|
||||
|
|
|
@ -5,9 +5,9 @@ CallStackView::CallStackView(StdTable* parent) : StdTable(parent)
|
|||
{
|
||||
int charwidth = getCharWidth();
|
||||
|
||||
addColumnAt(8 + charwidth * sizeof(int_t) * 2, "Address", true); //address in the stack
|
||||
addColumnAt(8 + charwidth * sizeof(int_t) * 2, "To", true); //return to
|
||||
addColumnAt(8 + charwidth * sizeof(int_t) * 2, "From", true); //return from
|
||||
addColumnAt(8 + charwidth * sizeof(dsint) * 2, "Address", true); //address in the stack
|
||||
addColumnAt(8 + charwidth * sizeof(dsint) * 2, "To", true); //return to
|
||||
addColumnAt(8 + charwidth * sizeof(dsint) * 2, "From", true); //return from
|
||||
addColumnAt(0, "Comment", true);
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(updateCallStack()), this, SLOT(updateCallStack()));
|
||||
|
@ -38,13 +38,13 @@ void CallStackView::updateCallStack()
|
|||
setRowCount(callstack.total);
|
||||
for(int i = 0; i < callstack.total; i++)
|
||||
{
|
||||
QString addrText = QString("%1").arg((uint_t)callstack.entries[i].addr, sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg((duint)callstack.entries[i].addr, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
setCellContent(i, 0, addrText);
|
||||
addrText = QString("%1").arg((uint_t)callstack.entries[i].to, sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
addrText = QString("%1").arg((duint)callstack.entries[i].to, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
setCellContent(i, 1, addrText);
|
||||
if(callstack.entries[i].from)
|
||||
{
|
||||
addrText = QString("%1").arg((uint_t)callstack.entries[i].from, sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
addrText = QString("%1").arg((duint)callstack.entries[i].from, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
setCellContent(i, 2, addrText);
|
||||
}
|
||||
setCellContent(i, 3, callstack.entries[i].comment);
|
||||
|
|
|
@ -21,7 +21,7 @@ GotoDialog::GotoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::GotoDialog
|
|||
validRangeEnd = 0;
|
||||
fileOffset = false;
|
||||
mValidateThread = new ValidateExpressionThread(this);
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, int_t)), this, SLOT(expressionChanged(bool, bool, int_t)));
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, dsint)), this, SLOT(expressionChanged(bool, bool, dsint)));
|
||||
connect(ui->editExpression, SIGNAL(textEdited(QString)), mValidateThread, SLOT(textChanged(QString)));
|
||||
connect(this, SIGNAL(finished(int)), this, SLOT(finishedSlot(int)));
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ void GotoDialog::hideEvent(QHideEvent* event)
|
|||
mValidateThread->wait();
|
||||
}
|
||||
|
||||
void GotoDialog::expressionChanged(bool validExpression, bool validPointer, int_t value)
|
||||
void GotoDialog::expressionChanged(bool validExpression, bool validPointer, dsint value)
|
||||
{
|
||||
QString expression = ui->editExpression->text();
|
||||
if(expressionText == expression)
|
||||
|
@ -63,11 +63,11 @@ void GotoDialog::expressionChanged(bool validExpression, bool validPointer, int_
|
|||
}
|
||||
else if(fileOffset)
|
||||
{
|
||||
uint_t offset = value;
|
||||
uint_t va = DbgFunctions()->FileOffsetToVa(modName.toUtf8().constData(), offset);
|
||||
duint offset = value;
|
||||
duint va = DbgFunctions()->FileOffsetToVa(modName.toUtf8().constData(), offset);
|
||||
if(va)
|
||||
{
|
||||
QString addrText = QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
ui->labelError->setText(QString("<font color='#00DD00'><b>Correct expression! -> </b></font>" + addrText));
|
||||
ui->buttonOk->setEnabled(true);
|
||||
expressionText = expression;
|
||||
|
@ -81,7 +81,7 @@ void GotoDialog::expressionChanged(bool validExpression, bool validPointer, int_
|
|||
}
|
||||
else
|
||||
{
|
||||
uint_t addr = value;
|
||||
duint addr = value;
|
||||
if(!validPointer)
|
||||
{
|
||||
ui->labelError->setText("<font color='red'><b>Invalid memory address...</b></font>");
|
||||
|
@ -107,9 +107,9 @@ void GotoDialog::expressionChanged(bool validExpression, bool validPointer, int_
|
|||
addrText = QString(label);
|
||||
}
|
||||
else if(DbgGetModuleAt(addr, module) && !QString(label).startsWith("JMP.&"))
|
||||
addrText = QString(module) + "." + QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
addrText = QString(module) + "." + QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
else
|
||||
addrText = QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
addrText = QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
ui->labelError->setText(QString("<font color='#00DD00'><b>Correct expression! -> </b></font>" + addrText));
|
||||
ui->buttonOk->setEnabled(true);
|
||||
expressionText = expression;
|
||||
|
@ -123,7 +123,7 @@ void GotoDialog::on_editExpression_textChanged(const QString & arg1)
|
|||
ui->buttonOk->setEnabled(false);
|
||||
}
|
||||
|
||||
bool GotoDialog::IsValidMemoryRange(uint_t addr)
|
||||
bool GotoDialog::IsValidMemoryRange(duint addr)
|
||||
{
|
||||
return ((!validRangeStart && !validRangeEnd) || (addr >= validRangeStart && addr < validRangeEnd));
|
||||
}
|
||||
|
|
|
@ -18,15 +18,15 @@ public:
|
|||
explicit GotoDialog(QWidget* parent = 0);
|
||||
~GotoDialog();
|
||||
QString expressionText;
|
||||
uint_t validRangeStart;
|
||||
uint_t validRangeEnd;
|
||||
duint validRangeStart;
|
||||
duint validRangeEnd;
|
||||
bool fileOffset;
|
||||
QString modName;
|
||||
void showEvent(QShowEvent* event);
|
||||
void hideEvent(QHideEvent* event);
|
||||
|
||||
private slots:
|
||||
void expressionChanged(bool validExpression, bool validPointer, int_t value);
|
||||
void expressionChanged(bool validExpression, bool validPointer, dsint value);
|
||||
void on_editExpression_textChanged(const QString & arg1);
|
||||
void on_buttonOk_clicked();
|
||||
void finishedSlot(int result);
|
||||
|
@ -34,7 +34,7 @@ private slots:
|
|||
private:
|
||||
Ui::GotoDialog* ui;
|
||||
ValidateExpressionThread* mValidateThread;
|
||||
bool IsValidMemoryRange(uint_t addr);
|
||||
bool IsValidMemoryRange(duint addr);
|
||||
};
|
||||
|
||||
#endif // GOTODIALOG_H
|
||||
|
|
|
@ -236,7 +236,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
connect(mCpuWidget->mDisas, SIGNAL(displaySourceManagerWidget()), this, SLOT(displaySourceViewWidget()));
|
||||
connect(mCpuWidget->mDisas, SIGNAL(displaySnowmanWidget()), this, SLOT(displaySnowmanWidget()));
|
||||
connect(mCpuWidget->mDisas, SIGNAL(showPatches()), this, SLOT(patchWindow()));
|
||||
connect(mCpuWidget->mDisas, SIGNAL(decompileAt(int_t, int_t)), this, SLOT(decompileAt(int_t, int_t)));
|
||||
connect(mCpuWidget->mDisas, SIGNAL(decompileAt(dsint, dsint)), this, SLOT(decompileAt(dsint, dsint)));
|
||||
connect(mCpuWidget->mDump, SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
|
||||
connect(mCpuWidget->mStack, SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
|
||||
connect(Config(), SIGNAL(shortcutsUpdated()), this, SLOT(refreshShortcuts()));
|
||||
|
@ -758,13 +758,13 @@ void MainWindow::setLastException(unsigned int exceptionCode)
|
|||
|
||||
void MainWindow::findStrings()
|
||||
{
|
||||
DbgCmdExec(QString("strref " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper()).toUtf8().constData());
|
||||
DbgCmdExec(QString("strref " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper()).toUtf8().constData());
|
||||
displayReferencesWidget();
|
||||
}
|
||||
|
||||
void MainWindow::findModularCalls()
|
||||
{
|
||||
DbgCmdExec(QString("modcallfind " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper()).toUtf8().constData());
|
||||
DbgCmdExec(QString("modcallfind " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper()).toUtf8().constData());
|
||||
displayReferencesWidget();
|
||||
}
|
||||
|
||||
|
@ -958,7 +958,7 @@ void MainWindow::runSelection()
|
|||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
QString command = "bp " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(int_t) * 2, 16, QChar('0')).toUpper() + ", ss";
|
||||
QString command = "bp " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(dsint) * 2, 16, QChar('0')).toUpper() + ", ss";
|
||||
if(DbgCmdExecDirect(command.toUtf8().constData()))
|
||||
DbgCmdExecDirect("run");
|
||||
}
|
||||
|
@ -1113,7 +1113,7 @@ void MainWindow::changeCommandLine()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::decompileAt(int_t start, int_t end)
|
||||
void MainWindow::decompileAt(dsint start, dsint end)
|
||||
{
|
||||
DecompileAt(mSnowmanView, start, end);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public slots:
|
|||
void displayAttach();
|
||||
void detach();
|
||||
void changeCommandLine();
|
||||
void decompileAt(int_t start, int_t end);
|
||||
void decompileAt(dsint start, dsint end);
|
||||
void canClose();
|
||||
void addQWidgetTab(QWidget* qWidget);
|
||||
void showQWidgetTab(QWidget* qWidget);
|
||||
|
|
|
@ -12,8 +12,8 @@ MemoryMapView::MemoryMapView(StdTable* parent) : StdTable(parent)
|
|||
|
||||
int charwidth = getCharWidth();
|
||||
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(uint_t), "Address", false, "Address"); //addr
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(uint_t), "Size", false, "Size"); //size
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(duint), "Address", false, "Address"); //addr
|
||||
addColumnAt(8 + charwidth * 2 * sizeof(duint), "Size", false, "Size"); //size
|
||||
addColumnAt(8 + charwidth * 32, "Info", false, "Page Information"); //page information
|
||||
addColumnAt(8 + charwidth * 5, "Type", false, "Allocation Type"); //allocation type
|
||||
addColumnAt(8 + charwidth * 11, "Protection", false, "Current Protection"); //current protection
|
||||
|
@ -146,9 +146,9 @@ void MemoryMapView::contextMenuSlot(const QPoint & pos)
|
|||
|
||||
QString wStr = getCellContent(getInitialSelection(), 0);
|
||||
#ifdef _WIN64
|
||||
uint_t selectedAddr = wStr.toULongLong(0, 16);
|
||||
duint selectedAddr = wStr.toULongLong(0, 16);
|
||||
#else //x86
|
||||
uint_t selectedAddr = wStr.toULong(0, 16);
|
||||
duint selectedAddr = wStr.toULong(0, 16);
|
||||
#endif //_WIN64
|
||||
if((DbgGetBpxTypeAt(selectedAddr)&bp_memory) == bp_memory) //memory breakpoint set
|
||||
{
|
||||
|
@ -179,15 +179,15 @@ QString MemoryMapView::getProtectionString(DWORD Protect)
|
|||
return QString(rights);
|
||||
}
|
||||
|
||||
QString MemoryMapView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString MemoryMapView::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
if(col == 0) //address
|
||||
{
|
||||
QString wStr = getCellContent(rowBase + rowOffset, col);
|
||||
#ifdef _WIN64
|
||||
uint_t addr = wStr.toULongLong(0, 16);
|
||||
duint addr = wStr.toULongLong(0, 16);
|
||||
#else //x86
|
||||
uint_t addr = wStr.toULong(0, 16);
|
||||
duint addr = wStr.toULong(0, 16);
|
||||
#endif //_WIN64
|
||||
if((DbgGetBpxTypeAt(addr)&bp_memory) == bp_memory)
|
||||
{
|
||||
|
@ -242,11 +242,11 @@ void MemoryMapView::refreshMap()
|
|||
MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct.page)[wI].mbi;
|
||||
|
||||
// Base address
|
||||
wS = QString("%1").arg((uint_t)wMbi.BaseAddress, sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
wS = QString("%1").arg((duint)wMbi.BaseAddress, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
setCellContent(wI, 0, wS);
|
||||
|
||||
// Size
|
||||
wS = QString("%1").arg((uint_t)wMbi.RegionSize, sizeof(uint_t) * 2, 16, QChar('0')).toUpper();
|
||||
wS = QString("%1").arg((duint)wMbi.RegionSize, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
setCellContent(wI, 1, wS);
|
||||
|
||||
// Information
|
||||
|
@ -386,9 +386,9 @@ void MemoryMapView::memoryExecuteSingleshootToggleSlot()
|
|||
{
|
||||
QString addr_text = getCellContent(getInitialSelection(), 0);
|
||||
#ifdef _WIN64
|
||||
uint_t selectedAddr = addr_text.toULongLong(0, 16);
|
||||
duint selectedAddr = addr_text.toULongLong(0, 16);
|
||||
#else //x86
|
||||
uint_t selectedAddr = addr_text.toULong(0, 16);
|
||||
duint selectedAddr = addr_text.toULong(0, 16);
|
||||
#endif //_WIN64
|
||||
if((DbgGetBpxTypeAt(selectedAddr)&bp_memory) == bp_memory) //memory breakpoint set
|
||||
memoryRemoveSlot();
|
||||
|
@ -400,8 +400,8 @@ void MemoryMapView::pageMemoryRights()
|
|||
{
|
||||
PageMemoryRights PageMemoryRightsDialog(this);
|
||||
connect(&PageMemoryRightsDialog, SIGNAL(refreshMemoryMap()), this, SLOT(refreshMap()));
|
||||
uint_t addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
uint_t size = getCellContent(getInitialSelection(), 1).toULongLong(0, 16);
|
||||
duint addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint size = getCellContent(getInitialSelection(), 1).toULongLong(0, 16);
|
||||
PageMemoryRightsDialog.RunAddrSize(addr, size, getCellContent(getInitialSelection(), 3));
|
||||
}
|
||||
|
||||
|
@ -418,8 +418,8 @@ void MemoryMapView::switchView()
|
|||
|
||||
void MemoryMapView::entropy()
|
||||
{
|
||||
uint_t addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
uint_t size = getCellContent(getInitialSelection(), 1).toULongLong(0, 16);
|
||||
duint addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint size = getCellContent(getInitialSelection(), 1).toULongLong(0, 16);
|
||||
unsigned char* data = new unsigned char[size];
|
||||
DbgMemRead(addr, data, size);
|
||||
|
||||
|
@ -440,10 +440,10 @@ void MemoryMapView::findPatternSlot()
|
|||
hexEdit.setWindowTitle("Find Pattern...");
|
||||
if(hexEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
uint_t addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
duint addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16);
|
||||
if(hexEdit.entireBlock())
|
||||
addr = 0;
|
||||
QString addrText = QString("%1").arg(addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExec(QString("findmemall " + addrText + ", \"" + hexEdit.mHexEdit->pattern() + "\", &data&").toUtf8().constData());
|
||||
emit showReferences();
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class MemoryMapView : public StdTable
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit MemoryMapView(StdTable* parent = 0);
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void setupContextMenu();
|
||||
|
||||
signals:
|
||||
|
|
|
@ -18,7 +18,7 @@ PageMemoryRights::~PageMemoryRights()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void PageMemoryRights::RunAddrSize(uint_t addrin, uint_t sizein, QString pagetypein)
|
||||
void PageMemoryRights::RunAddrSize(duint addrin, duint sizein, QString pagetypein)
|
||||
{
|
||||
addr = addrin;
|
||||
size = sizein;
|
||||
|
@ -26,7 +26,7 @@ void PageMemoryRights::RunAddrSize(uint_t addrin, uint_t sizein, QString pagetyp
|
|||
|
||||
QTableWidget* tableWidget = ui->pagetableWidget;
|
||||
tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
uint_t nr_pages = size / PAGE_SIZE;
|
||||
duint nr_pages = size / PAGE_SIZE;
|
||||
tableWidget->setColumnCount(2);
|
||||
tableWidget->setRowCount(nr_pages);
|
||||
tableWidget->setHorizontalHeaderItem(0, new QTableWidgetItem(QString("Address")));
|
||||
|
@ -34,10 +34,10 @@ void PageMemoryRights::RunAddrSize(uint_t addrin, uint_t sizein, QString pagetyp
|
|||
|
||||
duint actual_addr;
|
||||
char rights[RIGHTS_STRING_SIZE];
|
||||
for(uint_t i = 0; i < nr_pages; i++)
|
||||
for(duint i = 0; i < nr_pages; i++)
|
||||
{
|
||||
actual_addr = addr + (i * PAGE_SIZE);
|
||||
tableWidget->setItem(i, 0, new QTableWidgetItem(QString("%1").arg(actual_addr, sizeof(uint_t) * 2, 16, QChar('0')).toUpper()));
|
||||
tableWidget->setItem(i, 0, new QTableWidgetItem(QString("%1").arg(actual_addr, sizeof(duint) * 2, 16, QChar('0')).toUpper()));
|
||||
if(DbgFunctions()->GetPageRights(actual_addr, rights))
|
||||
tableWidget->setItem(i, 1, new QTableWidgetItem(QString(rights)));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class PageMemoryRights : public QDialog
|
|||
|
||||
public:
|
||||
explicit PageMemoryRights(QWidget* parent = 0);
|
||||
void RunAddrSize(uint_t, uint_t, QString);
|
||||
void RunAddrSize(duint, duint, QString);
|
||||
~PageMemoryRights();
|
||||
|
||||
private slots:
|
||||
|
@ -28,8 +28,8 @@ signals:
|
|||
|
||||
private:
|
||||
Ui::PageMemoryRights* ui;
|
||||
uint_t addr;
|
||||
uint_t size;
|
||||
duint addr;
|
||||
duint size;
|
||||
QString pagetype;
|
||||
};
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ bool PatchDialog::hasNextGroup(const PatchInfoList & patchList, int group)
|
|||
return false;
|
||||
}
|
||||
|
||||
int_t PatchDialog::getGroupAddress(const PatchInfoList & patchList, int group)
|
||||
dsint PatchDialog::getGroupAddress(const PatchInfoList & patchList, int group)
|
||||
{
|
||||
for(int i = 0; i < patchList.size(); i++)
|
||||
if(patchList.at(i).second.group == group)
|
||||
|
@ -185,11 +185,11 @@ void PatchDialog::groupToggle()
|
|||
}
|
||||
GuiUpdateAllViews();
|
||||
mIsWorking = false;
|
||||
int_t groupStart = getGroupAddress(curPatchList, group);
|
||||
dsint groupStart = getGroupAddress(curPatchList, group);
|
||||
if(!groupStart)
|
||||
return;
|
||||
QString color = enabled ? "#00DD00" : "red";
|
||||
QString addrText = QString("%1").arg(groupStart, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(groupStart, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString title = "<font color='" + color + "'><b>" + QString().sprintf("%d:", group) + addrText + "</b></font>";
|
||||
mGroupSelector->setGroupTitle(title);
|
||||
DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData());
|
||||
|
@ -210,7 +210,7 @@ void PatchDialog::groupPrevious()
|
|||
return;
|
||||
group--;
|
||||
QString color = isGroupEnabled(curPatchList, group) ? "#00DD00" : "red";
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString title = "<font color='" + color + "'><b>" + QString().sprintf("%d:", group) + addrText + "</b></font>";
|
||||
mGroupSelector->setGroupTitle(title);
|
||||
mGroupSelector->setGroup(group);
|
||||
|
@ -235,7 +235,7 @@ void PatchDialog::groupNext()
|
|||
return;
|
||||
group++;
|
||||
QString color = isGroupEnabled(curPatchList, group) ? "#00DD00" : "red";
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString title = "<font color='" + color + "'><b>" + QString().sprintf("%d:", group) + addrText + "</b></font>";
|
||||
mGroupSelector->setGroupTitle(title);
|
||||
mGroupSelector->setGroup(group);
|
||||
|
@ -260,7 +260,7 @@ void PatchDialog::on_listModules_itemSelectionChanged()
|
|||
for(int i = 0; i < patchList.size(); i++)
|
||||
{
|
||||
const DBGPATCHINFO curPatch = patchList.at(i).first;
|
||||
QString addrText = QString("%1").arg(curPatch.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(curPatch.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QListWidgetItem* item = new QListWidgetItem(QString().sprintf("%d", patchList.at(i).second.group).rightJustified(4, ' ', true) + "|" + addrText + QString().sprintf(":%.2X->%.2X", curPatch.oldbyte, curPatch.newbyte), ui->listPatches);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
Qt::CheckState state = patchList.at(i).second.checked ? Qt::Checked : Qt::Unchecked;
|
||||
|
@ -306,7 +306,7 @@ void PatchDialog::on_listPatches_itemChanged(QListWidgetItem* item) //checkbox c
|
|||
GuiUpdateAllViews();
|
||||
int group = mGroupSelector->group();
|
||||
QString color = isGroupEnabled(curPatchList, group) ? "#00DD00" : "red";
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString title = "<font color='" + color + "'><b>" + QString().sprintf("%d:", group) + addrText + "</b></font>";
|
||||
mGroupSelector->setGroupTitle(title);
|
||||
mGroupSelector->setPreviousEnabled(hasPreviousGroup(curPatchList, group));
|
||||
|
@ -393,10 +393,10 @@ void PatchDialog::on_listPatches_itemSelectionChanged()
|
|||
return;
|
||||
PatchInfoList & curPatchList = found.value();
|
||||
PatchPair & patch = curPatchList[ui->listPatches->row(ui->listPatches->selectedItems().at(0))]; //selected item
|
||||
int_t groupStart = getGroupAddress(curPatchList, patch.second.group);
|
||||
dsint groupStart = getGroupAddress(curPatchList, patch.second.group);
|
||||
if(!groupStart)
|
||||
return;
|
||||
QString addrText = QString("%1").arg(groupStart, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(groupStart, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData());
|
||||
DbgCmdExecDirect(QString("dump " + addrText).toUtf8().constData());
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ void PatchDialog::on_btnPickGroups_clicked()
|
|||
|
||||
int group = mGroupSelector->group();
|
||||
QString color = isGroupEnabled(curPatchList, group) ? "#00DD00" : "red";
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
QString title = "<font color='" + color + "'><b>" + QString().sprintf("%d:", group) + addrText + "</b></font>";
|
||||
mGroupSelector->setGroupTitle(title);
|
||||
mGroupSelector->setPreviousEnabled(hasPreviousGroup(curPatchList, group));
|
||||
|
@ -525,7 +525,7 @@ void PatchDialog::on_btnImport_clicked()
|
|||
} IMPORTSTATUS;
|
||||
QList<QPair<DBGPATCHINFO, IMPORTSTATUS>> patchList;
|
||||
DBGPATCHINFO curPatch;
|
||||
int_t modbase = 0;
|
||||
dsint modbase = 0;
|
||||
bool bBadOriginal = false;
|
||||
bool bAlreadyDone = false;
|
||||
for(int i = 0; i < lines.size(); i++)
|
||||
|
@ -647,7 +647,7 @@ void PatchDialog::on_btnExport_clicked()
|
|||
{
|
||||
const PatchInfoList & curPatchList = i.value();
|
||||
bool bModPlaced = false;
|
||||
int_t modbase = DbgFunctions()->ModBaseFromName(i.key().toUtf8().constData());
|
||||
dsint modbase = DbgFunctions()->ModBaseFromName(i.key().toUtf8().constData());
|
||||
if(!modbase)
|
||||
continue;
|
||||
for(int j = 0; j < curPatchList.size(); j++)
|
||||
|
@ -659,7 +659,7 @@ void PatchDialog::on_btnExport_clicked()
|
|||
lines.push_back(">" + i.key());
|
||||
bModPlaced = true;
|
||||
}
|
||||
QString addrText = QString("%1").arg(curPatchList.at(j).first.addr - modbase, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
QString addrText = QString("%1").arg(curPatchList.at(j).first.addr - modbase, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
lines.push_back(addrText + QString().sprintf(":%.2X->%.2X", curPatchList.at(j).first.oldbyte, curPatchList.at(j).first.newbyte));
|
||||
patches++;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ private:
|
|||
bool isGroupEnabled(const PatchInfoList & patchList, int group);
|
||||
bool hasPreviousGroup(const PatchInfoList & patchList, int group);
|
||||
bool hasNextGroup(const PatchInfoList & patchList, int group);
|
||||
int_t getGroupAddress(const PatchInfoList & patchList, int group);
|
||||
dsint getGroupAddress(const PatchInfoList & patchList, int group);
|
||||
|
||||
private slots:
|
||||
void dbgStateChanged(DBGSTATE state);
|
||||
|
|
|
@ -25,77 +25,77 @@ void RegistersView::InitMappings()
|
|||
*/
|
||||
#ifdef _WIN64
|
||||
mRegisterMapping.insert(CAX, "RAX");
|
||||
mRegisterPlaces.insert(CAX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CAX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CBX, "RBX");
|
||||
mRegisterPlaces.insert(CBX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CBX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CCX, "RCX");
|
||||
mRegisterPlaces.insert(CCX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CCX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CDX, "RDX");
|
||||
mRegisterPlaces.insert(CDX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CDX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CBP, "RBP");
|
||||
mRegisterPlaces.insert(CBP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CBP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CSP, "RSP");
|
||||
mRegisterPlaces.insert(CSP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CSP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CSI, "RSI");
|
||||
mRegisterPlaces.insert(CSI, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CSI, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CDI, "RDI");
|
||||
mRegisterPlaces.insert(CDI, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CDI, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
|
||||
offset++;
|
||||
|
||||
mRegisterMapping.insert(R8, "R8");
|
||||
mRegisterPlaces.insert(R8 , Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R8 , Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R9, "R9");
|
||||
mRegisterPlaces.insert(R9 , Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R9 , Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R10, "R10");
|
||||
mRegisterPlaces.insert(R10, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R10, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R11, "R11");
|
||||
mRegisterPlaces.insert(R11, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R11, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R12, "R12");
|
||||
mRegisterPlaces.insert(R12, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R12, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R13, "R13");
|
||||
mRegisterPlaces.insert(R13, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R13, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R14, "R14");
|
||||
mRegisterPlaces.insert(R14, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R14, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(R15, "R15");
|
||||
mRegisterPlaces.insert(R15, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(R15, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
|
||||
offset++;
|
||||
|
||||
mRegisterMapping.insert(CIP, "RIP");
|
||||
mRegisterPlaces.insert(CIP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CIP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
|
||||
offset++;
|
||||
|
||||
mRegisterMapping.insert(EFLAGS, "RFLAGS");
|
||||
mRegisterPlaces.insert(EFLAGS, Register_Position(offset++, 0, 9, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(EFLAGS, Register_Position(offset++, 0, 9, sizeof(duint) * 2));
|
||||
#else //x32
|
||||
mRegisterMapping.insert(CAX, "EAX");
|
||||
mRegisterPlaces.insert(CAX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CAX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CBX, "EBX");
|
||||
mRegisterPlaces.insert(CBX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CBX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CCX, "ECX");
|
||||
mRegisterPlaces.insert(CCX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CCX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CDX, "EDX");
|
||||
mRegisterPlaces.insert(CDX, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CDX, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CBP, "EBP");
|
||||
mRegisterPlaces.insert(CBP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CBP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CSP, "ESP");
|
||||
mRegisterPlaces.insert(CSP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CSP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CSI, "ESI");
|
||||
mRegisterPlaces.insert(CSI, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CSI, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(CDI, "EDI");
|
||||
mRegisterPlaces.insert(CDI, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CDI, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
|
||||
offset++;
|
||||
|
||||
mRegisterMapping.insert(CIP, "EIP");
|
||||
mRegisterPlaces.insert(CIP, Register_Position(offset++, 0, 6, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(CIP, Register_Position(offset++, 0, 6, sizeof(duint) * 2));
|
||||
|
||||
offset++;
|
||||
|
||||
mRegisterMapping.insert(EFLAGS, "EFLAGS");
|
||||
mRegisterPlaces.insert(EFLAGS, Register_Position(offset++, 0, 9, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(EFLAGS, Register_Position(offset++, 0, 9, sizeof(duint) * 2));
|
||||
#endif
|
||||
|
||||
mRegisterMapping.insert(ZF, "ZF");
|
||||
|
@ -389,17 +389,17 @@ void RegistersView::InitMappings()
|
|||
offset++;
|
||||
|
||||
mRegisterMapping.insert(DR0, "DR0");
|
||||
mRegisterPlaces.insert(DR0, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR0, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(DR1, "DR1");
|
||||
mRegisterPlaces.insert(DR1, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR1, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(DR2, "DR2");
|
||||
mRegisterPlaces.insert(DR2, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR2, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(DR3, "DR3");
|
||||
mRegisterPlaces.insert(DR3, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR3, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(DR6, "DR6");
|
||||
mRegisterPlaces.insert(DR6, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR6, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
mRegisterMapping.insert(DR7, "DR7");
|
||||
mRegisterPlaces.insert(DR7, Register_Position(offset++, 0, 4, sizeof(uint_t) * 2));
|
||||
mRegisterPlaces.insert(DR7, Register_Position(offset++, 0, 4, sizeof(duint) * 2));
|
||||
|
||||
mRowsNeeded = offset + 1;
|
||||
}
|
||||
|
@ -1305,8 +1305,8 @@ QString RegistersView::getRegisterLabel(REGISTER_NAME register_selected)
|
|||
char module_text[MAX_MODULE_SIZE] = "";
|
||||
char string_text[MAX_STRING_SIZE] = "";
|
||||
|
||||
QString valueText = QString("%1").arg((* ((uint_t*) registerValue(&wRegDumpStruct, register_selected))), mRegisterPlaces[register_selected].valuesize, 16, QChar('0')).toUpper();
|
||||
duint register_value = (* ((uint_t*) registerValue(&wRegDumpStruct, register_selected)));
|
||||
QString valueText = QString("%1").arg((* ((duint*) registerValue(&wRegDumpStruct, register_selected))), mRegisterPlaces[register_selected].valuesize, 16, QChar('0')).toUpper();
|
||||
duint register_value = (* ((duint*) registerValue(&wRegDumpStruct, register_selected)));
|
||||
QString newText = QString("");
|
||||
|
||||
bool hasString = DbgGetStringAt(register_value, string_text);
|
||||
|
@ -1424,7 +1424,7 @@ QString RegistersView::GetRegStringValueFromValue(REGISTER_NAME reg, char* value
|
|||
QString valueText;
|
||||
|
||||
if(mUINTDISPLAY.contains(reg))
|
||||
valueText = QString("%1").arg((* ((uint_t*) value)), mRegisterPlaces[reg].valuesize, 16, QChar('0')).toUpper();
|
||||
valueText = QString("%1").arg((* ((duint*) value)), mRegisterPlaces[reg].valuesize, 16, QChar('0')).toUpper();
|
||||
else if(mUSHORTDISPLAY.contains(reg))
|
||||
valueText = QString("%1").arg((* ((unsigned short*) value)), mRegisterPlaces[reg].valuesize, 16, QChar('0')).toUpper();
|
||||
else if(mDWORDDISPLAY.contains(reg))
|
||||
|
@ -1869,7 +1869,7 @@ void RegistersView::ModifyFields(QString title, STRING_VALUE_TABLE_t* table, SIZ
|
|||
|
||||
QListWidgetItem* item = mQListWidget->takeItem(mQListWidget->currentRow());
|
||||
|
||||
uint_t value;
|
||||
duint value;
|
||||
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
|
@ -1879,7 +1879,7 @@ void RegistersView::ModifyFields(QString title, STRING_VALUE_TABLE_t* table, SIZ
|
|||
|
||||
value = table[i].value;
|
||||
|
||||
setRegister(mSelected, (uint_t)value);
|
||||
setRegister(mSelected, (duint)value);
|
||||
}
|
||||
|
||||
#define MODIFY_FIELDS_DISPLAY(title, table) ModifyFields(QString("Edit ") + QString(title), (STRING_VALUE_TABLE_t *) & table, SIZE_TABLE(table) )
|
||||
|
@ -1916,10 +1916,10 @@ void RegistersView::displayEditDialog()
|
|||
else
|
||||
{
|
||||
bool ok = false;
|
||||
uint_t fpuvalue;
|
||||
duint fpuvalue;
|
||||
|
||||
if(mUSHORTDISPLAY.contains(mSelected))
|
||||
fpuvalue = (uint_t) mLineEdit.editText.toUShort(&ok, 16);
|
||||
fpuvalue = (duint) mLineEdit.editText.toUShort(&ok, 16);
|
||||
else if(mDWORDDISPLAY.contains(mSelected))
|
||||
fpuvalue = mLineEdit.editText.toUInt(&ok, 16);
|
||||
else if(mFPUMMX.contains(mSelected) || mFPUXMM.contains(mSelected) || mFPUYMM.contains(mSelected) || mFPUx87_80BITSDISPLAY.contains(mSelected))
|
||||
|
@ -1947,7 +1947,7 @@ void RegistersView::displayEditDialog()
|
|||
}
|
||||
|
||||
if(ok)
|
||||
setRegister(mSelected, (uint_t) pData);
|
||||
setRegister(mSelected, (duint) pData);
|
||||
|
||||
free(pData);
|
||||
|
||||
|
@ -1977,7 +1977,7 @@ void RegistersView::displayEditDialog()
|
|||
else
|
||||
{
|
||||
WordEditDialog wEditDial(this);
|
||||
wEditDial.setup(QString("Edit"), (* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))), sizeof(int_t));
|
||||
wEditDial.setup(QString("Edit"), (* ((duint*) registerValue(&wRegDumpStruct, mSelected))), sizeof(dsint));
|
||||
if(wEditDial.exec() == QDialog::Accepted) //OK button clicked
|
||||
setRegister(mSelected, wEditDial.getVal());
|
||||
}
|
||||
|
@ -1986,25 +1986,25 @@ void RegistersView::displayEditDialog()
|
|||
void RegistersView::onIncrementx87StackAction()
|
||||
{
|
||||
if(mFPUx87_80BITSDISPLAY.contains(mSelected))
|
||||
setRegister(x87SW_TOP, ((* ((uint_t*) registerValue(&wRegDumpStruct, x87SW_TOP))) + 1) % 8);
|
||||
setRegister(x87SW_TOP, ((* ((duint*) registerValue(&wRegDumpStruct, x87SW_TOP))) + 1) % 8);
|
||||
}
|
||||
|
||||
void RegistersView::onDecrementx87StackAction()
|
||||
{
|
||||
if(mFPUx87_80BITSDISPLAY.contains(mSelected))
|
||||
setRegister(x87SW_TOP, ((* ((uint_t*) registerValue(&wRegDumpStruct, x87SW_TOP))) - 1) % 8);
|
||||
setRegister(x87SW_TOP, ((* ((duint*) registerValue(&wRegDumpStruct, x87SW_TOP))) - 1) % 8);
|
||||
}
|
||||
|
||||
void RegistersView::onIncrementAction()
|
||||
{
|
||||
if(mINCREMENTDECREMET.contains(mSelected))
|
||||
setRegister(mSelected, (* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))) + 1);
|
||||
setRegister(mSelected, (* ((duint*) registerValue(&wRegDumpStruct, mSelected))) + 1);
|
||||
}
|
||||
|
||||
void RegistersView::onDecrementAction()
|
||||
{
|
||||
if(mINCREMENTDECREMET.contains(mSelected))
|
||||
setRegister(mSelected, (* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))) - 1);
|
||||
setRegister(mSelected, (* ((duint*) registerValue(&wRegDumpStruct, mSelected))) - 1);
|
||||
}
|
||||
|
||||
void RegistersView::onZeroAction()
|
||||
|
@ -2037,7 +2037,7 @@ void RegistersView::onToggleValueAction()
|
|||
else
|
||||
{
|
||||
bool ok = false;
|
||||
int_t val = GetRegStringValueFromValue(mSelected, registerValue(&wRegDumpStruct, mSelected)).toInt(&ok, 16);
|
||||
dsint val = GetRegStringValueFromValue(mSelected, registerValue(&wRegDumpStruct, mSelected)).toInt(&ok, 16);
|
||||
if(ok)
|
||||
{
|
||||
val++;
|
||||
|
@ -2069,8 +2069,8 @@ void RegistersView::onFollowInDisassembly()
|
|||
{
|
||||
if(mCANSTOREADDRESS.contains(mSelected))
|
||||
{
|
||||
QString addr = QString("%1").arg((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
QString addr = QString("%1").arg((* ((duint*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((duint*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
DbgCmdExec(QString().sprintf("disasm \"%s\"", addr.toUtf8().constData()).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
@ -2079,8 +2079,8 @@ void RegistersView::onFollowInDump()
|
|||
{
|
||||
if(mCANSTOREADDRESS.contains(mSelected))
|
||||
{
|
||||
QString addr = QString("%1").arg((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
QString addr = QString("%1").arg((* ((duint*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((duint*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
DbgCmdExec(QString().sprintf("dump \"%s\"", addr.toUtf8().constData()).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
@ -2089,8 +2089,8 @@ void RegistersView::onFollowInStack()
|
|||
{
|
||||
if(mCANSTOREADDRESS.contains(mSelected))
|
||||
{
|
||||
QString addr = QString("%1").arg((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
QString addr = QString("%1").arg((* ((duint*) registerValue(&wRegDumpStruct, mSelected))), mRegisterPlaces[mSelected].valuesize, 16, QChar('0')).toUpper();
|
||||
if(DbgMemIsValidReadPtr((* ((duint*) registerValue(&wRegDumpStruct, mSelected)))))
|
||||
DbgCmdExec(QString().sprintf("sdump \"%s\"", addr.toUtf8().constData()).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
@ -2113,9 +2113,9 @@ void RegistersView::displayCustomContextMenuSlot(QPoint pos)
|
|||
{
|
||||
if(mSETONEZEROTOGGLE.contains(mSelected))
|
||||
{
|
||||
if((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))) >= 1)
|
||||
if((* ((duint*) registerValue(&wRegDumpStruct, mSelected))) >= 1)
|
||||
wMenu.addAction(wCM_Zero);
|
||||
if((* ((uint_t*) registerValue(&wRegDumpStruct, mSelected))) == 0)
|
||||
if((* ((duint*) registerValue(&wRegDumpStruct, mSelected))) == 0)
|
||||
wMenu.addAction(wCM_SetToOne);
|
||||
wMenu.addAction(wCM_ToggleValue);
|
||||
}
|
||||
|
@ -2139,7 +2139,7 @@ void RegistersView::displayCustomContextMenuSlot(QPoint pos)
|
|||
|
||||
if(mCANSTOREADDRESS.contains(mSelected))
|
||||
{
|
||||
uint_t addr = (* ((uint_t*) registerValue(&wRegDumpStruct, mSelected)));
|
||||
duint addr = (* ((duint*) registerValue(&wRegDumpStruct, mSelected)));
|
||||
if(DbgMemIsValidReadPtr(addr))
|
||||
{
|
||||
wMenu.addAction(wCM_FollowInDump);
|
||||
|
@ -2179,7 +2179,7 @@ void RegistersView::displayCustomContextMenuSlot(QPoint pos)
|
|||
}
|
||||
}
|
||||
|
||||
void RegistersView::setRegister(REGISTER_NAME reg, uint_t value)
|
||||
void RegistersView::setRegister(REGISTER_NAME reg, duint value)
|
||||
{
|
||||
// is register-id known?
|
||||
if(mRegisterMapping.contains(reg))
|
||||
|
@ -2223,7 +2223,7 @@ SIZE_T RegistersView::GetSizeRegister(const REGISTER_NAME reg_name)
|
|||
SIZE_T size;
|
||||
|
||||
if(mUINTDISPLAY.contains(reg_name))
|
||||
size = sizeof(uint_t);
|
||||
size = sizeof(duint);
|
||||
else if(mUSHORTDISPLAY.contains(reg_name) || mFIELDVALUE.contains(reg_name))
|
||||
size = sizeof(unsigned short);
|
||||
else if(mDWORDDISPLAY.contains(reg_name))
|
||||
|
|
|
@ -101,7 +101,7 @@ public slots:
|
|||
void refreshShortcutsSlot();
|
||||
void updateRegistersSlot();
|
||||
void displayCustomContextMenuSlot(QPoint pos);
|
||||
void setRegister(REGISTER_NAME reg, uint_t value);
|
||||
void setRegister(REGISTER_NAME reg, duint value);
|
||||
void debugStateChangedSlot(DBGSTATE state);
|
||||
void repaint();
|
||||
void ShowFPU(bool set_showfpu);
|
||||
|
@ -217,7 +217,7 @@ private:
|
|||
QAction* wCM_Incrementx87Stack;
|
||||
QAction* wCM_Decrementx87Stack;
|
||||
QAction* wCM_ChangeFPUView;
|
||||
int_t mCip;
|
||||
dsint mCip;
|
||||
};
|
||||
|
||||
#endif // REGISTERSVIEW_H
|
||||
|
|
|
@ -44,7 +44,7 @@ void ScriptView::colorsUpdated()
|
|||
backgroundColor = ConfigColor("DisassemblyBackgroundColor");
|
||||
}
|
||||
|
||||
QString ScriptView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString ScriptView::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
bool wIsSelected = isSelected(rowBase, rowOffset);
|
||||
// Highlight if selected
|
||||
|
@ -312,8 +312,8 @@ void ScriptView::keyPressEvent(QKeyEvent* event)
|
|||
int key = event->key();
|
||||
if(key == Qt::Key_Up || key == Qt::Key_Down)
|
||||
{
|
||||
int_t botRVA = getTableOffset();
|
||||
int_t topRVA = botRVA + getNbrOfLineToPrint() - 1;
|
||||
dsint botRVA = getTableOffset();
|
||||
dsint topRVA = botRVA + getNbrOfLineToPrint() - 1;
|
||||
if(key == Qt::Key_Up)
|
||||
selectPrevious();
|
||||
else
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
void colorsUpdated();
|
||||
|
||||
// Reimplemented Functions
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ void SourceView::contextMenuSlot(const QPoint & pos)
|
|||
QMenu* wMenu = new QMenu(this);
|
||||
|
||||
int line = getInitialSelection() + 1;
|
||||
int_t addr = DbgFunctions()->GetAddrFromLine(mSourcePath.toUtf8().constData(), line);
|
||||
dsint addr = DbgFunctions()->GetAddrFromLine(mSourcePath.toUtf8().constData(), line);
|
||||
if(addr)
|
||||
wMenu->addAction(mFollowInDisasm);
|
||||
|
||||
|
@ -97,7 +97,7 @@ void SourceView::loadFile()
|
|||
file.close();
|
||||
}
|
||||
|
||||
QString SourceView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString SourceView::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
painter->save();
|
||||
bool wIsSelected = isSelected(rowBase, rowOffset);
|
||||
|
@ -134,7 +134,7 @@ QString SourceView::paintContent(QPainter* painter, int_t rowBase, int rowOffset
|
|||
void SourceView::followInDisasmSlot()
|
||||
{
|
||||
int line = getInitialSelection() + 1;
|
||||
int_t addr = DbgFunctions()->GetAddrFromLine(mSourcePath.toUtf8().constData(), line);
|
||||
dsint addr = DbgFunctions()->GetAddrFromLine(mSourcePath.toUtf8().constData(), line);
|
||||
DbgCmdExecDirect(QString().sprintf("disasm %p", addr).toUtf8().constData());
|
||||
emit showCpu();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
explicit SourceView(QString path, int line = 0, StdTable* parent = 0);
|
||||
QString getSourcePath();
|
||||
void setInstructionPointer(int line);
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void setupContextMenu();
|
||||
void setSelection(int line);
|
||||
|
||||
|
|
|
@ -23,16 +23,16 @@ SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView
|
|||
// Create module list
|
||||
mModuleList = new StdTable();
|
||||
int charwidth = mModuleList->getCharWidth();
|
||||
mModuleList->addColumnAt(charwidth * 2 * sizeof(int_t) + 8, "Base", false);
|
||||
mModuleList->addColumnAt(charwidth * 2 * sizeof(dsint) + 8, "Base", false);
|
||||
mModuleList->addColumnAt(500, "Module", true);
|
||||
|
||||
// Setup symbol list
|
||||
mSearchListView->mList->addColumnAt(charwidth * 2 * sizeof(int_t) + 8, "Address", true);
|
||||
mSearchListView->mList->addColumnAt(charwidth * 2 * sizeof(dsint) + 8, "Address", true);
|
||||
mSearchListView->mList->addColumnAt(charwidth * 80, "Symbol", true);
|
||||
mSearchListView->mList->addColumnAt(2000, "Symbol (undecorated)", true);
|
||||
|
||||
// Setup search list
|
||||
mSearchListView->mSearchList->addColumnAt(charwidth * 2 * sizeof(int_t) + 8, "Address", true);
|
||||
mSearchListView->mSearchList->addColumnAt(charwidth * 2 * sizeof(dsint) + 8, "Address", true);
|
||||
mSearchListView->mSearchList->addColumnAt(charwidth * 80, "Symbol", true);
|
||||
mSearchListView->mSearchList->addColumnAt(2000, "Symbol (undecorated)", true);
|
||||
|
||||
|
@ -161,9 +161,9 @@ void SymbolView::clearSymbolLogSlot()
|
|||
void SymbolView::cbSymbolEnum(SYMBOLINFO* symbol, void* user)
|
||||
{
|
||||
StdTable* symbolList = (StdTable*)user;
|
||||
int_t index = symbolList->getRowCount();
|
||||
dsint index = symbolList->getRowCount();
|
||||
symbolList->setRowCount(index + 1);
|
||||
symbolList->setCellContent(index, 0, QString("%1").arg(symbol->addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
symbolList->setCellContent(index, 0, QString("%1").arg(symbol->addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
if(symbol->decoratedSymbol)
|
||||
{
|
||||
symbolList->setCellContent(index, 1, symbol->decoratedSymbol);
|
||||
|
@ -203,7 +203,7 @@ void SymbolView::updateSymbolList(int module_count, SYMBOLMODULEINFO* modules)
|
|||
for(int i = 0; i < module_count; i++)
|
||||
{
|
||||
mModuleBaseList.insert(modules[i].name, modules[i].base);
|
||||
mModuleList->setCellContent(i, 0, QString("%1").arg(modules[i].base, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
mModuleList->setCellContent(i, 0, QString("%1").arg(modules[i].base, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
mModuleList->setCellContent(i, 1, modules[i].name);
|
||||
}
|
||||
mModuleList->reloadData();
|
||||
|
@ -248,7 +248,7 @@ void SymbolView::moduleContextMenu(const QPoint & pos)
|
|||
wMenu->addAction(mFollowModuleEntryAction);
|
||||
wMenu->addAction(mDownloadSymbolsAction);
|
||||
wMenu->addAction(mDownloadAllSymbolsAction);
|
||||
int_t modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
dsint modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
char szModPath[MAX_PATH] = "";
|
||||
if(DbgFunctions()->ModPathFromAddr(modbase, szModPath, _countof(szModPath)))
|
||||
wMenu->addAction(mCopyPathAction);
|
||||
|
@ -278,7 +278,7 @@ void SymbolView::moduleEntryFollow()
|
|||
|
||||
void SymbolView::moduleCopyPath()
|
||||
{
|
||||
int_t modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
dsint modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
char szModPath[MAX_PATH] = "";
|
||||
if(DbgFunctions()->ModPathFromAddr(modbase, szModPath, _countof(szModPath)))
|
||||
Bridge::CopyToClipboard(szModPath);
|
||||
|
@ -325,11 +325,11 @@ void SymbolView::toggleBreakpoint()
|
|||
|
||||
if((wBpType & bp_normal) == bp_normal)
|
||||
{
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bc " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else
|
||||
{
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bp " + QString("%1").arg(wVA, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -367,7 +367,7 @@ void SymbolView::toggleBookmark()
|
|||
|
||||
void SymbolView::moduleEntropy()
|
||||
{
|
||||
int_t modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
dsint modbase = DbgValFromString(mModuleList->getCellContent(mModuleList->getInitialSelection(), 0).toUtf8().constData());
|
||||
char szModPath[MAX_PATH] = "";
|
||||
if(DbgFunctions()->ModPathFromAddr(modbase, szModPath, _countof(szModPath)))
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
QWidget* mSymbolPlaceHolder;
|
||||
SearchListView* mSearchListView;
|
||||
StdTable* mModuleList;
|
||||
QMap<QString, uint_t> mModuleBaseList;
|
||||
QMap<QString, duint> mModuleBaseList;
|
||||
QAction* mFollowSymbolAction;
|
||||
QAction* mFollowSymbolDumpAction;
|
||||
QAction* mToggleBreakpoint;
|
||||
|
|
|
@ -189,12 +189,12 @@ ThreadView::ThreadView(StdTable* parent) : StdTable(parent)
|
|||
int charwidth = getCharWidth();
|
||||
addColumnAt(8 + charwidth * sizeof(unsigned int) * 2, "Number", false);
|
||||
addColumnAt(8 + charwidth * sizeof(unsigned int) * 2, "ID", false);
|
||||
addColumnAt(8 + charwidth * sizeof(uint_t) * 2, "Entry", false);
|
||||
addColumnAt(8 + charwidth * sizeof(uint_t) * 2, "TEB", false);
|
||||
addColumnAt(8 + charwidth * sizeof(duint) * 2, "Entry", false);
|
||||
addColumnAt(8 + charwidth * sizeof(duint) * 2, "TEB", false);
|
||||
#ifdef _WIN64
|
||||
addColumnAt(8 + charwidth * sizeof(uint_t) * 2, "RIP", false);
|
||||
addColumnAt(8 + charwidth * sizeof(duint) * 2, "RIP", false);
|
||||
#else
|
||||
addColumnAt(8 + charwidth * sizeof(uint_t) * 2, "EIP", false);
|
||||
addColumnAt(8 + charwidth * sizeof(duint) * 2, "EIP", false);
|
||||
#endif //_WIN64
|
||||
addColumnAt(8 + charwidth * 14, "Suspend Count", false);
|
||||
addColumnAt(8 + charwidth * 12, "Priority", false);
|
||||
|
@ -224,9 +224,9 @@ void ThreadView::updateThreadList()
|
|||
else
|
||||
setCellContent(i, 0, QString("%1").arg(threadList.list[i].BasicInfo.ThreadNumber, 0, 10));
|
||||
setCellContent(i, 1, QString("%1").arg(threadList.list[i].BasicInfo.ThreadId, 0, 16).toUpper());
|
||||
setCellContent(i, 2, QString("%1").arg(threadList.list[i].BasicInfo.ThreadStartAddress, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 3, QString("%1").arg(threadList.list[i].BasicInfo.ThreadLocalBase, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 4, QString("%1").arg(threadList.list[i].ThreadCip, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 2, QString("%1").arg(threadList.list[i].BasicInfo.ThreadStartAddress, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 3, QString("%1").arg(threadList.list[i].BasicInfo.ThreadLocalBase, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 4, QString("%1").arg(threadList.list[i].ThreadCip, sizeof(dsint) * 2, 16, QChar('0')).toUpper());
|
||||
setCellContent(i, 5, QString().sprintf("%d", threadList.list[i].SuspendCount));
|
||||
QString priorityString;
|
||||
switch(threadList.list[i].Priority)
|
||||
|
@ -385,7 +385,7 @@ void ThreadView::updateThreadList()
|
|||
reloadData();
|
||||
}
|
||||
|
||||
QString ThreadView::paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
QString ThreadView::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
QString ret = StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
if(rowBase + rowOffset == mCurrentThread && !col)
|
||||
|
|
|
@ -9,7 +9,7 @@ class ThreadView : public StdTable
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit ThreadView(StdTable* parent = 0);
|
||||
QString paintContent(QPainter* painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
QString paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
void setupContextMenu();
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -10,7 +10,7 @@ WordEditDialog::WordEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Wo
|
|||
setModal(true);
|
||||
|
||||
mValidateThread = new ValidateExpressionThread(this);
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, int_t)), this, SLOT(expressionChanged(bool, bool, int_t)));
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, dsint)), this, SLOT(expressionChanged(bool, bool, dsint)));
|
||||
connect(ui->expressionLineEdit, SIGNAL(textEdited(QString)), mValidateThread, SLOT(textChanged(QString)));
|
||||
mWord = 0;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ void WordEditDialog::hideEvent(QHideEvent* event)
|
|||
mValidateThread->wait();
|
||||
}
|
||||
|
||||
void WordEditDialog::setup(QString title, uint_t defVal, int byteCount)
|
||||
void WordEditDialog::setup(QString title, duint defVal, int byteCount)
|
||||
{
|
||||
this->setWindowTitle(title);
|
||||
ui->hexLineEdit->setInputMask(QString("hh").repeated(byteCount));
|
||||
|
@ -43,12 +43,12 @@ void WordEditDialog::setup(QString title, uint_t defVal, int byteCount)
|
|||
ui->expressionLineEdit->setFocus();
|
||||
}
|
||||
|
||||
uint_t WordEditDialog::getVal()
|
||||
duint WordEditDialog::getVal()
|
||||
{
|
||||
return mWord;
|
||||
}
|
||||
|
||||
void WordEditDialog::expressionChanged(bool validExpression, bool validPointer, int_t value)
|
||||
void WordEditDialog::expressionChanged(bool validExpression, bool validPointer, dsint value)
|
||||
{
|
||||
Q_UNUSED(validPointer);
|
||||
if(validExpression)
|
||||
|
@ -60,7 +60,7 @@ void WordEditDialog::expressionChanged(bool validExpression, bool validPointer,
|
|||
|
||||
//hex
|
||||
mWord = value;
|
||||
uint_t hexWord = 0;
|
||||
duint hexWord = 0;
|
||||
unsigned char* hex = (unsigned char*)&hexWord;
|
||||
unsigned char* word = (unsigned char*)&mWord;
|
||||
#ifdef _WIN64
|
||||
|
@ -78,11 +78,11 @@ void WordEditDialog::expressionChanged(bool validExpression, bool validPointer,
|
|||
hex[2] = word[1];
|
||||
hex[3] = word[0];
|
||||
#endif //_WIN64
|
||||
ui->hexLineEdit->setText(QString("%1").arg(hexWord, sizeof(uint_t) * 2, 16, QChar('0')).toUpper());
|
||||
ui->hexLineEdit->setText(QString("%1").arg(hexWord, sizeof(duint) * 2, 16, QChar('0')).toUpper());
|
||||
//signed
|
||||
ui->signedLineEdit->setText(QString::number((int_t)mWord));
|
||||
ui->signedLineEdit->setText(QString::number((dsint)mWord));
|
||||
//unsigned
|
||||
ui->unsignedLineEdit->setText(QString::number((uint_t)mWord));
|
||||
ui->unsignedLineEdit->setText(QString::number((duint)mWord));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ void WordEditDialog::on_signedLineEdit_textEdited(const QString & arg1)
|
|||
{
|
||||
ui->signedLineEdit->setStyleSheet("");
|
||||
ui->buttons->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
ui->expressionLineEdit->setText(QString("%1").arg((uint_t)value, sizeof(uint_t) * 2, 16, QChar('0')).toUpper());
|
||||
ui->expressionLineEdit->setText(QString("%1").arg((duint)value, sizeof(duint) * 2, 16, QChar('0')).toUpper());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ void WordEditDialog::on_unsignedLineEdit_textEdited(const QString & arg1)
|
|||
{
|
||||
ui->unsignedLineEdit->setStyleSheet("");
|
||||
ui->buttons->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
ui->expressionLineEdit->setText(QString("%1").arg((uint_t)value, sizeof(uint_t) * 2, 16, QChar('0')).toUpper());
|
||||
ui->expressionLineEdit->setText(QString("%1").arg((duint)value, sizeof(duint) * 2, 16, QChar('0')).toUpper());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -18,20 +18,20 @@ class WordEditDialog : public QDialog
|
|||
public:
|
||||
explicit WordEditDialog(QWidget* parent = 0);
|
||||
~WordEditDialog();
|
||||
void setup(QString title, uint_t defVal, int byteCount);
|
||||
uint_t getVal();
|
||||
void setup(QString title, duint defVal, int byteCount);
|
||||
duint getVal();
|
||||
void showEvent(QShowEvent* event);
|
||||
void hideEvent(QHideEvent* event);
|
||||
|
||||
private slots:
|
||||
void expressionChanged(bool validExpression, bool validPointer, int_t value);
|
||||
void expressionChanged(bool validExpression, bool validPointer, dsint value);
|
||||
void on_expressionLineEdit_textChanged(const QString & arg1);
|
||||
void on_signedLineEdit_textEdited(const QString & arg1);
|
||||
void on_unsignedLineEdit_textEdited(const QString & arg1);
|
||||
|
||||
private:
|
||||
Ui::WordEditDialog* ui;
|
||||
uint_t mWord;
|
||||
duint mWord;
|
||||
ValidateExpressionThread* mValidateThread;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
#include "MemoryPage.h"
|
||||
|
||||
MemoryPage::MemoryPage(uint_t parBase, uint_t parSize, QObject* parent) : QObject(parent), mBase(0), mSize(0)
|
||||
MemoryPage::MemoryPage(duint parBase, duint parSize, QObject* parent) : QObject(parent), mBase(0), mSize(0)
|
||||
{
|
||||
Q_UNUSED(parBase);
|
||||
Q_UNUSED(parSize);
|
||||
}
|
||||
|
||||
bool MemoryPage::read(void* parDest, uint_t parRVA, uint_t parSize) const
|
||||
bool MemoryPage::read(void* parDest, duint parRVA, duint parSize) const
|
||||
{
|
||||
return DbgMemRead(mBase + parRVA, reinterpret_cast<unsigned char*>(parDest), parSize);
|
||||
}
|
||||
|
||||
bool MemoryPage::read(byte_t* parDest, uint_t parRVA, uint_t parSize) const
|
||||
bool MemoryPage::read(byte_t* parDest, duint parRVA, duint parSize) const
|
||||
{
|
||||
return read(reinterpret_cast<void*>(parDest), parRVA, parSize);
|
||||
}
|
||||
|
||||
bool MemoryPage::write(const void* parDest, uint_t parRVA, uint_t parSize)
|
||||
bool MemoryPage::write(const void* parDest, duint parRVA, duint parSize)
|
||||
{
|
||||
bool ret = DbgFunctions()->MemPatch(mBase + parRVA, reinterpret_cast<const unsigned char*>(parDest), parSize);
|
||||
GuiUpdatePatches();
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool MemoryPage::write(const byte_t* parDest, uint_t parRVA, uint_t parSize)
|
||||
bool MemoryPage::write(const byte_t* parDest, duint parRVA, duint parSize)
|
||||
{
|
||||
return write(reinterpret_cast<const void*>(parDest), parRVA, parSize);
|
||||
}
|
||||
|
||||
uint_t MemoryPage::getSize() const
|
||||
duint MemoryPage::getSize() const
|
||||
{
|
||||
return mSize;
|
||||
}
|
||||
|
||||
uint_t MemoryPage::getBase() const
|
||||
duint MemoryPage::getBase() const
|
||||
{
|
||||
return mBase;
|
||||
}
|
||||
|
||||
uint_t MemoryPage::va(int_t rva) const
|
||||
duint MemoryPage::va(dsint rva) const
|
||||
{
|
||||
return mBase + rva;
|
||||
}
|
||||
|
||||
void MemoryPage::setAttributes(uint_t base, uint_t size)
|
||||
void MemoryPage::setAttributes(duint base, duint size)
|
||||
{
|
||||
mBase = base;
|
||||
mSize = size;
|
||||
|
|
|
@ -8,20 +8,20 @@ class MemoryPage : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MemoryPage(uint_t parBase, uint_t parSize, QObject* parent = 0);
|
||||
explicit MemoryPage(duint parBase, duint parSize, QObject* parent = 0);
|
||||
|
||||
bool read(void* parDest, uint_t parRVA, uint_t parSize) const;
|
||||
bool read(byte_t* parDest, uint_t parRVA, uint_t parSize) const;
|
||||
bool write(const void* parDest, uint_t parRVA, uint_t parSize);
|
||||
bool write(const byte_t* parDest, uint_t parRVA, uint_t parSize);
|
||||
uint_t getSize() const;
|
||||
uint_t getBase() const;
|
||||
uint_t va(int_t rva) const;
|
||||
void setAttributes(uint_t base, uint_t size);
|
||||
bool read(void* parDest, duint parRVA, duint parSize) const;
|
||||
bool read(byte_t* parDest, duint parRVA, duint parSize) const;
|
||||
bool write(const void* parDest, duint parRVA, duint parSize);
|
||||
bool write(const byte_t* parDest, duint parRVA, duint parSize);
|
||||
duint getSize() const;
|
||||
duint getBase() const;
|
||||
duint va(dsint rva) const;
|
||||
void setAttributes(duint base, duint size);
|
||||
|
||||
private:
|
||||
uint_t mBase;
|
||||
uint_t mSize;
|
||||
duint mBase;
|
||||
duint mSize;
|
||||
};
|
||||
|
||||
#endif // MEMORYPAGE_H
|
||||
|
|
|
@ -9,7 +9,7 @@ class SnowmanView : public QWidget
|
|||
};
|
||||
|
||||
extern "C" __declspec(dllexport) SnowmanView* CreateSnowman(QWidget* parent);
|
||||
extern "C" __declspec(dllexport) void DecompileAt(SnowmanView* snowman, int_t start, int_t end);
|
||||
extern "C" __declspec(dllexport) void DecompileAt(SnowmanView* snowman, dsint start, dsint end);
|
||||
extern "C" __declspec(dllexport) void CloseSnowman(SnowmanView* snowman);
|
||||
|
||||
#endif // SNOWMANVIEW_H
|
||||
|
|
|
@ -13,7 +13,7 @@ Breakpoints::Breakpoints(QObject* parent) : QObject(parent)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::setBP(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::setBP(BPXTYPE type, duint va)
|
||||
{
|
||||
QString wCmd = "";
|
||||
|
||||
|
@ -21,19 +21,19 @@ void Breakpoints::setBP(BPXTYPE type, uint_t va)
|
|||
{
|
||||
case bp_normal:
|
||||
{
|
||||
wCmd = "bp " + QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bp " + QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
case bp_hardware:
|
||||
{
|
||||
wCmd = "bph " + QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bph " + QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
case bp_memory:
|
||||
{
|
||||
wCmd = "bpm " + QString("%1").arg(va, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bpm " + QString("%1").arg(va, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -60,15 +60,15 @@ void Breakpoints::enableBP(const BRIDGEBP & bp)
|
|||
|
||||
if(bp.type == bp_hardware)
|
||||
{
|
||||
wCmd = "bphwe " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphwe " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else if(bp.type == bp_normal)
|
||||
{
|
||||
wCmd = "be " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "be " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else if(bp.type == bp_memory)
|
||||
{
|
||||
wCmd = "bpme " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bpme " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -85,7 +85,7 @@ void Breakpoints::enableBP(const BRIDGEBP & bp)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::enableBP(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::enableBP(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
|
||||
|
@ -117,15 +117,15 @@ void Breakpoints::disableBP(const BRIDGEBP & bp)
|
|||
|
||||
if(bp.type == bp_hardware)
|
||||
{
|
||||
wCmd = "bphwd " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphwd " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else if(bp.type == bp_normal)
|
||||
{
|
||||
wCmd = "bd " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bd " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
else if(bp.type == bp_memory)
|
||||
{
|
||||
wCmd = "bpmd " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bpmd " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
|
||||
DbgCmdExec(wCmd.toUtf8().constData());
|
||||
|
@ -142,7 +142,7 @@ void Breakpoints::disableBP(const BRIDGEBP & bp)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::disableBP(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::disableBP(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
|
||||
|
@ -176,19 +176,19 @@ void Breakpoints::removeBP(const BRIDGEBP & bp)
|
|||
{
|
||||
case bp_normal:
|
||||
{
|
||||
wCmd = "bc " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bc " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
case bp_hardware:
|
||||
{
|
||||
wCmd = "bphc " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bphc " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
case bp_memory:
|
||||
{
|
||||
wCmd = "bpmc " + QString("%1").arg(bp.addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper();
|
||||
wCmd = "bpmc " + QString("%1").arg(bp.addr, sizeof(dsint) * 2, 16, QChar('0')).toUpper();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -213,7 +213,7 @@ void Breakpoints::removeBP(const BRIDGEBP & bp)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::removeBP(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::removeBP(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
|
||||
|
@ -260,7 +260,7 @@ void Breakpoints::toggleBPByDisabling(const BRIDGEBP & bp)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::toggleBPByDisabling(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::toggleBPByDisabling(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
|
||||
|
@ -287,7 +287,7 @@ void Breakpoints::toggleBPByDisabling(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return enabled/disabled.
|
||||
*/
|
||||
BPXSTATE Breakpoints::BPState(BPXTYPE type, uint_t va)
|
||||
BPXSTATE Breakpoints::BPState(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
BPXSTATE result = bp_non_existent;
|
||||
|
@ -330,7 +330,7 @@ BPXSTATE Breakpoints::BPState(BPXTYPE type, uint_t va)
|
|||
*
|
||||
* @return Nothing.
|
||||
*/
|
||||
void Breakpoints::toggleBPByRemoving(BPXTYPE type, uint_t va)
|
||||
void Breakpoints::toggleBPByRemoving(BPXTYPE type, duint va)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
bool wNormalWasRemoved = false;
|
||||
|
|
|
@ -17,17 +17,17 @@ class Breakpoints : public QObject
|
|||
|
||||
public:
|
||||
explicit Breakpoints(QObject* parent = 0);
|
||||
static void setBP(BPXTYPE type, uint_t va);
|
||||
static void setBP(BPXTYPE type, duint va);
|
||||
static void enableBP(const BRIDGEBP & bp);
|
||||
static void enableBP(BPXTYPE type, uint_t va);
|
||||
static void enableBP(BPXTYPE type, duint va);
|
||||
static void disableBP(const BRIDGEBP & bp);
|
||||
static void disableBP(BPXTYPE type, uint_t va);
|
||||
static void disableBP(BPXTYPE type, duint va);
|
||||
static void removeBP(const BRIDGEBP & bp);
|
||||
static void removeBP(BPXTYPE type, uint_t va);
|
||||
static void removeBP(BPXTYPE type, duint va);
|
||||
static void toggleBPByDisabling(const BRIDGEBP & bp);
|
||||
static void toggleBPByDisabling(BPXTYPE type, uint_t va);
|
||||
static void toggleBPByRemoving(BPXTYPE type, uint_t va);
|
||||
static BPXSTATE BPState(BPXTYPE type, uint_t va);
|
||||
static void toggleBPByDisabling(BPXTYPE type, duint va);
|
||||
static void toggleBPByRemoving(BPXTYPE type, duint va);
|
||||
static BPXSTATE BPState(BPXTYPE type, duint va);
|
||||
};
|
||||
|
||||
#endif // BREAKPOINTS_H
|
||||
|
|
|
@ -167,10 +167,10 @@ Configuration::Configuration() : QObject()
|
|||
defaultBools.insert("Engine", engineBool);
|
||||
|
||||
//uint settings
|
||||
QMap<QString, uint_t> hexdumpUint;
|
||||
QMap<QString, duint> hexdumpUint;
|
||||
hexdumpUint.insert("DefaultView", 0);
|
||||
defaultUints.insert("HexDump", hexdumpUint);
|
||||
QMap<QString, uint_t> disasmUint;
|
||||
QMap<QString, duint> disasmUint;
|
||||
disasmUint.insert("MaxModuleSize", -1);
|
||||
defaultUints.insert("Disassembler", disasmUint);
|
||||
|
||||
|
@ -382,7 +382,7 @@ void Configuration::readUints()
|
|||
for(int i = 0; i < Uints.size(); i++)
|
||||
{
|
||||
QString category = Uints.keys().at(i);
|
||||
QMap<QString, uint_t>* currentUint = &Uints[category];
|
||||
QMap<QString, duint>* currentUint = &Uints[category];
|
||||
for(int j = 0; j < currentUint->size(); j++)
|
||||
{
|
||||
QString id = (*currentUint).keys().at(j);
|
||||
|
@ -397,7 +397,7 @@ void Configuration::writeUints()
|
|||
for(int i = 0; i < Uints.size(); i++)
|
||||
{
|
||||
QString category = Uints.keys().at(i);
|
||||
QMap<QString, uint_t>* currentUint = &Uints[category];
|
||||
QMap<QString, duint>* currentUint = &Uints[category];
|
||||
for(int j = 0; j < currentUint->size(); j++)
|
||||
{
|
||||
QString id = (*currentUint).keys().at(j);
|
||||
|
@ -523,7 +523,7 @@ void Configuration::setBool(const QString category, const QString id, const bool
|
|||
msg.exec();
|
||||
}
|
||||
|
||||
const uint_t Configuration::getUint(const QString category, const QString id) const
|
||||
const duint Configuration::getUint(const QString category, const QString id) const
|
||||
{
|
||||
if(Uints.contains(category))
|
||||
{
|
||||
|
@ -542,7 +542,7 @@ const uint_t Configuration::getUint(const QString category, const QString id) co
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Configuration::setUint(const QString category, const QString id, const uint_t i)
|
||||
void Configuration::setUint(const QString category, const QString id, const duint i)
|
||||
{
|
||||
if(Uints.contains(category))
|
||||
{
|
||||
|
@ -659,7 +659,7 @@ bool Configuration::boolToConfig(const QString category, const QString id, const
|
|||
return BridgeSettingSetUint(category.toUtf8().constData(), id.toUtf8().constData(), bBool);
|
||||
}
|
||||
|
||||
uint_t Configuration::uintFromConfig(const QString category, const QString id)
|
||||
duint Configuration::uintFromConfig(const QString category, const QString id)
|
||||
{
|
||||
duint setting;
|
||||
if(!BridgeSettingGetUint(category.toUtf8().constData(), id.toUtf8().constData(), &setting))
|
||||
|
@ -675,7 +675,7 @@ uint_t Configuration::uintFromConfig(const QString category, const QString id)
|
|||
return setting;
|
||||
}
|
||||
|
||||
bool Configuration::uintToConfig(const QString category, const QString id, uint_t i)
|
||||
bool Configuration::uintToConfig(const QString category, const QString id, duint i)
|
||||
{
|
||||
return BridgeSettingSetUint(category.toUtf8().constData(), id.toUtf8().constData(), i);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ public:
|
|||
const QColor getColor(const QString id) const;
|
||||
const bool getBool(const QString category, const QString id) const;
|
||||
void setBool(const QString category, const QString id, const bool b);
|
||||
const uint_t getUint(const QString category, const QString id) const;
|
||||
void setUint(const QString category, const QString id, const uint_t i);
|
||||
const duint getUint(const QString category, const QString id) const;
|
||||
void setUint(const QString category, const QString id, const duint i);
|
||||
const QFont getFont(const QString id) const;
|
||||
const Shortcut getShortcut(const QString key_id) const;
|
||||
void setShortcut(const QString key_id, const QKeySequence key_sequence);
|
||||
|
@ -64,14 +64,14 @@ public:
|
|||
//default setting maps
|
||||
QMap<QString, QColor> defaultColors;
|
||||
QMap<QString, QMap<QString, bool>> defaultBools;
|
||||
QMap<QString, QMap<QString, uint_t>> defaultUints;
|
||||
QMap<QString, QMap<QString, duint>> defaultUints;
|
||||
QMap<QString, QFont> defaultFonts;
|
||||
QMap<QString, Shortcut> defaultShortcuts;
|
||||
|
||||
//public variables
|
||||
QMap<QString, QColor> Colors;
|
||||
QMap<QString, QMap<QString, bool>> Bools;
|
||||
QMap<QString, QMap<QString, uint_t>> Uints;
|
||||
QMap<QString, QMap<QString, duint>> Uints;
|
||||
QMap<QString, QFont> Fonts;
|
||||
QMap<QString, Shortcut> Shortcuts;
|
||||
|
||||
|
@ -87,8 +87,8 @@ private:
|
|||
bool colorToConfig(const QString id, const QColor color);
|
||||
bool boolFromConfig(const QString category, const QString id);
|
||||
bool boolToConfig(const QString category, const QString id, bool bBool);
|
||||
uint_t uintFromConfig(const QString category, const QString id);
|
||||
bool uintToConfig(const QString category, const QString id, uint_t i);
|
||||
duint uintFromConfig(const QString category, const QString id);
|
||||
bool uintToConfig(const QString category, const QString id, duint i);
|
||||
QFont fontFromConfig(const QString id);
|
||||
bool fontToConfig(const QString id, const QFont font);
|
||||
QString shortcutFromConfig(const QString id);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <QString>
|
||||
#include "NewTypes.h"
|
||||
|
||||
static QString AddressToString(int_t Address)
|
||||
static QString AddressToString(dsint Address)
|
||||
{
|
||||
//
|
||||
// This function exists because of how QT handles
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
void stop();
|
||||
|
||||
signals:
|
||||
void expressionChanged(bool validExpression, bool validPointer, int_t value);
|
||||
void expressionChanged(bool validExpression, bool validPointer, dsint value);
|
||||
|
||||
public slots:
|
||||
void textChanged(QString text);
|
||||
|
|
|
@ -59,8 +59,8 @@ int main(int argc, char* argv[])
|
|||
application.setFont(ConfigFont("Application"));
|
||||
|
||||
// Register custom data types
|
||||
qRegisterMetaType<int_t>("int_t");
|
||||
qRegisterMetaType<uint_t>("uint_t");
|
||||
qRegisterMetaType<dsint>("dsint");
|
||||
qRegisterMetaType<duint>("duint");
|
||||
qRegisterMetaType<byte_t>("byte_t");
|
||||
qRegisterMetaType<DBGSTATE>("DBGSTATE");
|
||||
|
||||
|
|
|
@ -155,7 +155,6 @@ HEADERS += \
|
|||
Src/Disassembler/QBeaEngine.h \
|
||||
Src/Memory/MemoryPage.h \
|
||||
Src/Bridge/Bridge.h \
|
||||
Src/Global/NewTypes.h \
|
||||
Src/Exports.h \
|
||||
Src/Imports.h \
|
||||
Src/BasicView/StdTable.h \
|
||||
|
|
|
@ -28,3 +28,12 @@ typedef signed long long dsint;
|
|||
typedef unsigned long __w64 duint;
|
||||
typedef signed long __w64 dsint;
|
||||
#endif // COMPILE_64
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
Loading…
Reference in New Issue