BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
ExceptionDirWrapper.h
Go to the documentation of this file.
1#pragma once
2
4
7
9{
10public:
12 : DataDirEntryWrapper(pe, pe::DIR_EXCEPTION), parsedSize(0) { wrap(); }
13
14 bool wrap();
15
16 virtual void* getPtr();
17 virtual bufsize_t getSize() { return parsedSize; }
18
19 virtual QString getName() { return "Exceptions Dir."; }
20 virtual size_t getFieldsCount() { return entries.size(); }
21
22 virtual void* getFieldPtr(size_t fieldId, size_t subField) { return getSubfieldPtr(fieldId, subField); }
23 virtual QString getFieldName(size_t fieldId) { return "Exceptions Block"; }
24 virtual QString getFieldName(size_t fieldId, size_t subField) { return getSubfieldName(fieldId, subField); }
25
26private:
27 bufsize_t parsedSize;
28
30};
31
32#define ARM_XDATA_FLAG 0x3
33
35{
36public:
37 // fields :
45
52
53 ExceptionEntryWrapper(Executable *pe, ExceptionDirWrapper *parentDir, size_t entryNumber)
54 : ExeNodeWrapper(pe, parentDir, entryNumber), cachedRaw(INVALID_ADDR) { this->parentDir = parentDir;}
55
56 bool wrap() { return true; }
57
58 // full structure boundaries
59 virtual void* getPtr();
60
61 virtual bufsize_t getSize();
62 virtual QString getName() { return "Exceptions Block"; }
63 virtual size_t getFieldsCount();
64 virtual size_t getSubFieldsCount() { return 1; }
65
66 // specific field boundaries
67 virtual void* getFieldPtr(size_t fieldId, size_t subField = FIELD_NONE);
68 virtual QString getFieldName(size_t fieldId);
69 virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField);
70
71private:
72 bufsize_t _getSize();
73 offset_t cachedRaw;
74 ExceptionDirWrapper* parentDir;
75};
76
uint32_t bufsize_t
const offset_t INVALID_ADDR
uint64_t offset_t
#define FIELD_NONE
virtual QString getFieldName(size_t fieldId, size_t subField)
virtual QString getName()
virtual size_t getFieldsCount()
virtual bufsize_t getSize()
virtual void * getFieldPtr(size_t fieldId, size_t subField)
virtual QString getFieldName(size_t fieldId)
virtual void * getPtr()
ExceptionEntryWrapper(Executable *pe, ExceptionDirWrapper *parentDir, size_t entryNumber)
virtual QString getName()
ExceptionBlockFID_Arm64
@ ARM_EXCEPT_FIELD_COUNTER
@ ARM_EXCEPT_XDATA
@ ARM_EXCEPT_START
@ ARM_EXCEPT_NONE
bool wrap()
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual size_t getSubFieldsCount()
virtual size_t getFieldsCount()
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField)
virtual QString getFieldName(size_t fieldId)
virtual bufsize_t getSize()
ExceptionBlockFID_Intel
@ BEGIN_ADDR
@ NONE
@ UNWIND_INFO_ADDR
@ FIELD_COUNTER
@ END_ADDR
virtual void * getSubfieldPtr(size_t fieldId, size_t subField)
virtual QString getSubfieldName(size_t fieldId, size_t subField)
std::vector< ExeNodeWrapper * > entries