x64dbg中隐藏的热键被我发现了
void HexDump::mousePressEvent(QMouseEvent* event){
if(event->buttons() == Qt::MiddleButton) //copy address to clipboard
{
if(!DbgIsDebugging())
return;
MessageBeep(MB_OK);
QString addrText = ToPtrString(rvaToVa(getInitialSelection()));
Bridge::CopyToClipboard(addrText);
return;
}
//qDebug() << "HexDump::mousePressEvent";
int x = event->x();
int y = event->y();
bool wAccept = false;
if(((event->buttons() & Qt::LeftButton) != 0) && ((event->buttons() & Qt::RightButton) == 0))
{
if(getGuiState() == AbstractTableView::NoState)
{
if(y > getHeaderHeight() && y <= this->height())
{
int wColIndex = getColumnIndexFromX(x);
if(mForceColumn != -1)
{
wColIndex = mForceColumn;
x = getColumnPosition(mForceColumn) + 1;
}
if(wColIndex > 0 && mDescriptor.at(wColIndex - 1).isData == true) // No selection for first column (addresses) and no data columns
{
dsint wStartingAddress = getItemStartingAddress(x, y);
dsint dataSize = getSizeOf(mDescriptor.at(wColIndex - 1).data.itemSize) - 1;
dsint wEndingAddress = wStartingAddress + dataSize;
if(wEndingAddress < (dsint)mMemPage->getSize())
{
bool bUpdateTo = false;
if(!(event->modifiers() & Qt::ShiftModifier))
setSingleSelection(wStartingAddress);
else if(getInitialSelection() > wEndingAddress)
{
wEndingAddress -= dataSize;
bUpdateTo = true;
}
expandSelectionUpTo(wEndingAddress);
if(bUpdateTo)
{
mSelection.toIndex += dataSize;
emit selectionUpdated();
}
mGuiState = HexDump::MultiRowsSelectionState;
updateViewport();
}
}
else if(wColIndex == 0)
{
dsint wStartingAddress = getItemStartingAddress(getColumnPosition(1) + 1, y);
dsint dataSize = getSizeOf(mDescriptor.at(0).data.itemSize) * mDescriptor.at(0).itemCount - 1;
dsint wEndingAddress = wStartingAddress + dataSize;
if(wEndingAddress < (dsint)mMemPage->getSize())
{
bool bUpdateTo = false;
if(!(event->modifiers() & Qt::ShiftModifier))
setSingleSelection(wStartingAddress);
else if(getInitialSelection() > wEndingAddress)
{
wEndingAddress -= dataSize;
bUpdateTo = true;
}
expandSelectionUpTo(wEndingAddress);
if(bUpdateTo)
{
mSelection.toIndex += dataSize;
emit selectionUpdated();
}
mGuiState = HexDump::MultiRowsSelectionState;
updateViewport();
}
}
wAccept = true;
}
}
}
if(wAccept == false)
AbstractTableView::mousePressEvent(event);
} @苏紫方璇
QT中的响铃是这么写的:MessageBeep(MB_OK);
看到了下面的代码,我果断粘过去了奏乐的代码
可以没事的时候搞个 F7 F8 F9 等调试热键,配上1234567的音乐:lol
void Bridge::CopyToClipboard(const QString & text)
{
if(!text.length())
return;
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(text);
GuiAddStatusBarMessage(tr("The data has been copied to clipboard.\n").toUtf8().constData());
QFile file(":/icons/images/egg.wav");
if(file.open(QIODevice::ReadOnly))
{
QByteArray egg = file.readAll();
PlaySoundA(egg.data(), 0, SND_MEMORY | SND_ASYNC | SND_NODEFAULT);
}
}
void Bridge::CopyToClipboard(const QString & text, const QString & htmlText)
{
QMimeData* mimeData = new QMimeData();
mimeData->setData("text/html", htmlText.toUtf8()); // Set text/html data
mimeData->setData("text/plain", text.toUtf8());//Set text/plain data
//Reason not using setText() or setHtml():Don't support storing multiple data in one QMimeData
QApplication::clipboard()->setMimeData(mimeData); //Copy the QMimeData with text and html data
GuiAddStatusBarMessage(tr("The data has been copied to clipboard.\n").toUtf8().constData());
QFile file(":/icons/images/egg.wav");
if(file.open(QIODevice::ReadOnly))
{
QByteArray egg = file.readAll();
PlaySoundA(egg.data(), 0, SND_MEMORY | SND_ASYNC | SND_NODEFAULT);
}
}
学习了,谢谢 不明觉厉 我学了个假python 为什么能写这么复杂 symphonyNo9 发表于 2021-11-17 10:13
为什么能写这么复杂
QT导演就是这么编剧的啊。 前排学习学习... 看到这么多的代码俺头晕!!! 不明觉厉,希望能用
页:
[1]
2