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
scanned_modules.h
Go to the documentation of this file.
1#pragma once
2
3#include <windows.h>
4
5#include <map>
6#include <string>
7#include <iostream>
8
10
11namespace pesieve {
12
15
16 public:
17
19 {
20 return start;
21 }
22
24 {
25 return moduleSize + start;
26 }
27
28 size_t getSize()
29 {
30 return moduleSize;
31 }
32
33 bool isSuspicious() const
34 {
35 return this->is_suspicious;
36 }
37
38 std::string getModName() const
39 {
40 return this->moduleName;
41 }
42
43 protected:
45 : start(_start), moduleSize(_moduleSize),
46 is_suspicious(false)
47 {
48 }
49
51 {
52 }
53
54 bool operator<(ScannedModule other) const
55 {
56 return this->start < other.start;
57 }
58
60 this->is_suspicious = _is_suspicious;
61 }
62
63 bool resize(size_t newSize)
64 {
65 if (moduleSize < newSize) {
66 //std::cout << "Resizing module from: " << std::hex << moduleSize << " to: " << newSize << "\n";
67 moduleSize = newSize;
68 return true;
69 }
70 return false;
71 }
72
74
75 private:
76 size_t moduleSize;
77 bool is_suspicious;
78 std::string moduleName;
79
80 friend class ModulesInfo;
81 };
82
85
86 public:
88 : process_id(_pid)
89 {
90 }
91
93 {
94 deleteAll();
95 }
96
98
99 size_t count() { return modulesMap.size(); }
100
102 ScannedModule* findModuleContaining(ULONGLONG address, size_t size = 0) const;
104
105 protected:
107 void deleteAll();
108
109 private:
110 std::map<ULONGLONG, ScannedModule*> modulesMap;
111 const DWORD process_id;
112 };
113
114}; //namespace pesieve
115
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.
ScannedModule * findModuleContaining(ULONGLONG address, size_t size=0) const
size_t getScannedSize(ULONGLONG start_address) const
bool appendToModulesList(ModuleScanReport *report)
bool appendModule(ScannedModule *module)
ScannedModule * getModuleAt(ULONGLONG address) const
Represents a basic info about the scanned module, such as its base offset, size, and the status.
std::string getModName() const
ULONGLONG getStart() const
void setSuspicious(bool _is_suspicious)
bool operator<(ScannedModule other) const
ULONGLONG getEnd() const
bool resize(size_t newSize)
ScannedModule(ULONGLONG _start, size_t _moduleSize)
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
Final summary about the scanned process.