This commit is contained in:
寂静的羽夏 2022-08-23 16:23:10 +08:00
parent 51c3eb744a
commit c9fff656f8
10 changed files with 28 additions and 209 deletions

View File

@ -24,9 +24,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
winghexdisasm.cpp \
authordialog.cpp \
sponsordialog.cpp
winghexdisasm.cpp
HEADERS += \
capstone/arm.h \
@ -48,9 +46,8 @@ HEADERS += \
capstone/x86.h \
capstone/xcore.h \
winghexdisasm.h \
../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h \
authordialog.h \
sponsordialog.h
../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h
DISTFILES += WingHexDisasm.json
LIBS += $$PWD/capstone/libcapstone.a
@ -58,10 +55,5 @@ LIBS += $$PWD/capstone/libcapstone.a
RESOURCES += \
resource.qrc
TRANSLATIONS += \
$$PWD/WingHexDisasm.ts
FORMS += \
authordialog.ui \
sponsordialog.ui

Binary file not shown.

View File

@ -4,61 +4,58 @@
<context>
<name>AuthorDialog</name>
<message>
<location filename="authordialog.ui" line="14"/>
<source>Dialog</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>SponsorDialog</name>
<message>
<location filename="sponsordialog.ui" line="14"/>
<source>Dialog</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="sponsordialog.ui" line="26"/>
<source>Thanks for sponsor!</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>WingHexDisasm</name>
<message>
<location filename="winghexdisasm.cpp" line="43"/>
<location filename="winghexdisasm.cpp" line="41"/>
<source>Arch :</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="111"/>
<location filename="winghexdisasm.cpp" line="109"/>
<source>Mode :</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="159"/>
<location filename="winghexdisasm.cpp" line="157"/>
<source>DisasmWindow</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="161"/>
<location filename="winghexdisasm.cpp" line="208"/>
<location filename="winghexdisasm.cpp" line="159"/>
<location filename="winghexdisasm.cpp" line="209"/>
<source>WingHexDisasm</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="165"/>
<location filename="winghexdisasm.cpp" line="184"/>
<location filename="winghexdisasm.cpp" line="163"/>
<location filename="winghexdisasm.cpp" line="185"/>
<source>Clear</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="163"/>
<location filename="winghexdisasm.cpp" line="182"/>
<location filename="winghexdisasm.cpp" line="161"/>
<location filename="winghexdisasm.cpp" line="183"/>
<source>Disasm</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="168"/>
<location filename="winghexdisasm.cpp" line="166"/>
<source>Author</source>
<translation></translation>
</message>
@ -68,28 +65,28 @@
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="217"/>
<location filename="winghexdisasm.cpp" line="218"/>
<source>A small disassembly plugin for WingHexExplorer.</source>
<oldsource>A small disasmbly plugin for WingHexExplorer.</oldsource>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="231"/>
<location filename="winghexdisasm.cpp" line="232"/>
<source>Error: Failed capstone initialization</source>
<translation> capstone </translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="257"/>
<location filename="winghexdisasm.cpp" line="258"/>
<source>Error: Failed to disassemble given op codes</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="266"/>
<location filename="winghexdisasm.cpp" line="267"/>
<source>No Document Opened</source>
<translation></translation>
</message>
<message>
<location filename="winghexdisasm.cpp" line="272"/>
<location filename="winghexdisasm.cpp" line="273"/>
<source>No Selection Bytes</source>
<translation></translation>
</message>

View File

@ -1,15 +0,0 @@
#include "authordialog.h"
#include "../../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
#include "ui_authordialog.h"
AuthorDialog::AuthorDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::AuthorDialog) {
ui->setupUi(this);
ui->retranslateUi(this);
ui->label->setPixmap(QPixmap(HOSTAUTHORPIMG));
auto txtb = ui->txtb;
txtb->setSearchPaths(QStringList({":/WingHexDisasm", ":/WingHexDisasm/img"}));
txtb->setSource(QUrl("README.md"), QTextDocument::MarkdownResource);
}
AuthorDialog::~AuthorDialog() { delete ui; }

View File

@ -1,21 +0,0 @@
#ifndef AUTHORDIALOG_H
#define AUTHORDIALOG_H
#include <QDialog>
namespace Ui {
class AuthorDialog;
}
class AuthorDialog : public QDialog {
Q_OBJECT
public:
explicit AuthorDialog(QWidget *parent = nullptr);
~AuthorDialog();
private:
Ui::AuthorDialog *ui;
};
#endif // AUTHORDIALOG_H

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AuthorDialog</class>
<widget class="QDialog" name="AuthorDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>550</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>200</x>
<y>20</y>
<width>150</width>
<height>150</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QTextBrowser" name="txtb">
<property name="geometry">
<rect>
<x>20</x>
<y>190</y>
<width>511</width>
<height>381</height>
</rect>
</property>
<property name="markdown">
<string/>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,12 +0,0 @@
#include "sponsordialog.h"
#include "../../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
#include "ui_sponsordialog.h"
SponsorDialog::SponsorDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::SponsorDialog) {
ui->setupUi(this);
ui->retranslateUi(this);
ui->label_2->setPixmap(QPixmap(SPONSORQRCODE));
}
SponsorDialog::~SponsorDialog() { delete ui; }

View File

@ -1,21 +0,0 @@
#ifndef SPONSORDIALOG_H
#define SPONSORDIALOG_H
#include <QDialog>
namespace Ui {
class SponsorDialog;
}
class SponsorDialog : public QDialog {
Q_OBJECT
public:
explicit SponsorDialog(QWidget *parent = nullptr);
~SponsorDialog();
private:
Ui::SponsorDialog *ui;
};
#endif // SPONSORDIALOG_H

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SponsorDialog</class>
<widget class="QDialog" name="SponsorDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>481</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Thanks for sponsor!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>481</width>
<height>351</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,6 +1,4 @@
#include "winghexdisasm.h"
#include "authordialog.h"
#include "sponsordialog.h"
#include <QApplication>
#include <QHBoxLayout>
#include <QLabel>
@ -166,13 +164,16 @@ bool WingHexDisasm::init(QList<WingPluginInfo> loadedplugin) {
WingHexDisasm::on_clear);
menu->addSeparator();
PluginMenuAddItemIconLamba(menu, tr("Author"), HOSTICONRES("author"), [=] {
AuthorDialog d;
d.exec();
auto authord =
newAboutDialog(QPixmap(), {":/WingHexDisasm", ":/WingHexDisasm/img"});
authord->exec();
delete authord;
});
PluginMenuAddItemIconLamba(menu, tr("Sponsor"), HOSTICONRES("sponsor"),
[=] {
SponsorDialog d;
d.exec();
auto sponsor = newSponsorDialog();
sponsor->exec();
delete sponsor;
});
}
PluginMenuInitEnd();