PE-sieve
Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches).
Loading...
Searching...
No Matches
results_dumper.h
Go to the documentation of this file.
1#pragma once
2
3#include <windows.h>
4
5#include "report_formatter.h"
6#include "dump_report.h"
7#include "pe_buffer.h"
8
9namespace pesieve {
10
12 {
13 public:
14
15 ResultsDumper(std::string _baseDir, bool _quiet)
16 : baseDir(_baseDir), quiet(_quiet)
17 {
18 }
19
20 // dump all modules detected as suspicious during the process scan
22 HANDLE hProcess,
23 bool isRefl,
24 ProcessScanReport &process_report,
25 const pesieve::t_dump_mode dump_mode,
26 const t_imprec_mode imprec_mode,
27 const bool rebase
28 );
29
30 // dump JSON report from the process scan
31 bool dumpJsonReport(ProcessScanReport &process_report, const t_results_filter &filter, const pesieve::t_json_level &jdetails);
32
33 bool dumpJsonReport(ProcessDumpReport &process_report);
34
35 bool dumpJsonReport(ErrorReport& error_report, const t_results_filter& filter);
36
37 std::string getOutputDir()
38 {
39 return this->dumpDir;
40 }
41
42 std::string makeOutPath(const std::string &fname, const std::string& defaultExtension = "");
43
44 protected:
55 bool dumpModule(
56 IN HANDLE processHandle,
57 IN bool isRefl,
58 IN const ModulesInfo &modulesInfo,
59 IN ModuleScanReport* modReport,
60 IN const peconv::ExportsMapper *exportsMap,
61 IN const pesieve::t_dump_mode dump_mode,
62 IN const pesieve::t_imprec_mode imprec_mode,
63 IN bool rebase,
64 OUT ProcessDumpReport &dumpReport
65 );
66
72 std::string makeModuleDumpPath(ULONGLONG modBaseAddr, const std::string &fname, const std::string &defaultExtension);
73
74 std::string makeDirName(const DWORD process_id);
75
76 void makeAndJoinDirectories(std::stringstream& name_stream);
77
78 bool fillModuleCopy(IN ModuleScanReport* mod, IN OUT PeBuffer& module_buf);
79
80 std::string dumpDir; // dump directory
81 std::string baseDir; // base directory
82 bool quiet;
83 };
84
85}; //namespace pesieve
A base class of all the reports detailing on the output of the performed module's scan.
A container of all the process modules that were scanned.
The report aggregating the results of the performed dumps.
Definition dump_report.h:49
The report aggregating the results of the performed scan.
Definition scan_report.h:19
std::string makeModuleDumpPath(ULONGLONG modBaseAddr, const std::string &fname, const std::string &defaultExtension)
std::string makeDirName(const DWORD process_id)
bool fillModuleCopy(IN ModuleScanReport *mod, IN OUT PeBuffer &module_buf)
void makeAndJoinDirectories(std::stringstream &name_stream)
ResultsDumper(std::string _baseDir, bool _quiet)
std::string makeOutPath(const std::string &fname, const std::string &defaultExtension="")
bool dumpModule(IN HANDLE processHandle, IN bool isRefl, IN const ModulesInfo &modulesInfo, IN ModuleScanReport *modReport, IN const peconv::ExportsMapper *exportsMap, IN const pesieve::t_dump_mode dump_mode, IN const pesieve::t_imprec_mode imprec_mode, IN bool rebase, OUT ProcessDumpReport &dumpReport)
ProcessDumpReport * dumpDetectedModules(HANDLE hProcess, bool isRefl, ProcessScanReport &process_report, const pesieve::t_dump_mode dump_mode, const t_imprec_mode imprec_mode, const bool rebase)
std::string getOutputDir()
bool dumpJsonReport(ProcessScanReport &process_report, const t_results_filter &filter, const pesieve::t_json_level &jdetails)
t_results_filter