-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
5,028 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,239 @@ | ||
// Copyright (c) 2012-2018 hors<[email protected]> | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
|
||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
#ifndef _OPTIONS_H | ||
#define _OPTIONS_H | ||
|
||
#include <QString> | ||
#include <QList> | ||
#include <QMutex> | ||
#ifdef USE_NFD | ||
#include "staticscan.h" | ||
#include "staticscanitemmodel.h" | ||
#endif | ||
|
||
#define __DIE "Detect It Easy" | ||
#define __VERSION "2.00" | ||
#define __BUILDDATE __DATE__ | ||
#define __UPDATEFILE "http://ntinfo.biz/files/die_version" | ||
#define __HOMEPAGE "http://ntinfo.biz/index.php/detect-it-easy" | ||
#define __TOOLTIPRELAY 1000 | ||
|
||
#define DIE_SHOWERRORS 0x00000001 | ||
#define DIE_SHOWOPTIONS 0x00000002 | ||
#define DIE_SHOWVERSION 0x00000004 | ||
#define DIE_SHOWENTROPY 0x00000008 | ||
#define DIE_SINGLELINEOUTPUT 0x00000010 | ||
#define DIE_SHOWFILEFORMATONCE 0x00000020 | ||
|
||
struct __SIGNATURE | ||
{ | ||
QString sName; | ||
QString sText; | ||
}; | ||
|
||
enum SCAN_METHODS | ||
{ | ||
SM_DIE=0, | ||
#ifdef USE_NFD | ||
SM_NFD, | ||
#endif | ||
#ifdef USE_YARA | ||
SM_YARA, | ||
#endif | ||
#ifdef USE_PEID | ||
SM_PEID | ||
#endif | ||
}; | ||
|
||
struct __DIE_RESULT | ||
{ | ||
QString sSignature; | ||
QString sFileType; | ||
QString sType; | ||
QString sName; | ||
}; | ||
|
||
struct __DIE_OPTIONS | ||
{ | ||
int nDialogOpen; | ||
bool bStayOnTop; | ||
bool bScanAfterOpen; | ||
bool bSaveLastDirectory; | ||
bool bShowTooltips; | ||
bool bScanShowVersionDIE; | ||
bool bScanShowOptionsDIE; | ||
#ifdef USE_NFD | ||
bool bScanDeepScanNFD; | ||
bool bScanScanOverlayNFD; | ||
#endif | ||
bool bShowErrors; | ||
bool bShowScanTime; | ||
bool bScanSubfolders; | ||
bool bResizeableMainWindow; | ||
bool bShowEntropy; | ||
bool bSingleLineOutput; | ||
bool bShowFileFormatOnce; | ||
bool bFullScan; | ||
bool bSectionsEntropyAfterOpen; | ||
bool bSingleApplication; | ||
double fThreshold; | ||
unsigned int nEntropyGraph; | ||
QString sLastDirectory; | ||
QString sPluginName; | ||
QList<__SIGNATURE> listPEScripts; | ||
QList<__SIGNATURE> listBinaryScripts; | ||
QList<__SIGNATURE> listTextScripts; | ||
QList<__SIGNATURE> listELFScripts; | ||
QList<__SIGNATURE> listMSDOSScripts; | ||
QList<__SIGNATURE> listMACHScripts; | ||
QString sStyle; | ||
QString sStyleSheet; | ||
bool bEnableLanguage; | ||
QString sLanguage; | ||
bool bEnableFont; | ||
QString sFont; | ||
QString sFontHEX; | ||
unsigned int nAddressWidth; | ||
QString sEndianness; | ||
bool bEnablePlugins; | ||
QString sCodec; | ||
// int nNumberOfResults; | ||
QString sDataBasePath; | ||
QString sEditorPath; | ||
QString sHelpPath; | ||
QString sInfoPath; | ||
QString sPluginsPath; | ||
QString sQSSPath; | ||
QString sLangsPath; | ||
QString sScriptsPath; | ||
QString sSearchPath; | ||
SCAN_METHODS sm; | ||
QMutex *pMutexResult; | ||
QList<__DIE_RESULT> die_listResult; | ||
#ifdef USE_NFD | ||
QList<SpecAbstract::SCAN_STRUCT> nfd_listResult; | ||
#endif | ||
}; | ||
|
||
#define __StayOnTop "General/StayOnTop" | ||
#define __SingleApplication "General/SingleApplication" | ||
#define __ScanAfterOpen "Scan/ScanAfterOpen" | ||
#define __ScanShowVersionDIE "Scan/ShowVersionDIE" | ||
#define __ScanShowOptionsDIE "Scan/ShowOptionsDIE" | ||
#ifdef USE_NFD | ||
#define __ScanDeepScanNFD "Scan/ScanDeepNFD" | ||
#define __ScanScanOverlayNFD "Scan/ScanOverlayNFD" | ||
#endif | ||
#define __ScanMethod "Scan/Method" | ||
#define __ShowErrors "Scan/ShowErrors" | ||
#define __ShowScanTime "Scan/ShowScanTime" | ||
#define __SectionsEntropyAfterOpen "Entropy/SectionsEntropyAfterOpen" | ||
#define __EntropyGraph "Entropy/EntropyGraph" | ||
#define __Threshold "Entropy/Threshold" | ||
#define __ShowTooltips "General/ShowTooltips" | ||
#define __SaveLastDirectory "General/SaveLastDirectory" | ||
#define __ResizeableMainWindow "Appearance/ResizeableMainWindow" | ||
#define __SaveLastDirectory "General/SaveLastDirectory" | ||
#define __LastDirectory "General/LastDirectory" | ||
#define __Style "Appearance/Style" | ||
#define __StyleSheet "Appearance/StyleSheet" | ||
#define __Codec "Appearance/Codec" | ||
#define __EnableFont "Appearance/FontEnable" | ||
#define __Font "Appearance/Font" | ||
#define __EnableLanguage "Appearance/EnableLanguage" | ||
#define __Language "Appearance/Language" | ||
#define __FontHEX "HEX/Font" | ||
#define __AddressWidthHEX "HEX/AddressWidth" | ||
#define __Endianness "HEX/Endianness" | ||
#define __EnablePlugins "Plugins/EnablePlugins" | ||
|
||
#define __DataBasePath "Paths/DataBase" | ||
#define __EditorPath "Paths/Editor" | ||
#define __HelpPath "Paths/Help" | ||
#define __InfoPath "Paths/Info" | ||
#define __PluginsPath "Paths/Plugins" | ||
#define __QSSPath "Paths/QSS" | ||
#define __LangsPath "Paths/Langs" | ||
#define __ScriptsPath "Paths/Scripts" | ||
#define __SearchPath "Paths/Search" | ||
|
||
#define __DefaultDataBasePath "$app/db" | ||
#define __DefaultEditorPath "$app/editor" | ||
#define __DefaultHelpPath "$app/help" | ||
#define __DefaultInfoPath "$app/info" | ||
#define __DefaultPluginsPath "$app/die_plugins" | ||
#define __DefaultQSSPath "$app/qss" | ||
#define __DefaultLangsPath "$app/lang" | ||
#define __DefaultScriptsPath "$app/scripts" | ||
#define __DefaultSearchPath "$app/search" | ||
|
||
// KeySequences | ||
#define __KeySequence_tab1 "Alt+1" | ||
#define __KeySequence_tab2 "Alt+2" | ||
#define __KeySequence_tab3 "Alt+3" | ||
#define __KeySequence_tab4 "Alt+4" | ||
#define __KeySequence_tab5 "Alt+5" | ||
#define __KeySequence_tab6 "Alt+6" | ||
#define __KeySequence_tab7 "Alt+7" | ||
#define __KeySequence_tab8 "Alt+8" | ||
#define __KeySequence_tab9 "Alt+9" | ||
#define __KeySequence_altU "Alt+U" | ||
#define __KeySequence_altA "Alt+A" | ||
#define __KeySequence_altB "Alt+B" | ||
#define __KeySequence_altE "Alt+E" | ||
#define __KeySequence_altI "Alt+I" | ||
#define __KeySequence_altF "Alt+F" | ||
#define __KeySequence_altR "Alt+R" | ||
#define __KeySequence_altS "Alt+S" | ||
#define __KeySequence_altP "Alt+P" | ||
#define __KeySequence_altH "Alt+H" | ||
#define __KeySequence_altV "Alt+V" | ||
#define __KeySequence_altM "Alt+M" | ||
#define __KeySequence_altO "Alt+O" | ||
#define __KeySequence_altD "Alt+D" | ||
#define __KeySequence_altN "Alt+N" | ||
#define __KeySequence_ctrlA "Ctrl+A" | ||
#define __KeySequence_ctrlD "Ctrl+D" | ||
#define __KeySequence_ctrlR "Ctrl+R" | ||
#define __KeySequence_ctrlS "Ctrl+S" | ||
#define __KeySequence_ctrlF "Ctrl+F" | ||
#define __KeySequence_ctrlG "Ctrl+G" | ||
#define __KeySequence_ctrlI "Ctrl+I" | ||
#define __KeySequence_ctrlL "Ctrl+L" | ||
#define __KeySequence_ctrlN "Ctrl+N" | ||
#define __KeySequence_ctrlE "Ctrl+E" | ||
#define __KeySequence_ctrlW "Ctrl+W" | ||
|
||
#define __KeySequence_ctrlaltG "Ctrl+Alt+G" | ||
#define __KeySequence_ctrlaltE "Ctrl+Alt+E" | ||
#define __KeySequence_ctrlaltO "Ctrl+Alt+O" | ||
#define __KeySequence_ctrlaltS "Ctrl+Alt+S" | ||
#define __KeySequence_ctrlaltU "Ctrl+Alt+U" | ||
#define __KeySequence_ctrlaltL "Ctrl+Alt+L" | ||
#define __KeySequence_ctrlaltI "Ctrl+Alt+I" | ||
|
||
#define __KeySequence_save "Ctrl+S" | ||
#define __KeySequence_open "Ctrl+O" | ||
#define __KeySequence_saveandquit "Ctrl+Alt+S" | ||
#define __KeySequence_hex "Alt+H" | ||
#define __KeySequence_quit "Alt+X" | ||
|
||
#endif // _OPTIONS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "_mainclass.h" | ||
|
||
_MainClass::_MainClass(QObject *parent) : | ||
QObject(parent) | ||
{ | ||
} | ||
|
||
void _MainClass::setOptions(__DIE_OPTIONS *pOptions) | ||
{ | ||
this->pOptions=pOptions; | ||
} | ||
void _MainClass::handleMessage(QString szMessage) | ||
{ | ||
printf("%s",szMessage.toAscii().data()); | ||
|
||
if(pOptions->bSingleLineOutput) | ||
{ | ||
printf("; "); | ||
} | ||
else | ||
{ | ||
printf("\n"); | ||
} | ||
} | ||
|
||
//void _MainClass::appendSignature(QString szMessage) | ||
//{ | ||
// QString sType=szMessage.section(": ",0,0); | ||
// if((pOptions->bShowFileFormatOnce)&&(sType!=sCurrentType)) | ||
// { | ||
// szMessage=szMessage.section(": ",1,-1); | ||
// sCurrentType=sType; | ||
// } | ||
|
||
// handleMessage(szMessage); | ||
//} | ||
|
||
void _MainClass::appendError(QString szMessage) | ||
{ | ||
handleMessage(szMessage); | ||
} | ||
|
||
void _MainClass::appendFileName(QString szMessage) | ||
{ | ||
printf("%s",szMessage.toAscii().data()); | ||
|
||
if(pOptions->bSingleLineOutput) | ||
{ | ||
printf(": "); | ||
} | ||
else | ||
{ | ||
printf("\n"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef _MAINCLASS_H | ||
#define _MAINCLASS_H | ||
|
||
#include <QObject> | ||
#include <stdio.h> | ||
#include "../utils.h" | ||
|
||
class _MainClass : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit _MainClass(QObject *parent = 0); | ||
void setOptions(__DIE_OPTIONS *pOptions); | ||
signals: | ||
|
||
public slots: | ||
void handleMessage(QString szMessage); | ||
// void appendSignature(QString szMessage); | ||
void appendError(QString szMessage); | ||
void appendFileName(QString szMessage); | ||
|
||
private: | ||
bool bSingleLineOutput; | ||
__DIE_OPTIONS *pOptions; | ||
QString sCurrentType; | ||
}; | ||
|
||
#endif // _MAINCLASS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
QT += core script xml concurrent | ||
|
||
QT -= gui | ||
|
||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000 | ||
|
||
CONFIG += console | ||
CONFIG -= app_bundle | ||
|
||
TARGET = DIEC | ||
win32 { | ||
TARGET = DIEC_win | ||
} | ||
unix:!macx { | ||
BITSIZE = $$system(getconf LONG_BIT) | ||
if (contains(BITSIZE, 64)) { | ||
TARGET = DIEC_lin64 | ||
} | ||
if (contains(BITSIZE, 32)) { | ||
TARGET = DIEC_lin32 | ||
} | ||
} | ||
unix:macx { | ||
TARGET = DIEC_mac | ||
} | ||
|
||
include(../../build.pri) | ||
|
||
HEADERS += \ | ||
_mainclass.h \ | ||
../scriptpe.h \ | ||
../scriptmsdos.h \ | ||
../scriptelf.h \ | ||
../scriptbinary.h \ | ||
../scan.h \ | ||
../utils.h \ | ||
../../pluginsscript.h \ | ||
../_options.h \ | ||
../../versionresource.h \ | ||
../../pefile.h \ | ||
../../msdosfile.h \ | ||
../../elffile.h \ | ||
../../textfile.h \ | ||
../../binary.h \ | ||
../../machfile.h \ | ||
../scriptmach.h \ | ||
../scripttext.h \ | ||
../scriptgeneric.h \ | ||
../singlefilescan.h | ||
|
||
SOURCES += \ | ||
mainc.cpp \ | ||
_mainclass.cpp \ | ||
../scriptpe.cpp \ | ||
../scriptmsdos.cpp \ | ||
../scriptelf.cpp \ | ||
../scriptbinary.cpp \ | ||
../scan.cpp \ | ||
../utils.cpp \ | ||
../../pluginsscript.cpp \ | ||
../../versionresource.cpp \ | ||
../../pefile.cpp \ | ||
../../msdosfile.cpp \ | ||
../../elffile.cpp \ | ||
../../textfile.cpp \ | ||
../../binary.cpp \ | ||
../../machfile.cpp \ | ||
../scriptmach.cpp \ | ||
../scripttext.cpp \ | ||
../scriptgeneric.cpp \ | ||
../singlefilescan.cpp | ||
|
Oops, something went wrong.