PE-sieve
Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches).
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
_
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Functions
_
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Variables
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Typedefs
Enumerations
Enumerator
c
h
i
p
s
t
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
i
o
r
s
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
u
Functions
Variables
Typedefs
Enumerations
Enumerator
j
o
p
r
s
Macros
c
d
e
g
h
i
l
m
o
p
r
u
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
scanners
mapping_scanner.cpp
Go to the documentation of this file.
1
#include "
mapping_scanner.h
"
2
3
#include "
../utils/path_converter.h
"
4
5
using namespace
pesieve
;
6
using namespace
pesieve::util
;
7
8
MappingScanReport
*
pesieve::MappingScanner::scanRemote
()
9
{
10
MappingScanReport
*my_report =
new
MappingScanReport
(
moduleData
.moduleHandle,
moduleData
.original_size);
11
12
std::string mapped_name =
RemoteModuleData::getMappedName
(
processHandle
,
moduleData
.moduleHandle);
13
std::string module_name =
moduleData
.szModName;
14
bool
is_same = (
to_lowercase
(mapped_name) ==
to_lowercase
(module_name));
15
16
my_report->
mappedFile
= mapped_name;
17
my_report->
moduleFile
= module_name;
18
19
size_t
mod_name_len = module_name.length();
20
if
(!is_same && mod_name_len > 0) {
21
//check Wow64
22
char
path_copy[
MAX_PATH
] = { 0 };
23
::memcpy(path_copy,
moduleData
.szModName, mod_name_len);
24
convert_to_wow64_path
(path_copy);
25
is_same = (
to_lowercase
(mapped_name) ==
to_lowercase
(path_copy));
26
if
(is_same) {
27
moduleData
.switchToWow64Path();
28
}
29
}
30
if
(is_same) {
31
my_report->
status
=
SCAN_NOT_SUSPICIOUS
;
32
return
my_report;
33
}
34
bool
isFilled =
false
;
35
if
(
moduleData
.loadOriginal()) {
36
isFilled =
true
;
37
}
38
else
{
39
#ifdef _DEBUG
40
std::cout <<
"Failed to load module name:\n\t"
<< module_name <<
"\nswitching to mapped name:\n\t"
<< mapped_name << std::endl;
41
#endif
42
moduleData
.switchToMappedPath();
43
if
(
moduleData
.loadOriginal()) {
44
isFilled =
true
;
45
}
46
}
47
if
(isFilled) {
48
my_report->
isDotNetModule
=
moduleData
.isDotNet();
49
my_report->
origBase
=
moduleData
.getHdrImageBase();
50
}
51
my_report->
status
=
SCAN_SUSPICIOUS
;
52
return
my_report;
53
}
8
MappingScanReport
*
pesieve::MappingScanner::scanRemote
() {
…
}
pesieve::ElementScanReport::status
t_scan_status status
Definition
module_scan_report.h:43
pesieve::MappingScanReport
Definition
mapping_scanner.h:13
pesieve::MappingScanReport::mappedFile
std::string mappedFile
Definition
mapping_scanner.h:44
pesieve::MappingScanner::scanRemote
virtual MappingScanReport * scanRemote()
Definition
mapping_scanner.cpp:8
pesieve::MappingScanner::moduleData
ModuleData & moduleData
Definition
mapping_scanner.h:58
pesieve::ModuleScanReport::moduleFile
std::string moduleFile
Definition
module_scan_report.h:77
pesieve::ModuleScanReport::isDotNetModule
bool isDotNetModule
Definition
module_scan_report.h:76
pesieve::ModuleScanReport::origBase
ULONGLONG origBase
Definition
module_scan_report.h:78
pesieve::ProcessFeatureScanner::processHandle
HANDLE processHandle
Definition
process_feature_scanner.h:29
pesieve::RemoteModuleData::getMappedName
static std::string getMappedName(HANDLE _processHandle, LPVOID _modBaseAddr)
Definition
module_data.cpp:269
mapping_scanner.h
pesieve::util
Definition
artefact_scanner.cpp:12
pesieve::util::to_lowercase
std::string to_lowercase(std::string)
Definition
strings_util.cpp:6
pesieve::util::convert_to_wow64_path
bool convert_to_wow64_path(char *szModName)
Definition
path_converter.cpp:195
pesieve
Definition
pesieve.py:1
pesieve.MAX_PATH
int MAX_PATH
Definition
pesieve.py:10
pesieve::SCAN_NOT_SUSPICIOUS
@ SCAN_NOT_SUSPICIOUS
Definition
module_scan_report.h:20
pesieve::SCAN_SUSPICIOUS
@ SCAN_SUSPICIOUS
Definition
module_scan_report.h:21
path_converter.h
Generated by
1.13.2