├── README.md ├── icons ├── main.ico └── main.icns ├── xneviewer_source.pro ├── gui_source ├── pics │ └── logo.png ├── rsrc.qrc ├── gui_source.pro ├── dialogabout.h ├── dialogabout.cpp ├── dialogoptions.h ├── dialogoptions.cpp ├── guimainwindow.h ├── main_gui.cpp ├── dialogabout.ui ├── dialogoptions.ui ├── guimainwindow.ui └── guimainwindow.cpp ├── LICENSE ├── global.h └── .gitmodules /README.md: -------------------------------------------------------------------------------- 1 | XNEViewer -------------------------------------------------------------------------------- /icons/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XNEViewer/master/icons/main.ico -------------------------------------------------------------------------------- /icons/main.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XNEViewer/master/icons/main.icns -------------------------------------------------------------------------------- /xneviewer_source.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += gui_source 4 | -------------------------------------------------------------------------------- /gui_source/pics/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/horsicq/XNEViewer/master/gui_source/pics/logo.png -------------------------------------------------------------------------------- /gui_source/rsrc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | pics/logo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /gui_source/gui_source.pro: -------------------------------------------------------------------------------- 1 | QT += core gui widgets 2 | 3 | TARGET = xneviewer 4 | TEMPLATE = app 5 | 6 | CONFIG += c++11 7 | 8 | SOURCES += \ 9 | guimainwindow.cpp \ 10 | main_gui.cpp \ 11 | dialogoptions.cpp \ 12 | dialogabout.cpp 13 | 14 | HEADERS += \ 15 | dialogoptions.h \ 16 | dialogabout.h \ 17 | guimainwindow.h 18 | 19 | FORMS += \ 20 | dialogoptions.ui \ 21 | dialogabout.ui \ 22 | guimainwindow.ui 23 | 24 | include(../build.pri) 25 | 26 | !contains(XCONFIG, newidget) { 27 | XCONFIG += newidget 28 | include(../FormatWidgets/NE/newidget.pri) 29 | } 30 | 31 | !contains(XCONFIG, xoptions) { 32 | XCONFIG += xoptions 33 | include(../../_mylibs/xoptions/xoptions.pri) 34 | } 35 | 36 | win32 { 37 | RC_ICONS = ../icons/main.ico 38 | } 39 | macx { 40 | ICON = ../icons/main.icns 41 | } 42 | 43 | RESOURCES += \ 44 | rsrc.qrc 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2025 hors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /global.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 hors 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all 11 | // copies or substantial portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | // SOFTWARE. 20 | // 21 | #ifndef _GLOBAL_H 22 | #define _GLOBAL_H 23 | 24 | #include 25 | 26 | #define X_APPLICATIONDISPLAYNAME "XNEViewer" 27 | #define X_APPLICATIONNAME "xneviewer" 28 | #define X_APPLICATIONVERSION "0.01" 29 | #define X_ORGANIZATIONNAME "NTInfo" 30 | #define X_ORGANIZATIONDOMAIN "ntinfo.biz" 31 | #define X_OPTIONSFILE "xneviewer.ini" 32 | #define X_SHORTCUTSFILE "shortcuts.ini" 33 | 34 | #endif // _GLOBAL_H 35 | -------------------------------------------------------------------------------- /gui_source/dialogabout.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2021 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef DIALOGABOUT_H 22 | #define DIALOGABOUT_H 23 | 24 | #include 25 | #include 26 | 27 | namespace Ui { 28 | class DialogAbout; 29 | } 30 | 31 | class DialogAbout : public QDialog { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit DialogAbout(QWidget *parent = nullptr); 36 | ~DialogAbout(); 37 | 38 | private slots: 39 | void on_pushButtonOK_clicked(); 40 | 41 | private: 42 | Ui::DialogAbout *ui; 43 | }; 44 | 45 | #endif // DIALOGABOUT_H 46 | -------------------------------------------------------------------------------- /gui_source/dialogabout.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2021 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "dialogabout.h" 22 | 23 | #include "ui_dialogabout.h" 24 | 25 | DialogAbout::DialogAbout(QWidget *parent) : QDialog(parent), ui(new Ui::DialogAbout) 26 | { 27 | ui->setupUi(this); 28 | 29 | ui->labelLogo->setPixmap(QPixmap(QString::fromUtf8(":/pics/logo.png"))); 30 | 31 | ui->labelVersion->setText(QString("%1 %2").arg(QApplication::applicationName()).arg(QApplication::applicationVersion())); 32 | } 33 | 34 | DialogAbout::~DialogAbout() 35 | { 36 | delete ui; 37 | } 38 | 39 | void DialogAbout::on_pushButtonOK_clicked() 40 | { 41 | this->close(); 42 | } 43 | -------------------------------------------------------------------------------- /gui_source/dialogoptions.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2023 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef DIALOGOPTIONS_H 22 | #define DIALOGOPTIONS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "../global.h" 29 | #include "xoptions.h" 30 | 31 | namespace Ui { 32 | class DialogOptions; 33 | } 34 | 35 | class DialogOptions : public QDialog { 36 | Q_OBJECT 37 | 38 | public: 39 | explicit DialogOptions(QWidget *parent, XOptions *pOptions); 40 | ~DialogOptions(); 41 | 42 | private slots: 43 | void on_pushButtonOK_clicked(); 44 | void on_pushButtonCancel_clicked(); 45 | 46 | private: 47 | Ui::DialogOptions *ui; 48 | XOptions *pOptions; 49 | }; 50 | 51 | #endif // DIALOGOPTIONS_H 52 | -------------------------------------------------------------------------------- /gui_source/dialogoptions.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2023 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "dialogoptions.h" 22 | 23 | #include "ui_dialogoptions.h" 24 | 25 | DialogOptions::DialogOptions(QWidget *parent, XOptions *pOptions) : QDialog(parent), ui(new Ui::DialogOptions) 26 | { 27 | ui->setupUi(this); 28 | 29 | this->pOptions = pOptions; 30 | 31 | pOptions->setCheckBox(ui->checkBoxScanAfterOpen, XOptions::ID_SCANAFTEROPEN); 32 | pOptions->setCheckBox(ui->checkBoxSaveLastDirectory, XOptions::ID_SAVELASTDIRECTORY); 33 | pOptions->setCheckBox(ui->checkBoxStayOnTop, XOptions::ID_STAYONTOP); 34 | pOptions->setCheckBox(ui->checkBoxSaveBackup, XOptions::ID_SAVEBACKUP); 35 | } 36 | 37 | DialogOptions::~DialogOptions() 38 | { 39 | delete ui; 40 | } 41 | 42 | void DialogOptions::on_pushButtonOK_clicked() 43 | { 44 | pOptions->getCheckBox(ui->checkBoxScanAfterOpen, XOptions::ID_SCANAFTEROPEN); 45 | pOptions->getCheckBox(ui->checkBoxSaveLastDirectory, XOptions::ID_SAVELASTDIRECTORY); 46 | pOptions->getCheckBox(ui->checkBoxStayOnTop, XOptions::ID_STAYONTOP); 47 | pOptions->getCheckBox(ui->checkBoxSaveBackup, XOptions::ID_SAVEBACKUP); 48 | 49 | this->close(); 50 | } 51 | 52 | void DialogOptions::on_pushButtonCancel_clicked() 53 | { 54 | this->close(); 55 | } 56 | -------------------------------------------------------------------------------- /gui_source/guimainwindow.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2021 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef GUIMAINWINDOW_H 22 | #define GUIMAINWINDOW_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include "../global.h" 30 | #include "dialogabout.h" 31 | #include "dialogoptions.h" 32 | #include "dialogshortcuts.h" 33 | #include "newidget.h" 34 | 35 | namespace Ui { 36 | class GuiMainWindow; 37 | } 38 | 39 | class GuiMainWindow : public QMainWindow { 40 | Q_OBJECT 41 | 42 | public: 43 | explicit GuiMainWindow(QWidget *pParent = nullptr); 44 | ~GuiMainWindow(); 45 | 46 | private slots: 47 | void on_actionOpen_triggered(); 48 | void on_actionClose_triggered(); 49 | void on_actionExit_triggered(); 50 | void on_actionOptions_triggered(); 51 | void on_actionAbout_triggered(); 52 | void adjust(); 53 | void processFile(QString sFileName); 54 | void closeCurrentFile(); 55 | 56 | protected: 57 | void dragEnterEvent(QDragEnterEvent *event) override; 58 | void dragMoveEvent(QDragMoveEvent *event) override; 59 | void dropEvent(QDropEvent *event) override; 60 | 61 | private: 62 | Ui::GuiMainWindow *ui; 63 | XOptions g_xOptions; 64 | XShortcuts g_xShortcuts; 65 | FW_DEF::OPTIONS g_formatOptions; 66 | 67 | QFile *g_pFile; 68 | }; 69 | 70 | #endif // GUIMAINWINDOW_H 71 | -------------------------------------------------------------------------------- /gui_source/main_gui.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2023 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include 22 | 23 | #include "guimainwindow.h" 24 | #include "xoptions.h" 25 | 26 | int main(int argc, char *argv[]) 27 | { 28 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 29 | #ifdef Q_OS_MAC 30 | #ifndef QT_DEBUG 31 | QCoreApplication::setLibraryPaths(QStringList(QString(argv[0]).remove("MacOS/xneviewer") + "PlugIns")); 32 | #endif 33 | #endif 34 | QCoreApplication::setOrganizationName(X_ORGANIZATIONNAME); 35 | QCoreApplication::setOrganizationDomain(X_ORGANIZATIONDOMAIN); 36 | QCoreApplication::setApplicationName(X_APPLICATIONNAME); 37 | QCoreApplication::setApplicationVersion(X_APPLICATIONVERSION); 38 | 39 | if ((argc == 2) && ((QString(argv[1]) == "--version") || (QString(argv[1]) == "-v"))) { 40 | QString sInfo = QString("%1 v%2").arg(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION); 41 | printf("%s\n", sInfo.toUtf8().data()); 42 | 43 | return 0; 44 | } 45 | 46 | QApplication a(argc, argv); 47 | 48 | XOptions xOptions; 49 | 50 | xOptions.setName(X_OPTIONSFILE); 51 | 52 | xOptions.addID(XOptions::ID_STYLE); 53 | xOptions.addID(XOptions::ID_QSS); 54 | xOptions.addID(XOptions::ID_LANG); 55 | xOptions.load(); 56 | 57 | XOptions::adjustApplicationView(X_APPLICATIONNAME, &xOptions); 58 | 59 | GuiMainWindow w; 60 | w.show(); 61 | 62 | return a.exec(); 63 | } 64 | -------------------------------------------------------------------------------- /gui_source/dialogabout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogAbout 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 326 13 | 403 14 | 15 | 16 | 17 | About 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 308 28 | 235 29 | 30 | 31 | 32 | 33 | 34 | 35 | Qt::AlignCenter 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Qt::AlignCenter 46 | 47 | 48 | 49 | 50 | 51 | 52 | <html><head/><body><p align="center">Bugreports: <a href="mailto:horsicq@gmail.com"><span style=" text-decoration: underline; color:#0000ff;">horsicq@gmail.com</span></a></p><p align="center">Website: <a href="http://ntinfo.biz"><span style=" text-decoration: underline; color:#0000ff;">http://ntinfo.biz</span></a></p><p align="center"><span style=" font-weight:600;">2019-2020(C) hors</span></p></body></html> 53 | 54 | 55 | Qt::AutoText 56 | 57 | 58 | true 59 | 60 | 61 | 62 | 63 | 64 | 65 | Qt::Vertical 66 | 67 | 68 | 69 | 20 70 | 40 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | Qt::Horizontal 81 | 82 | 83 | 84 | 40 85 | 20 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | OK 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /gui_source/dialogoptions.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogOptions 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 284 13 | 172 14 | 15 | 16 | 17 | Options 18 | 19 | 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Scan after open 31 | 32 | 33 | 34 | 35 | 36 | 37 | Save last directory 38 | 39 | 40 | 41 | 42 | 43 | 44 | Stay on top 45 | 46 | 47 | 48 | 49 | 50 | 51 | Save backup 52 | 53 | 54 | 55 | 56 | 57 | 58 | Qt::Vertical 59 | 60 | 61 | 62 | 20 63 | 40 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | Qt::Horizontal 74 | 75 | 76 | 77 | 40 78 | 20 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Qt::Horizontal 91 | 92 | 93 | 94 | 40 95 | 20 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | OK 104 | 105 | 106 | 107 | 108 | 109 | 110 | Cancel 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /gui_source/guimainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GuiMainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 835 10 | 583 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 0 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 0 46 | 47 | 48 | 0 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 0 63 | 0 64 | 835 65 | 21 66 | 67 | 68 | 69 | 70 | File 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Tools 79 | 80 | 81 | 82 | 83 | 84 | Help 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | Open 95 | 96 | 97 | Ctrl+O 98 | 99 | 100 | 101 | 102 | Close 103 | 104 | 105 | Ctrl+W 106 | 107 | 108 | 109 | 110 | Exit 111 | 112 | 113 | Ctrl+Q 114 | 115 | 116 | 117 | 118 | Options 119 | 120 | 121 | 122 | 123 | About 124 | 125 | 126 | 127 | 128 | 129 | NEWidget 130 | QWidget 131 |
newidget.h
132 | 1 133 |
134 |
135 | 136 | 137 |
138 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Formats"] 2 | path = Formats 3 | url = https://github.com/horsicq/Formats.git 4 | [submodule "FormatDialogs"] 5 | path = FormatDialogs 6 | url = https://github.com/horsicq/FormatDialogs.git 7 | [submodule "Controls"] 8 | path = Controls 9 | url = https://github.com/horsicq/Controls.git 10 | [submodule "QHexView"] 11 | path = QHexView 12 | url = https://github.com/horsicq/QHexView.git 13 | [submodule "FormatWidgets"] 14 | path = FormatWidgets 15 | url = https://github.com/horsicq/FormatWidgets.git 16 | [submodule "XMemoryMapWidget"] 17 | path = XMemoryMapWidget 18 | url = https://github.com/horsicq/XMemoryMapWidget.git 19 | [submodule "XEntropyWidget"] 20 | path = XEntropyWidget 21 | url = https://github.com/horsicq/XEntropyWidget.git 22 | [submodule "XQwt"] 23 | path = XQwt 24 | url = https://github.com/horsicq/XQwt.git 25 | [submodule "XOptions"] 26 | path = XOptions 27 | url = https://github.com/horsicq/XOptions.git 28 | [submodule "StaticScan"] 29 | path = StaticScan 30 | url = https://github.com/horsicq/StaticScan.git 31 | [submodule "SpecAbstract"] 32 | path = SpecAbstract 33 | url = https://github.com/horsicq/SpecAbstract.git 34 | [submodule "XArchive"] 35 | path = XArchive 36 | url = https://github.com/horsicq/XArchive.git 37 | [submodule "XTranslation"] 38 | path = XTranslation 39 | url = https://github.com/horsicq/XTranslation.git 40 | [submodule "XStyles"] 41 | path = XStyles 42 | url = https://github.com/horsicq/XStyles.git 43 | [submodule "XDEX"] 44 | path = XDEX 45 | url = https://github.com/horsicq/XDEX.git 46 | [submodule "XHashWidget"] 47 | path = XHashWidget 48 | url = https://github.com/horsicq/XHashWidget.git 49 | [submodule "XCapstone"] 50 | path = XCapstone 51 | url = https://github.com/horsicq/XCapstone.git 52 | [submodule "XHexView"] 53 | path = XHexView 54 | url = https://github.com/horsicq/XHexView.git 55 | [submodule "XDisasmView"] 56 | path = XDisasmView 57 | url = https://github.com/horsicq/XDisasmView.git 58 | [submodule "XShortcuts"] 59 | path = XShortcuts 60 | url = https://github.com/horsicq/XShortcuts.git 61 | [submodule "XHexEdit"] 62 | path = XHexEdit 63 | url = https://github.com/horsicq/XHexEdit.git 64 | [submodule "signatures"] 65 | path = signatures 66 | url = https://github.com/horsicq/signatures.git 67 | [submodule "XDemangle"] 68 | path = XDemangle 69 | url = https://github.com/horsicq/XDemangle.git 70 | [submodule "XDemangleWidget"] 71 | path = XDemangleWidget 72 | url = https://github.com/horsicq/XDemangleWidget.git 73 | [submodule "XLLVMDemangler"] 74 | path = XLLVMDemangler 75 | url = https://github.com/horsicq/XLLVMDemangler.git 76 | [submodule "build_tools"] 77 | path = build_tools 78 | url = https://github.com/horsicq/build_tools 79 | [submodule "XCppfilt"] 80 | path = XCppfilt 81 | url = https://github.com/horsicq/XCppfilt 82 | [submodule "XDynStructs"] 83 | path = XDynStructs 84 | url = https://github.com/horsicq/XDynStructs 85 | [submodule "XDynStructsEngine"] 86 | path = XDynStructsEngine 87 | url = https://github.com/horsicq/XDynStructsEngine 88 | [submodule "XDynStructsWidget"] 89 | path = XDynStructsWidget 90 | url = https://github.com/horsicq/XDynStructsWidget 91 | [submodule "XFileInfo"] 92 | path = XFileInfo 93 | url = https://github.com/horsicq/XFileInfo 94 | [submodule "XPDF"] 95 | path = XPDF 96 | url = https://github.com/horsicq/XPDF 97 | [submodule "archive_widget"] 98 | path = archive_widget 99 | url = https://github.com/horsicq/archive_widget 100 | [submodule "XInfoDB"] 101 | path = XInfoDB 102 | url = https://github.com/horsicq/XInfoDB 103 | [submodule "XSymbolsWidget"] 104 | path = XSymbolsWidget 105 | url = https://github.com/horsicq/XSymbolsWidget 106 | [submodule "XOnlineTools"] 107 | path = XOnlineTools 108 | url = https://github.com/horsicq/XOnlineTools 109 | [submodule "XAboutWidget"] 110 | path = XAboutWidget 111 | url = https://github.com/horsicq/XAboutWidget 112 | [submodule "die_script"] 113 | path = die_script 114 | url = https://github.com/horsicq/die_script 115 | [submodule "hex_templates"] 116 | path = hex_templates 117 | url = https://github.com/horsicq/hex_templates 118 | [submodule "XExtractorWidget"] 119 | path = XExtractorWidget 120 | url = https://github.com/horsicq/XExtractorWidget 121 | [submodule "XExtractor"] 122 | path = XExtractor 123 | url = https://github.com/horsicq/XExtractor 124 | [submodule "XUpdate"] 125 | path = XUpdate 126 | url = https://github.com/horsicq/XUpdate 127 | [submodule "XGithub"] 128 | path = XGithub 129 | url = https://github.com/horsicq/XGithub 130 | [submodule "XVisualizationWidget"] 131 | path = XVisualizationWidget 132 | url = https://github.com/horsicq/XVisualizationWidget 133 | [submodule "XDecompiler"] 134 | path = XDecompiler 135 | url = https://github.com/horsicq/XDecompiler 136 | [submodule "XYara"] 137 | path = XYara 138 | url = https://github.com/horsicq/XYara 139 | [submodule "yara_widget"] 140 | path = yara_widget 141 | url = https://github.com/horsicq/yara_widget 142 | [submodule "nfd_widget"] 143 | path = nfd_widget 144 | url = https://github.com/horsicq/nfd_widget 145 | [submodule "die_widget"] 146 | path = die_widget 147 | url = https://github.com/horsicq/die_widget 148 | [submodule "Detect-It-Easy"] 149 | path = Detect-It-Easy 150 | url = https://github.com/horsicq/Detect-It-Easy 151 | [submodule "XDataConvertorWidget"] 152 | path = XDataConvertorWidget 153 | url = https://github.com/horsicq/XDataConvertorWidget 154 | [submodule "XScanEngine"] 155 | path = XScanEngine 156 | url = https://github.com/horsicq/XScanEngine 157 | [submodule "XDisasmCore"] 158 | path = XDisasmCore 159 | url = https://github.com/horsicq/XDisasmCore.git 160 | [submodule "XRegionsWidget"] 161 | path = XRegionsWidget 162 | url = https://github.com/horsicq/XRegionsWidget.git 163 | [submodule "XStaticUnpacker"] 164 | path = XStaticUnpacker 165 | url = https://github.com/horsicq/XStaticUnpacker 166 | -------------------------------------------------------------------------------- /gui_source/guimainwindow.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2019-2021 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "guimainwindow.h" 22 | 23 | #include "ui_guimainwindow.h" 24 | 25 | GuiMainWindow::GuiMainWindow(QWidget *pParent) : QMainWindow(pParent), ui(new Ui::GuiMainWindow) 26 | { 27 | ui->setupUi(this); 28 | 29 | g_pFile = nullptr; 30 | 31 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION)); 32 | 33 | setAcceptDrops(true); 34 | 35 | g_xOptions.setName(X_OPTIONSFILE); 36 | 37 | // listIDs.append(XOptions::ID_SAVERECENTFILES); 38 | g_xOptions.addID(XOptions::ID_STYLE); 39 | g_xOptions.addID(XOptions::ID_QSS); 40 | g_xOptions.addID(XOptions::ID_LANG); 41 | g_xOptions.addID(XOptions::ID_STAYONTOP); 42 | g_xOptions.addID(XOptions::ID_SAVELASTDIRECTORY); 43 | g_xOptions.addID(XOptions::ID_SAVEBACKUP); 44 | g_xOptions.addID(XOptions::ID_SEARCHSIGNATURESPATH); 45 | g_xOptions.addID(XOptions::ID_SHOWLOGO); 46 | g_xOptions.load(); 47 | 48 | g_xShortcuts.setName(X_SHORTCUTSFILE); 49 | 50 | g_xShortcuts.addGroup(XShortcuts::GROUPID_STRINGS); 51 | g_xShortcuts.addGroup(XShortcuts::GROUPID_SIGNATURES); 52 | g_xShortcuts.addGroup(XShortcuts::GROUPID_HEX); 53 | g_xShortcuts.addGroup(XShortcuts::GROUPID_DISASM); 54 | 55 | g_xShortcuts.load(); 56 | 57 | ui->widgetViewer->setGlobal(&g_xShortcuts, &g_xOptions); 58 | 59 | adjust(); 60 | 61 | if (QCoreApplication::arguments().count() > 1) { 62 | QString sFileName = QCoreApplication::arguments().at(1); 63 | 64 | processFile(sFileName); 65 | } 66 | } 67 | 68 | GuiMainWindow::~GuiMainWindow() 69 | { 70 | closeCurrentFile(); 71 | g_xOptions.save(); 72 | g_xShortcuts.save(); 73 | 74 | delete ui; 75 | } 76 | 77 | void GuiMainWindow::on_actionOpen_triggered() 78 | { 79 | QString sDirectory = g_xOptions.getLastDirectory(); 80 | 81 | QString sFileName = QFileDialog::getOpenFileName(this, tr("Open file..."), sDirectory, tr("All files (*)")); 82 | 83 | if (!sFileName.isEmpty()) { 84 | processFile(sFileName); 85 | } 86 | } 87 | 88 | void GuiMainWindow::on_actionClose_triggered() 89 | { 90 | closeCurrentFile(); 91 | } 92 | 93 | void GuiMainWindow::on_actionExit_triggered() 94 | { 95 | this->close(); 96 | } 97 | 98 | void GuiMainWindow::on_actionOptions_triggered() 99 | { 100 | DialogOptions dialogOptions(this, &g_xOptions); 101 | dialogOptions.exec(); 102 | 103 | adjust(); 104 | } 105 | 106 | void GuiMainWindow::on_actionAbout_triggered() 107 | { 108 | DialogAbout dialogAbout(this); 109 | dialogAbout.exec(); 110 | } 111 | 112 | void GuiMainWindow::adjust() 113 | { 114 | g_xOptions.adjustStayOnTop(this); 115 | } 116 | 117 | void GuiMainWindow::processFile(QString sFileName) 118 | { 119 | if ((sFileName != "") && (QFileInfo(sFileName).isFile())) { 120 | g_xOptions.setLastFileName(sFileName); 121 | 122 | closeCurrentFile(); 123 | 124 | g_pFile = new QFile; 125 | 126 | g_pFile->setFileName(sFileName); 127 | 128 | if (!g_pFile->open(QIODevice::ReadWrite)) { 129 | if (!g_pFile->open(QIODevice::ReadOnly)) { 130 | closeCurrentFile(); 131 | } 132 | } 133 | 134 | if (g_pFile) { 135 | XNE ne(g_pFile); 136 | if (ne.isValid()) { 137 | ui->stackedWidgetMain->setCurrentIndex(1); 138 | g_formatOptions.bIsImage = false; 139 | g_formatOptions.nImageBase = -1; 140 | g_formatOptions.nStartType = SNE::TYPE_HEURISTICSCAN; 141 | ui->widgetViewer->setData(g_pFile, g_formatOptions, 0, 0, 0); 142 | 143 | ui->widgetViewer->reload(); 144 | 145 | adjust(); 146 | 147 | setWindowTitle(sFileName); 148 | } else { 149 | QMessageBox::critical(this, tr("Error"), tr("It is not a valid file")); 150 | } 151 | } else { 152 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file")); 153 | } 154 | } 155 | } 156 | 157 | void GuiMainWindow::closeCurrentFile() 158 | { 159 | ui->stackedWidgetMain->setCurrentIndex(0); 160 | 161 | if (g_pFile) { 162 | g_pFile->close(); 163 | delete g_pFile; 164 | g_pFile = nullptr; 165 | } 166 | 167 | setWindowTitle(QString("%1 v%2").arg(X_APPLICATIONNAME).arg(X_APPLICATIONVERSION)); 168 | } 169 | 170 | void GuiMainWindow::dragEnterEvent(QDragEnterEvent *event) 171 | { 172 | event->acceptProposedAction(); 173 | } 174 | 175 | void GuiMainWindow::dragMoveEvent(QDragMoveEvent *event) 176 | { 177 | event->acceptProposedAction(); 178 | } 179 | 180 | void GuiMainWindow::dropEvent(QDropEvent *event) 181 | { 182 | const QMimeData *mimeData = event->mimeData(); 183 | 184 | if (mimeData->hasUrls()) { 185 | QList urlList = mimeData->urls(); 186 | 187 | if (urlList.count()) { 188 | QString sFileName = urlList.at(0).toLocalFile(); 189 | 190 | sFileName = XBinary::convertFileName(sFileName); 191 | 192 | processFile(sFileName); 193 | } 194 | } 195 | } 196 | --------------------------------------------------------------------------------