├── README.md
├── icons
├── main.ico
└── main.icns
├── xleviewer_source.pro
├── gui_source
├── pics
│ └── logo.png
├── rsrc.qrc
├── gui_source.pro
├── dialogabout.h
├── dialogabout.cpp
├── dialogoptions.h
├── guimainwindow.h
├── main_gui.cpp
├── dialogabout.ui
├── guimainwindow.ui
├── dialogoptions.cpp
├── guimainwindow.cpp
└── dialogoptions.ui
├── LICENSE
├── global.h
└── .gitmodules
/README.md:
--------------------------------------------------------------------------------
1 | XLEViewer
--------------------------------------------------------------------------------
/icons/main.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/horsicq/XLEViewer/master/icons/main.ico
--------------------------------------------------------------------------------
/icons/main.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/horsicq/XLEViewer/master/icons/main.icns
--------------------------------------------------------------------------------
/xleviewer_source.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 |
3 | SUBDIRS += gui_source
4 |
--------------------------------------------------------------------------------
/gui_source/pics/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/horsicq/XLEViewer/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 = xleviewer
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, lewidget) {
27 | XCONFIG += lewidget
28 | include(../FormatWidgets/LE/lewidget.pri)
29 | }
30 |
31 | win32 {
32 | RC_ICONS = ../icons/main.ico
33 | }
34 | macx {
35 | ICON = ../icons/main.icns
36 | }
37 |
38 | RESOURCES += \
39 | rsrc.qrc
40 |
--------------------------------------------------------------------------------
/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-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 _GLOBAL_H
22 | #define _GLOBAL_H
23 |
24 | #include
25 |
26 | #define X_APPLICATIONDISPLAYNAME "XLEViewer"
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-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 DIALOGABOUT_H
22 | #define DIALOGABOUT_H
23 |
24 | #include
25 | #include
26 |
27 | #include "../global.h"
28 | #include "xoptions.h"
29 |
30 | namespace Ui {
31 | class DialogAbout;
32 | }
33 |
34 | class DialogAbout : public QDialog {
35 | Q_OBJECT
36 |
37 | public:
38 | explicit DialogAbout(QWidget *pParent = nullptr);
39 | ~DialogAbout();
40 |
41 | private slots:
42 | void on_pushButtonOK_clicked();
43 |
44 | private:
45 | Ui::DialogAbout *ui;
46 | };
47 |
48 | #endif // DIALOGABOUT_H
49 |
--------------------------------------------------------------------------------
/gui_source/dialogabout.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 "dialogabout.h"
22 |
23 | #include "ui_dialogabout.h"
24 |
25 | DialogAbout::DialogAbout(QWidget *pParent) : QDialog(pParent), ui(new Ui::DialogAbout)
26 | {
27 | ui->setupUi(this);
28 |
29 | ui->labelLogo->setPixmap(QPixmap(QString::fromUtf8(":/pics/logo.png")));
30 |
31 | // TODO
32 | ui->labelVersion->setText(QString("%1 %2").arg(QApplication::applicationName()).arg(QApplication::applicationVersion()));
33 | }
34 |
35 | DialogAbout::~DialogAbout()
36 | {
37 | delete ui;
38 | }
39 |
40 | void DialogAbout::on_pushButtonOK_clicked()
41 | {
42 | this->close();
43 | }
44 |
--------------------------------------------------------------------------------
/gui_source/dialogoptions.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 DIALOGOPTIONS_H
22 | #define DIALOGOPTIONS_H
23 |
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #include "../global.h"
31 | #include "xbinary.h"
32 | #include "xoptions.h"
33 |
34 | namespace Ui {
35 | class DialogOptions;
36 | }
37 |
38 | class DialogOptions : public QDialog {
39 | Q_OBJECT
40 |
41 | public:
42 | explicit DialogOptions(QWidget *parent, XOptions *pOptions);
43 | ~DialogOptions();
44 |
45 | private slots:
46 | void on_pushButtonOK_clicked();
47 | void on_pushButtonCancel_clicked();
48 | void on_toolButtonSearchSignatures_clicked();
49 |
50 | private:
51 | Ui::DialogOptions *ui;
52 | XOptions *g_pOptions;
53 | };
54 |
55 | #endif // DIALOGOPTIONS_H
56 |
--------------------------------------------------------------------------------
/gui_source/guimainwindow.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 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 "lewidget.h"
33 |
34 | namespace Ui {
35 | class GuiMainWindow;
36 | }
37 |
38 | class GuiMainWindow : public QMainWindow {
39 | Q_OBJECT
40 |
41 | public:
42 | explicit GuiMainWindow(QWidget *pParent = nullptr);
43 | ~GuiMainWindow();
44 |
45 | private slots:
46 | void on_actionOpen_triggered();
47 | void on_actionClose_triggered();
48 | void on_actionExit_triggered();
49 | void on_actionOptions_triggered();
50 | void on_actionAbout_triggered();
51 | void adjust();
52 | void processFile(QString sFileName);
53 | void closeCurrentFile();
54 |
55 | protected:
56 | void dragEnterEvent(QDragEnterEvent *event) override;
57 | void dragMoveEvent(QDragMoveEvent *event) override;
58 | void dropEvent(QDropEvent *event) override;
59 |
60 | private:
61 | Ui::GuiMainWindow *ui;
62 | XOptions g_xOptions;
63 | XShortcuts g_xShortcuts;
64 | FW_DEF::OPTIONS g_formatOptions;
65 | QFile *g_pFile;
66 | };
67 |
68 | #endif // GUIMAINWINDOW_H
69 |
--------------------------------------------------------------------------------
/gui_source/main_gui.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
22 | #include
23 |
24 | #include "guimainwindow.h"
25 |
26 | int main(int argc, char *argv[])
27 | {
28 | #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
29 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
30 | #endif
31 | #ifdef Q_OS_MAC
32 | #ifndef QT_DEBUG
33 | QCoreApplication::setLibraryPaths(QStringList(QString(argv[0]).remove("MacOS/XLEViewer") + "PlugIns"));
34 | #endif
35 | #endif
36 | QCoreApplication::setOrganizationName(X_ORGANIZATIONNAME);
37 | QCoreApplication::setOrganizationDomain(X_ORGANIZATIONDOMAIN);
38 | QCoreApplication::setApplicationName(X_APPLICATIONNAME);
39 | QCoreApplication::setApplicationVersion(X_APPLICATIONVERSION);
40 |
41 | if ((argc == 2) && ((QString(argv[1]) == "--version") || (QString(argv[1]) == "-v"))) {
42 | QString sInfo = QString("%1 v%2").arg(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION);
43 | printf("%s\n", sInfo.toUtf8().data());
44 |
45 | return 0;
46 | }
47 |
48 | QApplication a(argc, argv);
49 |
50 | XOptions xOptions;
51 |
52 | xOptions.setName(X_OPTIONSFILE);
53 |
54 | xOptions.addID(XOptions::ID_VIEW_STYLE);
55 | xOptions.addID(XOptions::ID_VIEW_QSS);
56 | xOptions.addID(XOptions::ID_VIEW_LANG);
57 | xOptions.load();
58 |
59 | XOptions::adjustApplicationView(X_APPLICATIONNAME, &xOptions);
60 |
61 | GuiMainWindow w;
62 | w.show();
63 |
64 | return a.exec();
65 | }
66 |
--------------------------------------------------------------------------------
/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/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 |
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 | LEWidget
130 | QWidget
131 |
132 | 1
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/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 *pParent, XOptions *pOptions) : QDialog(pParent), ui(new Ui::DialogOptions)
26 | {
27 | ui->setupUi(this);
28 |
29 | this->g_pOptions = pOptions;
30 |
31 | pOptions->setCheckBox(ui->checkBoxSaveLastDirectory, XOptions::ID_FILE_SAVELASTDIRECTORY);
32 | pOptions->setCheckBox(ui->checkBoxStayOnTop, XOptions::ID_VIEW_STAYONTOP);
33 | pOptions->setCheckBox(ui->checkBoxSaveBackup, XOptions::ID_FILE_SAVEBACKUP);
34 | pOptions->setCheckBox(ui->checkBoxShowLogo, XOptions::ID_VIEW_SHOWLOGO);
35 | pOptions->setComboBox(ui->comboBoxStyle, XOptions::ID_VIEW_STYLE);
36 | pOptions->setComboBox(ui->comboBoxQss, XOptions::ID_VIEW_QSS);
37 | pOptions->setComboBox(ui->comboBoxLanguage, XOptions::ID_VIEW_LANG);
38 | pOptions->setLineEdit(ui->lineEditSearchSignatures, XOptions::ID_SIGNATURES_PATH);
39 |
40 | #ifdef WIN32
41 | ui->checkBoxContext->setChecked(pOptions->checkContext(X_APPLICATIONDISPLAYNAME, "*"));
42 | #else
43 | ui->checkBoxContext->hide();
44 | #endif
45 | }
46 |
47 | DialogOptions::~DialogOptions()
48 | {
49 | delete ui;
50 | }
51 |
52 | void DialogOptions::on_pushButtonOK_clicked()
53 | {
54 | g_pOptions->getCheckBox(ui->checkBoxSaveLastDirectory, XOptions::ID_FILE_SAVELASTDIRECTORY);
55 | g_pOptions->getCheckBox(ui->checkBoxStayOnTop, XOptions::ID_VIEW_STAYONTOP);
56 | g_pOptions->getCheckBox(ui->checkBoxSaveBackup, XOptions::ID_FILE_SAVEBACKUP);
57 | g_pOptions->getCheckBox(ui->checkBoxShowLogo, XOptions::ID_VIEW_SHOWLOGO);
58 | g_pOptions->getComboBox(ui->comboBoxStyle, XOptions::ID_VIEW_STYLE);
59 | g_pOptions->getComboBox(ui->comboBoxQss, XOptions::ID_VIEW_QSS);
60 | g_pOptions->getComboBox(ui->comboBoxLanguage, XOptions::ID_VIEW_LANG);
61 | g_pOptions->getLineEdit(ui->lineEditSearchSignatures, XOptions::ID_SIGNATURES_PATH);
62 |
63 | #ifdef WIN32
64 | if (g_pOptions->checkContext(X_APPLICATIONDISPLAYNAME, "*") != ui->checkBoxContext->isChecked()) {
65 | if (ui->checkBoxContext->isChecked()) {
66 | g_pOptions->registerContext(X_APPLICATIONDISPLAYNAME, "*", qApp->applicationFilePath());
67 | } else {
68 | g_pOptions->clearContext(X_APPLICATIONDISPLAYNAME, "*");
69 | }
70 | }
71 | #endif
72 |
73 | if (g_pOptions->isRestartNeeded()) {
74 | QMessageBox::information(this, tr("Information"), tr("Please restart the application"));
75 | }
76 |
77 | this->close();
78 | }
79 |
80 | void DialogOptions::on_pushButtonCancel_clicked()
81 | {
82 | this->close();
83 | }
84 |
85 | void DialogOptions::on_toolButtonSearchSignatures_clicked()
86 | {
87 | QString sText = ui->lineEditSearchSignatures->text();
88 | QString sInitDirectory = XBinary::convertPathName(sText);
89 |
90 | QString sDirectoryName = QFileDialog::getExistingDirectory(this, tr("Open directory") + QString("..."), sInitDirectory, QFileDialog::ShowDirsOnly);
91 |
92 | if (!sDirectoryName.isEmpty()) {
93 | ui->lineEditSearchSignatures->setText(sDirectoryName);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "FormatWidgets"]
2 | path = FormatWidgets
3 | url = https://github.com/horsicq/FormatWidgets.git
4 | [submodule "QHexView"]
5 | path = QHexView
6 | url = https://github.com/horsicq/QHexView.git
7 | [submodule "Controls"]
8 | path = Controls
9 | url = https://github.com/horsicq/Controls.git
10 | [submodule "FormatDialogs"]
11 | path = FormatDialogs
12 | url = https://github.com/horsicq/FormatDialogs.git
13 | [submodule "Formats"]
14 | path = Formats
15 | url = https://github.com/horsicq/Formats.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_VIEW_STYLE);
39 | g_xOptions.addID(XOptions::ID_VIEW_QSS);
40 | g_xOptions.addID(XOptions::ID_VIEW_LANG);
41 | g_xOptions.addID(XOptions::ID_VIEW_STAYONTOP);
42 | g_xOptions.addID(XOptions::ID_FILE_SAVELASTDIRECTORY);
43 | g_xOptions.addID(XOptions::ID_FILE_SAVEBACKUP);
44 | g_xOptions.addID(XOptions::ID_SIGNATURES_PATH);
45 | g_xOptions.addID(XOptions::ID_VIEW_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") + QString("..."), sDirectory, tr("All files") + QString(" (*)"));
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 | ui->widgetViewer->setOptions(g_formatOptions);
117 | }
118 |
119 | void GuiMainWindow::processFile(QString sFileName)
120 | {
121 | if ((sFileName != "") && (QFileInfo(sFileName).isFile())) {
122 | g_xOptions.setLastFileName(sFileName);
123 |
124 | closeCurrentFile();
125 |
126 | g_pFile = new QFile;
127 |
128 | g_pFile->setFileName(sFileName);
129 |
130 | if (!g_pFile->open(QIODevice::ReadWrite)) {
131 | if (!g_pFile->open(QIODevice::ReadOnly)) {
132 | closeCurrentFile();
133 | }
134 | }
135 |
136 | if (g_pFile) {
137 | XLE le(g_pFile);
138 | if (le.isValid()) {
139 | ui->stackedWidgetMain->setCurrentIndex(1);
140 | g_formatOptions.bIsImage = false;
141 | g_formatOptions.nImageBase = -1;
142 | g_formatOptions.nStartType = SLE::TYPE_INFO;
143 | ui->widgetViewer->setData(g_pFile, g_formatOptions, 0, 0, 0);
144 |
145 | ui->widgetViewer->reload();
146 |
147 | adjust();
148 |
149 | setWindowTitle(sFileName);
150 | } else {
151 | QMessageBox::critical(this, tr("Error"), tr("It is not a valid file"));
152 | }
153 | } else {
154 | QMessageBox::critical(this, tr("Error"), tr("Cannot open file"));
155 | }
156 | }
157 | }
158 |
159 | void GuiMainWindow::closeCurrentFile()
160 | {
161 | ui->stackedWidgetMain->setCurrentIndex(0);
162 |
163 | if (g_pFile) {
164 | g_pFile->close();
165 | delete g_pFile;
166 | g_pFile = nullptr;
167 | }
168 |
169 | setWindowTitle(XOptions::getTitle(X_APPLICATIONDISPLAYNAME, X_APPLICATIONVERSION));
170 | }
171 |
172 | void GuiMainWindow::dragEnterEvent(QDragEnterEvent *event)
173 | {
174 | event->acceptProposedAction();
175 | }
176 |
177 | void GuiMainWindow::dragMoveEvent(QDragMoveEvent *event)
178 | {
179 | event->acceptProposedAction();
180 | }
181 |
182 | void GuiMainWindow::dropEvent(QDropEvent *event)
183 | {
184 | const QMimeData *mimeData = event->mimeData();
185 |
186 | if (mimeData->hasUrls()) {
187 | QList urlList = mimeData->urls();
188 |
189 | if (urlList.count()) {
190 | QString sFileName = urlList.at(0).toLocalFile();
191 |
192 | sFileName = XBinary::convertFileName(sFileName);
193 |
194 | processFile(sFileName);
195 | }
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/gui_source/dialogoptions.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | DialogOptions
4 |
5 |
6 | Qt::ApplicationModal
7 |
8 |
9 |
10 | 0
11 | 0
12 | 382
13 | 241
14 |
15 |
16 |
17 | Options
18 |
19 |
20 | true
21 |
22 |
23 | -
24 |
25 |
-
26 |
27 |
-
28 |
29 |
30 | Save last directory
31 |
32 |
33 |
34 | -
35 |
36 |
37 | Stay on top
38 |
39 |
40 |
41 | -
42 |
43 |
44 | Save backup
45 |
46 |
47 |
48 | -
49 |
50 |
51 | Show logo
52 |
53 |
54 |
55 | -
56 |
57 |
58 | Context
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 |
81 |
82 | Style
83 |
84 |
85 |
86 | 0
87 |
88 |
89 | 0
90 |
91 |
92 | 0
93 |
94 |
95 | 0
96 |
97 |
-
98 |
99 |
100 |
101 |
102 |
103 | -
104 |
105 |
106 | Qss
107 |
108 |
109 |
110 | 0
111 |
112 |
113 | 0
114 |
115 |
116 | 0
117 |
118 |
119 | 0
120 |
121 |
-
122 |
123 |
124 |
125 |
126 |
127 | -
128 |
129 |
130 | Language
131 |
132 |
133 |
134 | 0
135 |
136 |
137 | 0
138 |
139 |
140 | 0
141 |
142 |
143 | 0
144 |
145 |
-
146 |
147 |
148 |
149 |
150 |
151 | -
152 |
153 |
154 | Qt::Vertical
155 |
156 |
157 |
158 | 20
159 | 40
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 | -
169 |
170 |
171 | Search signatures
172 |
173 |
174 |
175 | 0
176 |
177 |
178 | 0
179 |
180 |
181 | 0
182 |
183 |
184 | 0
185 |
186 |
-
187 |
188 |
189 | -
190 |
191 |
192 | ...
193 |
194 |
195 |
196 |
197 |
198 |
199 | -
200 |
201 |
-
202 |
203 |
204 | Qt::Horizontal
205 |
206 |
207 |
208 | 40
209 | 20
210 |
211 |
212 |
213 |
214 | -
215 |
216 |
217 | OK
218 |
219 |
220 |
221 | -
222 |
223 |
224 | Cancel
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
--------------------------------------------------------------------------------