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
workingset_enum.h
Go to the documentation of this file.
1#pragma once
2
3#include <windows.h>
4#include <set>
5
6#ifdef _DEBUG
7#include <iostream>
8#endif
9
10#ifndef PAGE_SIZE
11#define PAGE_SIZE 0x1000
12#endif
13
14namespace pesieve {
15 namespace util {
16
17 typedef struct _mem_region_info
18 {
21 size_t size;
22
24 : alloc_base(0), base(0), size(0)
25 {
26 }
27
32
34 {
35 this->base = other.base;
36 this->alloc_base = other.alloc_base;
37 this->size = other.size;
38 }
39
40 bool operator<(const _mem_region_info& rhs) const
41 {
42 return this->base < rhs.base;
43 }
44
45#ifdef _DEBUG
46 void print() const
47 {
48 std::cout << "Region:\t" << std::hex << this->alloc_base << " :\t";
49 if (this->alloc_base != this->base) {
50 std::cout << this->base << " :\t";
51 }
52 else {
53 std::cout << "*" << " :\t";
54 }
55 std::cout << this->size << std::endl;
56 }
57#endif
58
60
61 size_t enum_workingset(HANDLE processHandle, std::set<mem_region_info> &regions);
62
64 };
65};
DWORD count_workingset_entries(HANDLE processHandle)
size_t enum_workingset(HANDLE processHandle, std::set< mem_region_info > &regions)
DWORD(__stdcall *_PssCaptureSnapshot)(HANDLE ProcessHandle
struct pesieve::util::_mem_region_info mem_region_info
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
_mem_region_info(ULONGLONG _alloc_base, ULONGLONG _base, size_t _size)
_mem_region_info(const _mem_region_info &other)
bool operator<(const _mem_region_info &rhs) const