GUI: Added a new Binary menu action - Paste (Ignore Size)
This commit is contained in:
		
							parent
							
								
									37d1ae3c80
								
							
						
					
					
						commit
						4cb0679d4d
					
				|  | @ -108,6 +108,11 @@ void CPUDump::setupContextMenu() | |||
|     connect(mBinaryPasteAction, SIGNAL(triggered()), this, SLOT(binaryPasteSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteAction); | ||||
| 
 | ||||
|     //Binary->Paste
 | ||||
|     mBinaryPasteIgnoreSizeAction = new QAction("&Paste (Ignore Size)", this); | ||||
|     connect(mBinaryPasteIgnoreSizeAction, SIGNAL(triggered()), this, SLOT(binaryPasteIgnoreSizeSlot())); | ||||
|     mBinaryMenu->addAction(mBinaryPasteIgnoreSizeAction); | ||||
| 
 | ||||
|     //Label
 | ||||
|     mSetLabelAction = new QAction("Set Label", this); | ||||
|     mSetLabelAction->setShortcutContext(Qt::WidgetShortcut); | ||||
|  | @ -1068,6 +1073,22 @@ void CPUDump::binaryPasteSlot() | |||
|     reloadData(); | ||||
| } | ||||
| 
 | ||||
| void CPUDump::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()); | ||||
|     reloadData(); | ||||
| } | ||||
| 
 | ||||
| void CPUDump::findPattern() | ||||
| { | ||||
|     HexEditDialog hexEdit(this); | ||||
|  |  | |||
|  | @ -76,6 +76,7 @@ public slots: | |||
|     void binaryFillSlot(); | ||||
|     void binaryCopySlot(); | ||||
|     void binaryPasteSlot(); | ||||
|     void binaryPasteIgnoreSizeSlot(); | ||||
|     void findPattern(); | ||||
| 
 | ||||
| private: | ||||
|  | @ -151,6 +152,7 @@ private: | |||
|     QAction* mBinaryFillAction; | ||||
|     QAction* mBinaryCopyAction; | ||||
|     QAction* mBinaryPasteAction; | ||||
|     QAction* mBinaryPasteIgnoreSizeAction; | ||||
|     QAction* mFindPatternAction; | ||||
| 
 | ||||
|     QMenu* mSpecialMenu; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue