GUI: added Binary->Paste (Ignore Size) in Disassembly/Stack
This commit is contained in:
		
							parent
							
								
									31454f35ba
								
							
						
					
					
						commit
						4712566802
					
				|  | @ -255,6 +255,11 @@ void CPUDisassembly::setupRightClickContextMenu() | |||
|     connect(mBinaryPasteAction, SIGNAL(triggered()), this, SLOT(binaryPasteSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteAction); | ||||
| 
 | ||||
|     //Binary->Paste (Ignore Size)
 | ||||
|     mBinaryPasteIgnoreSizeAction = new QAction("Paste (&Ignore Size)", this); | ||||
|     connect(mBinaryPasteIgnoreSizeAction, SIGNAL(triggered()), this, SLOT(binaryPasteIgnoreSizeSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteIgnoreSizeAction); | ||||
| 
 | ||||
|     // Labels
 | ||||
|     mSetLabel = new QAction("Label", this); | ||||
|     mSetLabel->setShortcutContext(Qt::WidgetShortcut); | ||||
|  | @ -895,3 +900,19 @@ void CPUDisassembly::binaryPasteSlot() | |||
|     mMemPage->write(patched.constData(), selStart, selSize); | ||||
|     GuiUpdateAllViews(); | ||||
| } | ||||
| 
 | ||||
| void CPUDisassembly::binaryPasteIgnoreSizeSlot() | ||||
| { | ||||
|     HexEditDialog hexEdit(this); | ||||
|     int_t selStart = getSelectionStart(); | ||||
|     int_t selSize = getSelectionEnd() - selStart + 1; | ||||
|     QClipboard *clipboard = QApplication::clipboard(); | ||||
|     hexEdit.mHexEdit->setData(clipboard->text()); | ||||
| 
 | ||||
|     byte_t* data = new byte_t[selSize]; | ||||
|     mMemPage->read(data, selStart, selSize); | ||||
|     QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, selSize)); | ||||
|     delete [] data; | ||||
|     mMemPage->write(patched.constData(), selStart, patched.size()); | ||||
|     GuiUpdateAllViews(); | ||||
| } | ||||
|  |  | |||
|  | @ -63,6 +63,7 @@ public slots: | |||
|     void binaryFillSlot(); | ||||
|     void binaryCopySlot(); | ||||
|     void binaryPasteSlot(); | ||||
|     void binaryPasteIgnoreSizeSlot(); | ||||
| 
 | ||||
| private: | ||||
| 
 | ||||
|  | @ -79,6 +80,7 @@ private: | |||
|     QAction* mBinaryFillAction; | ||||
|     QAction* mBinaryCopyAction; | ||||
|     QAction* mBinaryPasteAction; | ||||
|     QAction* mBinaryPasteIgnoreSizeAction; | ||||
|     QAction* mToggleInt3BpAction; | ||||
|     QAction* mSetHwBpAction; | ||||
|     QAction* mClearHwBpAction; | ||||
|  |  | |||
|  | @ -108,8 +108,8 @@ void CPUDump::setupContextMenu() | |||
|     connect(mBinaryPasteAction, SIGNAL(triggered()), this, SLOT(binaryPasteSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteAction); | ||||
| 
 | ||||
|     //Binary->Paste
 | ||||
|     mBinaryPasteIgnoreSizeAction = new QAction("&Paste (Ignore Size)", this); | ||||
|     //Binary->Paste (Ignore Size)
 | ||||
|     mBinaryPasteIgnoreSizeAction = new QAction("Paste (&Ignore Size)", this); | ||||
|     connect(mBinaryPasteIgnoreSizeAction, SIGNAL(triggered()), this, SLOT(binaryPasteIgnoreSizeSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteIgnoreSizeAction); | ||||
| 
 | ||||
|  | @ -1086,7 +1086,7 @@ void CPUDump::binaryPasteIgnoreSizeSlot() | |||
|     QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, selSize)); | ||||
|     delete [] data; | ||||
|     mMemPage->write(patched.constData(), selStart, patched.size()); | ||||
|     reloadData(); | ||||
|     GuiUpdateAllViews(); | ||||
| } | ||||
| 
 | ||||
| void CPUDump::findPattern() | ||||
|  |  | |||
|  | @ -79,6 +79,11 @@ void CPUStack::setupContextMenu() | |||
|     connect(mBinaryPasteAction, SIGNAL(triggered()), this, SLOT(binaryPasteSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteAction); | ||||
| 
 | ||||
|     //Binary->Paste (Ignore Size)
 | ||||
|     mBinaryPasteIgnoreSizeAction = new QAction("Paste (&Ignore Size)", this); | ||||
|     connect(mBinaryPasteIgnoreSizeAction, SIGNAL(triggered()), this, SLOT(binaryPasteIgnoreSizeSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteIgnoreSizeAction); | ||||
| 
 | ||||
| #ifdef _WIN64 | ||||
|     mGotoSp = new QAction("Follow R&SP", this); | ||||
|     mGotoBp = new QAction("Follow R&BP", this); | ||||
|  | @ -408,6 +413,22 @@ void CPUStack::binaryPasteSlot() | |||
|     GuiUpdateAllViews(); | ||||
| } | ||||
| 
 | ||||
| void CPUStack::binaryPasteIgnoreSizeSlot() | ||||
| { | ||||
|     HexEditDialog hexEdit(this); | ||||
|     int_t selStart = getSelectionStart(); | ||||
|     int_t selSize = getSelectionEnd() - selStart + 1; | ||||
|     QClipboard *clipboard = QApplication::clipboard(); | ||||
|     hexEdit.mHexEdit->setData(clipboard->text()); | ||||
| 
 | ||||
|     byte_t* data = new byte_t[selSize]; | ||||
|     mMemPage->read(data, selStart, selSize); | ||||
|     QByteArray patched = hexEdit.mHexEdit->applyMaskedData(QByteArray((const char*)data, selSize)); | ||||
|     delete [] data; | ||||
|     mMemPage->write(patched.constData(), selStart, patched.size()); | ||||
|     GuiUpdateAllViews(); | ||||
| } | ||||
| 
 | ||||
| void CPUStack::findPattern() | ||||
| { | ||||
|     HexEditDialog hexEdit(this); | ||||
|  |  | |||
|  | @ -39,6 +39,7 @@ public slots: | |||
|     void binaryCopySlot(); | ||||
|     void binaryPasteSlot(); | ||||
|     void findPattern(); | ||||
|     void binaryPasteIgnoreSizeSlot(); | ||||
| 
 | ||||
| private: | ||||
|     uint_t mCsp; | ||||
|  | @ -48,6 +49,7 @@ private: | |||
|     QAction* mBinaryFillAction; | ||||
|     QAction* mBinaryCopyAction; | ||||
|     QAction* mBinaryPasteAction; | ||||
|     QAction* mBinaryPasteIgnoreSizeAction; | ||||
|     QAction* mGotoSp; | ||||
|     QAction* mGotoBp; | ||||
|     QAction* mGotoExpression; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue