BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
TlsDirWrapper.h
Go to the documentation of this file.
1#pragma once
2
4
6class TlsDirWrapper;
7
9{
10public:
11 /* fields :*/
22
24 : DataDirEntryWrapper(pe, pe::DIR_TLS) { wrap(); }
25
26 bool wrap();
27
28 virtual void* getPtr();
29 virtual bufsize_t getSize();
30
31 virtual QString getName() { return "TLS"; }
32 virtual size_t getFieldsCount() { return FIELD_COUNTER; }
33 virtual size_t getSubFieldsCount() { return 1; }
34
35 virtual void* getFieldPtr(size_t fieldId, size_t subField);
36 virtual QString getFieldName(size_t fieldId);
37 virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField = FIELD_NONE);
38
39private:
40 inline void* getTlsDirPtr();
41 IMAGE_TLS_DIRECTORY64* tls64();
42 IMAGE_TLS_DIRECTORY32* tls32();
43};
44
45
47{
48public:
49 // fields :
55
56 TlsEntryWrapper(Executable *pe, TlsDirWrapper *parentDir, size_t entryNumber)
57 : ExeNodeWrapper(pe, parentDir, entryNumber) { this->parentDir = parentDir; }
58
59 // full structure boundaries
60 virtual void* getPtr();
61 virtual bufsize_t getSize();
62
63 virtual QString getName() { return "TLS Callback"; }
64 virtual size_t getFieldsCount() { return FIELD_COUNTER; }
65 virtual size_t getSubFieldsCount() { return 1; }
66
67 // specific field boundaries
68 virtual void* getFieldPtr(size_t fieldId, size_t subField = FIELD_NONE) { return getPtr(); }
69 virtual QString getFieldName(size_t fieldId) { return getName(); }
70 virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField) { return Executable::VA; }
71
72private:
73 TlsDirWrapper* parentDir;
74
75};
uint32_t bufsize_t
#define FIELD_NONE
virtual QString getName()
virtual bufsize_t getSize()
virtual size_t getFieldsCount()
virtual void * getPtr()
virtual size_t getSubFieldsCount()
TlsDirWrapper(PEFile *pe)
virtual void * getFieldPtr(size_t fieldId, size_t subField)
virtual QString getFieldName(size_t fieldId)
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
virtual QString getFieldName(size_t fieldId)
virtual QString getName()
virtual bufsize_t getSize()
virtual void * getPtr()
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField)
FieldID
@ NONE
@ CALLBACK_ADDR
@ FIELD_COUNTER
TlsEntryWrapper(Executable *pe, TlsDirWrapper *parentDir, size_t entryNumber)
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual size_t getFieldsCount()
virtual size_t getSubFieldsCount()