From 417e8a997e696e617e235704eaebfa2e8bdd83dc Mon Sep 17 00:00:00 2001 From: horsicq Date: Wed, 14 Aug 2024 07:47:19 +0200 Subject: [PATCH] Update file(s): 2024-08-14 --- Binary/binarywidget.cpp | 3 ++- DEX/dexwidget.cpp | 3 ++- ELF/elfwidget.cpp | 3 ++- LE/lewidget.cpp | 3 ++- MACH/machsectionheaderwidget.cpp | 2 +- MACH/machsectionheaderwidget.h | 2 +- MACH/machwidget.cpp | 3 ++- MSDOS/msdoswidget.cpp | 5 +++-- MSDOS/msdoswidget.h | 2 +- NE/nesectionheaderwidget.cpp | 2 +- NE/nesectionheaderwidget.h | 2 +- NE/newidget.cpp | 3 ++- PE/pesectionheaderwidget.cpp | 2 +- PE/pesectionheaderwidget.h | 2 +- PE/pewidget.cpp | 4 ++-- PE/pewidget.h | 2 +- dialogsectionheader.cpp | 2 ++ formatwidget.cpp | 14 ++++++++------ 18 files changed, 35 insertions(+), 24 deletions(-) diff --git a/Binary/binarywidget.cpp b/Binary/binarywidget.cpp index 2ca9bd49..3b95edd9 100644 --- a/Binary/binarywidget.cpp +++ b/Binary/binarywidget.cpp @@ -200,9 +200,10 @@ void BinaryWidget::reloadData(bool bSaveSelection) } } else if (nType == SBINARY::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/DEX/dexwidget.cpp b/DEX/dexwidget.cpp index dfe3b2ce..5f513332 100644 --- a/DEX/dexwidget.cpp +++ b/DEX/dexwidget.cpp @@ -341,9 +341,10 @@ void DEXWidget::reloadData(bool bSaveSelection) } } else if (nType == SDEX::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; // options.bMenu_Disasm=true; // TODO options.bMenu_MemoryMap = true; + options.fileType = dex.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/ELF/elfwidget.cpp b/ELF/elfwidget.cpp index cb03bbd7..c8fa6fda 100644 --- a/ELF/elfwidget.cpp +++ b/ELF/elfwidget.cpp @@ -302,9 +302,10 @@ void ELFWidget::reloadData(bool bSaveSelection) } } else if (nType == SELF::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = elf.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/LE/lewidget.cpp b/LE/lewidget.cpp index 62c3d733..51c84be1 100755 --- a/LE/lewidget.cpp +++ b/LE/lewidget.cpp @@ -354,9 +354,10 @@ void LEWidget::reloadData(bool bSaveSelection) } } else if (nType == SLE::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = le.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/MACH/machsectionheaderwidget.cpp b/MACH/machsectionheaderwidget.cpp index feda635b..63e0db2f 100644 --- a/MACH/machsectionheaderwidget.cpp +++ b/MACH/machsectionheaderwidget.cpp @@ -174,7 +174,7 @@ void MACHSectionHeaderWidget::setGlobal(XShortcuts *pShortcuts, XOptions *pXOpti XShortcutsWidget::setGlobal(pShortcuts, pXOptions); } -FormatWidget::SV MACHSectionHeaderWidget::_setValue(QVariant vValue, qint32 nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset) +FormatWidget::SV MACHSectionHeaderWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset) { Q_UNUSED(nVtype) Q_UNUSED(nPosition) diff --git a/MACH/machsectionheaderwidget.h b/MACH/machsectionheaderwidget.h index 327e62a2..9e690f80 100644 --- a/MACH/machsectionheaderwidget.h +++ b/MACH/machsectionheaderwidget.h @@ -42,7 +42,7 @@ class MACHSectionHeaderWidget : public FormatWidget { virtual void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions); protected: - virtual SV _setValue(QVariant vValue, qint32 nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset); + virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset); virtual void setReadonly(bool bState); virtual void blockSignals(bool bState); virtual void adjustHeaderTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/MACH/machwidget.cpp b/MACH/machwidget.cpp index 0ded51f4..2204429c 100644 --- a/MACH/machwidget.cpp +++ b/MACH/machwidget.cpp @@ -1454,9 +1454,10 @@ void MACHWidget::reloadData(bool bSaveSelection) } } else if (nType == SMACH::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = mach.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/MSDOS/msdoswidget.cpp b/MSDOS/msdoswidget.cpp index ece62ae1..39daa41b 100644 --- a/MSDOS/msdoswidget.cpp +++ b/MSDOS/msdoswidget.cpp @@ -107,7 +107,7 @@ void MSDOSWidget::reload() } } -FormatWidget::SV MSDOSWidget::_setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset) +FormatWidget::SV MSDOSWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset) { Q_UNUSED(nVtype) Q_UNUSED(nPosition) @@ -272,9 +272,10 @@ void MSDOSWidget::reloadData(bool bSaveSelection) } } else if (nType == SMSDOS::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = msdos.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/MSDOS/msdoswidget.h b/MSDOS/msdoswidget.h index 90c41717..9f68dc85 100644 --- a/MSDOS/msdoswidget.h +++ b/MSDOS/msdoswidget.h @@ -41,7 +41,7 @@ class MSDOSWidget : public FormatWidget { virtual void reload(); protected: - virtual SV _setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset); + virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset); virtual void setReadonly(bool bState); virtual void blockSignals(bool bState); virtual void adjustHeaderTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/NE/nesectionheaderwidget.cpp b/NE/nesectionheaderwidget.cpp index 6dc4f1ff..3669d19f 100644 --- a/NE/nesectionheaderwidget.cpp +++ b/NE/nesectionheaderwidget.cpp @@ -45,7 +45,7 @@ void NESectionHeaderWidget::reload() { } -FormatWidget::SV NESectionHeaderWidget::_setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset) +FormatWidget::SV NESectionHeaderWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset) { Q_UNUSED(vValue) Q_UNUSED(nStype) diff --git a/NE/nesectionheaderwidget.h b/NE/nesectionheaderwidget.h index 07c82577..bc60160d 100644 --- a/NE/nesectionheaderwidget.h +++ b/NE/nesectionheaderwidget.h @@ -45,7 +45,7 @@ class NESectionHeaderWidget : public FormatWidget { virtual void reload(); protected: - virtual SV _setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset); + virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset); virtual void setReadonly(bool bState); virtual void blockSignals(bool bState); virtual void adjustHeaderTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/NE/newidget.cpp b/NE/newidget.cpp index 3086db09..ff47befe 100644 --- a/NE/newidget.cpp +++ b/NE/newidget.cpp @@ -366,9 +366,10 @@ void NEWidget::reloadData(bool bSaveSelection) } } else if (nType == SNE::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; + options.fileType = ne.getFileType(); if (bSaveSelection) { options.nStartSelectionOffset = -1; diff --git a/PE/pesectionheaderwidget.cpp b/PE/pesectionheaderwidget.cpp index 6fc0f1d3..01055d7d 100644 --- a/PE/pesectionheaderwidget.cpp +++ b/PE/pesectionheaderwidget.cpp @@ -136,7 +136,7 @@ void PESectionHeaderWidget::setGlobal(XShortcuts *pShortcuts, XOptions *pXOption XShortcutsWidget::setGlobal(pShortcuts, pXOptions); } -FormatWidget::SV PESectionHeaderWidget::_setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset) +FormatWidget::SV PESectionHeaderWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset) { Q_UNUSED(nVtype) Q_UNUSED(nOffset) diff --git a/PE/pesectionheaderwidget.h b/PE/pesectionheaderwidget.h index 68110b89..42aa90eb 100644 --- a/PE/pesectionheaderwidget.h +++ b/PE/pesectionheaderwidget.h @@ -42,7 +42,7 @@ class PESectionHeaderWidget : public FormatWidget { virtual void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions); protected: - virtual SV _setValue(QVariant vValue, int nStype, int nNdata, int nVtype, int nPosition, qint64 nOffset); + virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset); virtual void setReadonly(bool bState); virtual void blockSignals(bool bState); virtual void adjustHeaderTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/PE/pewidget.cpp b/PE/pewidget.cpp index c28bf9f1..e0b2b1ca 100755 --- a/PE/pewidget.cpp +++ b/PE/pewidget.cpp @@ -264,7 +264,7 @@ void PEWidget::setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions) FormatWidget::setGlobal(pShortcuts, pXOptions); } -FormatWidget::SV PEWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, int nPosition, qint64 nOffset) +FormatWidget::SV PEWidget::_setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset) { Q_UNUSED(nVtype) Q_UNUSED(nPosition) @@ -1053,7 +1053,7 @@ void PEWidget::reloadData(bool bSaveSelection) } } else if (nType == SPE::TYPE_HEX) { if (!isInitPresent(sInit)) { - XHexView::OPTIONS options = {}; + XHexViewWidget::OPTIONS options = {}; options.bMenu_Disasm = true; options.bMenu_MemoryMap = true; diff --git a/PE/pewidget.h b/PE/pewidget.h index 23f53410..90cc948b 100755 --- a/PE/pewidget.h +++ b/PE/pewidget.h @@ -45,7 +45,7 @@ class PEWidget : public FormatWidget { void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions); // Important protected: - virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, int nPosition, qint64 nOffset); + virtual SV _setValue(QVariant vValue, qint32 nStype, qint32 nNdata, qint32 nVtype, qint32 nPosition, qint64 nOffset); virtual void setReadonly(bool bState); virtual void blockSignals(bool bState); virtual void adjustHeaderTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/dialogsectionheader.cpp b/dialogsectionheader.cpp index 08be9d64..1151730d 100644 --- a/dialogsectionheader.cpp +++ b/dialogsectionheader.cpp @@ -69,6 +69,8 @@ void DialogSectionHeader::setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions) if (g_pWidget) { g_pWidget->setGlobal(pShortcuts, pXOptions); } + + XShortcutsDialog::setGlobal(pShortcuts, pXOptions); } void DialogSectionHeader::adjustView() diff --git a/formatwidget.cpp b/formatwidget.cpp index 803a7417..11297a96 100644 --- a/formatwidget.cpp +++ b/formatwidget.cpp @@ -1233,10 +1233,10 @@ void FormatWidget::valueChangedSlot(QVariant varValue) { XLineEditHEX *pLineEdit = qobject_cast(sender()); - int nStype = pLineEdit->property("STYPE").toInt(); - int nNdata = pLineEdit->property("NDATA").toInt(); - int nVtype = pLineEdit->property("VTYPE").toInt(); - int nPosition = pLineEdit->property("POSITION").toInt(); + qint32 nStype = pLineEdit->property("STYPE").toInt(); + qint32 nNdata = pLineEdit->property("NDATA").toInt(); + qint32 nVtype = pLineEdit->property("VTYPE").toInt(); + qint32 nPosition = pLineEdit->property("POSITION").toInt(); qint64 nOffset = pLineEdit->property("OFFSET").toLongLong(); setValue(varValue, nStype, nNdata, nVtype, nPosition, nOffset); @@ -1280,14 +1280,16 @@ void FormatWidget::allReload(qint64 nDeviceOffset, qint64 nDeviceSize) void FormatWidget::showHex(qint64 nOffset, qint64 nSize) { - XHexView::OPTIONS hexOptions = {}; + XHexViewWidget::OPTIONS hexOptions = {}; hexOptions.nStartAddress = 0; hexOptions.nStartSelectionOffset = nOffset; hexOptions.nSizeOfSelection = nSize; - DialogHexView dialogHexView(this, getDevice(), hexOptions, getXInfoDB()); + DialogHexView dialogHexView(this); dialogHexView.setGlobal(getShortcuts(), getGlobalOptions()); + dialogHexView.setData(getDevice(), hexOptions); + dialogHexView.setXInfoDB(getXInfoDB()); connect(&dialogHexView, SIGNAL(editState(bool)), this, SLOT(setEdited(bool)));