[FEATURE] Refactored version definition. Added version to resources

This commit is contained in:
hasherezade
2022-11-04 07:14:42 -07:00
parent 28b389740d
commit 6da0e3a9e9
8 changed files with 58 additions and 63 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
docs
*.aps
*.bak
+2 -1
View File
@@ -190,7 +190,8 @@ set (hdrs
set (rsrc
resources.h
resources.rc
include/pe_sieve_ver_short.h
pe_sieve.rc
)
# set filters in Visual Studio project:
+6
View File
@@ -0,0 +1,6 @@
#pragma once
#define PESIEVE_MAJOR_VERSION 0
#define PESIEVE_MINOR_VERSION 3
#define PESIEVE_MICRO_VERSION 5
#define PESIEVE_PATCH_VERSION 0
+2 -3
View File
@@ -1,13 +1,12 @@
#pragma once
#include <windows.h>
#include <pe_sieve_ver_short.h>
#ifdef __cplusplus
namespace pesieve {
#endif
const char PESIEVE_VERSION[] = "0.3.4.1";
const DWORD PESIEVE_VERSION_ID = 0x00030401; // 00 03 04 01
const DWORD PESIEVE_VERSION_ID = MAKELONG(MAKEWORD(PESIEVE_PATCH_VERSION, PESIEVE_MICRO_VERSION), MAKEWORD(PESIEVE_MINOR_VERSION, PESIEVE_MAJOR_VERSION));
const char PESIEVE_URL[] = "https://github.com/hasherezade/pe-sieve";
#ifdef __cplusplus
+14 -1
View File
@@ -44,12 +44,25 @@ void free_params(t_params &args)
free_strparam(args.modules_ignored);
}
std::string version_to_str(DWORD version)
{
BYTE* chunks = (BYTE*)&version;
std::stringstream stream;
stream << std::hex <<
(int)chunks[3] << "." <<
(int)chunks[2] << "." <<
(int)chunks[1] << "." <<
(int)chunks[0];
return stream.str();
}
int main(int argc, char *argv[])
{
bool info_req = false;
t_params args = { 0 };
PEsieveParams uParams(PESIEVE_VERSION);
PEsieveParams uParams(version_to_str(PESIEVE_VERSION_ID));
if (argc < 2) {
uParams.printBanner();
uParams.printBriefInfo();
+1 -1
View File
@@ -240,7 +240,7 @@ pesieve::ReportEx* pesieve::scan_and_dump(IN const pesieve::t_params args)
std::string pesieve::info()
{
std::stringstream stream;
stream << "Version: " << PESIEVE_VERSION;
stream << "Version: " << PESIEVE_MAJOR_VERSION << "." << PESIEVE_MINOR_VERSION << "." << PESIEVE_MICRO_VERSION << "." << PESIEVE_PATCH_VERSION;
#ifdef _WIN64
stream << " (x64)" << "\n";
#else
+32
View File
@@ -0,0 +1,32 @@
#include "pe_sieve_ver_short.h"
#include "resources.h"
#include <windows.h>
#define VER_COMPANYNAME_STR "Hashereware (hashereware.com)"
#define VER_FILETYPE VFT_APP
#define VER_FILESUBTYPE VFT2_UNKNOWN
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEDESCRIPTION_STR "PE-sieve: scans given process, recognizes and dumps a variety of potentially malicious implants."
#define VER_INTERNALNAME_STR "pe-sieve.exe"
#define VER_ORIGINALFILENAME_STR "pe-sieve.exe"
#define VER_LEGALCOPYRIGHT_STR "Copyright © 2017-2022 Hasherezade"
#define VER_PRODUCTNAME_STR "PE-sieve"
#define VER_FILEVERSION PESIEVE_MAJOR_VERSION,PESIEVE_MINOR_VERSION,PESIEVE_MICRO_VERSION,PESIEVE_PATCH_VERSION
#define VER_FILEFLAGSMASK (VS_FF_DEBUG | VS_FF_PRERELEASE)
#ifdef DEBUG
#define VER_FILEFLAGS (VS_FF_DEBUG)
#else
#define VER_FILEFLAGS (0)
#endif
#include "common.ver"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "logo/favicon.ico"
-56
View File
@@ -1,56 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resources.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resources.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""windows.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "logo/favicon.ico"
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED