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)
17 {
18 }
19
20 // dump all modules detected as suspicious during the process scan
22
23 // dump JSON report from the process scan
25
27
28 std::string getOutputDir()
29 {
30 return this->dumpDir;
31 }
32
33 std::string makeOutPath(const std::string &fname, const std::string& defaultExtension = "");
34
35 protected:
45 bool dumpModule(
46 IN HANDLE processHandle,
47 IN bool isRefl,
48 IN const ModulesInfo &modulesInfo,
50 IN const peconv::ExportsMapper *exportsMap,
51 IN const pesieve::t_dump_mode dump_mode,
52 IN const pesieve::t_imprec_mode imprec_mode,
54 );
55
61 std::string makeModuleDumpPath(ULONGLONG modBaseAddr, const std::string &fname, const std::string &defaultExtension);
62
63 std::string makeDirName(const DWORD process_id);
64
65 void makeAndJoinDirectories(std::stringstream& name_stream);
66
68
69 std::string dumpDir; // dump directory
70 std::string baseDir; // base directory
71 bool quiet;
72 };
73
74}; //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:48
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="")
ProcessDumpReport * dumpDetectedModules(HANDLE hProcess, bool isRefl, ProcessScanReport &process_report, const pesieve::t_dump_mode dump_mode, const pesieve::t_imprec_mode imprec_mode)
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, OUT ProcessDumpReport &dumpReport)
std::string getOutputDir()
bool dumpJsonReport(ProcessScanReport &process_report, const ProcessScanReport::t_report_filter &filter, const pesieve::t_json_level &jdetails)
size_t fill_iat(BYTE *vBuf, size_t vBufSize, IN const peconv::ExportsMapper *exportsMap, IN OUT IATBlock &iat, IN ThunkFoundCallback *callback)
Definition iat_finder.h:31