BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
MappedExe.h
Go to the documentation of this file.
1#pragma once
2#include <map>
3
4#include "Executable.h"
5#include "ExeElementWrapper.h"
6
8{
9public:
10 enum WRAPPERS {
11 WR_NONE = size_t(-1),
13 };
14
17
18 virtual ExeElementWrapper* getWrapper(size_t wrapperId);
19
20 size_t wrappersCount() { return wrappers.size(); }
21 QString getWrapperName(size_t id);
22
23protected:
24 virtual void wrap() = 0;
25 void clearWrappers();
26
27 std::map<size_t, ExeElementWrapper*> wrappers;
28};
29
31public:
32 virtual bool canResize(bufsize_t newSize)
33 {
34 // disabled by default
35 return false;
36 }
37
38 virtual bool resize(bufsize_t newSize)
39 {
40 if (!canResize(newSize)) return false;
41
42 if (Executable::resize(newSize)) {
43 wrap();
44 return true;
45 }
46 return false;
47 }
48
49 virtual void wrap() = 0;
50
51protected:
53 : Executable(v_buf, v_bitMode), ExeWrappersContainer() { }
54
55 virtual ~MappedExe(void) { }
56};
uint32_t bufsize_t
std::map< size_t, ExeElementWrapper * > wrappers
Definition MappedExe.h:27
virtual ~ExeWrappersContainer(void)
Definition MappedExe.h:16
size_t wrappersCount()
Definition MappedExe.h:20
QString getWrapperName(size_t id)
Definition MappedExe.cpp:19
virtual void wrap()=0
virtual ExeElementWrapper * getWrapper(size_t wrapperId)
Definition MappedExe.cpp:13
virtual bool resize(bufsize_t newSize)
Definition Executable.h:117
virtual bool canResize(bufsize_t newSize)
Definition MappedExe.h:32
MappedExe(AbstractByteBuffer *v_buf, exe_bits v_bitMode)
Definition MappedExe.h:52
virtual bool resize(bufsize_t newSize)
Definition MappedExe.h:38
virtual ~MappedExe(void)
Definition MappedExe.h:55
virtual void wrap()=0