mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:38:16 +00:00
Add FortFirewallDriverPayload.pro
This commit is contained in:
parent
72e6e12adb
commit
935e466850
@ -16,3 +16,10 @@ ui_bin.file = ui_bin/FortFirewallUIBin.pro
|
||||
|
||||
tests.depends = ui
|
||||
tests.file = tests/FortFirewallTests.pro
|
||||
|
||||
# Driver Payload
|
||||
driver_payload {
|
||||
SUBDIRS += driver_payload
|
||||
|
||||
driver_payload.file = driver_payload/FortFirewallDriverPayload.pro
|
||||
}
|
||||
|
14
src/driver_payload/FortFirewallDriverPayload.pro
Normal file
14
src/driver_payload/FortFirewallDriverPayload.pro
Normal file
@ -0,0 +1,14 @@
|
||||
include(../global.pri)
|
||||
|
||||
CONFIG += console
|
||||
CONFIG -= debug_and_release
|
||||
|
||||
TARGET = DriverPayload
|
||||
TEMPLATE = app
|
||||
|
||||
SOURCES += \
|
||||
driverpayload.cpp \
|
||||
main.cpp
|
||||
|
||||
HEADERS += \
|
||||
driverpayload.h
|
36
src/driver_payload/driverpayload.cpp
Normal file
36
src/driver_payload/driverpayload.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
#include "driverpayload.h"
|
||||
|
||||
#include <QCommandLineParser>
|
||||
|
||||
void DriverPayload::processArguments(const QStringList &args)
|
||||
{
|
||||
QCommandLineParser parser;
|
||||
|
||||
const QCommandLineOption inputOption(QStringList() << "i"
|
||||
<< "input",
|
||||
"Input file.", "input");
|
||||
parser.addOption(inputOption);
|
||||
|
||||
const QCommandLineOption outputOption(QStringList() << "o"
|
||||
<< "output",
|
||||
"Output file.", "output");
|
||||
parser.addOption(outputOption);
|
||||
|
||||
const QCommandLineOption payloadOption(QStringList() << "p"
|
||||
<< "payload",
|
||||
"Payload file.", "payload");
|
||||
parser.addOption(payloadOption);
|
||||
|
||||
parser.addHelpOption();
|
||||
|
||||
parser.process(args);
|
||||
|
||||
if (!parser.isSet(inputOption) || !parser.isSet(outputOption) || !parser.isSet(payloadOption)) {
|
||||
parser.showHelp(1);
|
||||
return;
|
||||
}
|
||||
|
||||
m_inputFilePath = parser.value(inputOption);
|
||||
m_outputFilePath = parser.value(outputOption);
|
||||
m_payloadFilePath = parser.value(payloadOption);
|
||||
}
|
19
src/driver_payload/driverpayload.h
Normal file
19
src/driver_payload/driverpayload.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef DRIVERPAYLOAD_H
|
||||
#define DRIVERPAYLOAD_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class DriverPayload
|
||||
{
|
||||
public:
|
||||
explicit DriverPayload() = default;
|
||||
|
||||
void processArguments(const QStringList &args);
|
||||
|
||||
private:
|
||||
QString m_inputFilePath;
|
||||
QString m_outputFilePath;
|
||||
QString m_payloadFilePath;
|
||||
};
|
||||
|
||||
#endif // DRIVERPAYLOAD_H
|
13
src/driver_payload/main.cpp
Normal file
13
src/driver_payload/main.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "driverpayload.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
DriverPayload payload;
|
||||
payload.processArguments(QCoreApplication::arguments());
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user