BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
DelayImpDirWrapper.h
Go to the documentation of this file.
1#pragma once
2
4#include "pe_formats.h"
5
7
9{
10public:
12 : ImportBaseDirWrapper(pe, pe::DIR_DELAY_IMPORT) { wrap(); }
13
14 virtual void* getPtr();
15 virtual bufsize_t getSize();
16 virtual QString getName() { return "DelayImports"; }
17
18protected:
19 virtual bool loadNextEntry(size_t cntr);
20
21 bool is64(); // autodetect! 64bit PE may use IMAGE_DELAY_LOAD32!
22 bool is32() { return !is64(); }
23
24 pe::IMAGE_DELAY_LOAD* firstDelayLd() { return (pe::IMAGE_DELAY_LOAD*) firstDelayLd(sizeof(pe::IMAGE_DELAY_LOAD)); }
25 void* firstDelayLd(bufsize_t size);
27
29};
30
32{
33public:
46
47 DelayImpEntryWrapper(PEFile *pe, DelayImpDirWrapper *importsDir, size_t entryNumber)
48 : ImportBaseEntryWrapper(pe, importsDir, entryNumber) { wrap(); }
49
50 //bool wrap();
51
52 virtual void* getPtr();
53 virtual bufsize_t getSize();
54 virtual QString getName();
55 virtual char* getLibraryName();
56 virtual size_t getFieldsCount() { return FIELD_COUNTER; }
57
58 virtual void* getFieldPtr(size_t fieldId, size_t subField);
59 virtual QString getFieldName(size_t fieldId);
60 virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField = FIELD_NONE);
61
62protected:
63 bool loadNextEntry(size_t entryNum);
64
65 virtual IMAGE_IMPORT_BY_NAME* getFirstImpByNamePtr();
66
68friend class DelayImpDirWrapper;
69};
70
72{
73public:
74 // fields :
83
84 DelayImpFuncWrapper(PEFile *pe, DelayImpEntryWrapper *parentDir, size_t entryNumber)
85 : ImportBaseFuncWrapper(pe, parentDir, entryNumber) { this->parentDir = parentDir; }
86
87 // full structure boundaries
88 virtual void* getPtr() { return getFieldPtr(IAT_ADDR); }
89 virtual bufsize_t getSize() { return sizeof(DWORD); }
90
91 //virtual QString getName();
92 virtual size_t getFieldsCount() { return FIELD_COUNTER; }
93 virtual size_t getSubFieldsCount() { return 1; }
94
95 // specific field boundaries
96 virtual void* getFieldPtr(size_t fieldId, size_t subField = FIELD_NONE);
97 virtual bufsize_t getFieldSize(size_t fieldId, size_t subField = FIELD_NONE);
98 virtual QString getFieldName(size_t fieldId);
99 virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField);
100
101 char* getFunctionName();
102 uint16_t getHint();
103 bool isByOrdinal();
104 virtual uint64_t getOrdinal();
106
107private:
108 size_t ptrLen() { return (m_Exe->getBitMode() == Executable::BITS_64) ? sizeof(uint64_t) : sizeof(uint32_t); }
109 virtual IMAGE_IMPORT_BY_NAME* getImportByNamePtr();
110 DelayImpEntryWrapper* parentDir;
111};
uint32_t bufsize_t
uint64_t offset_t
#define FIELD_NONE
DelayImpDirWrapper(PEFile *pe)
virtual QString getName()
pe::IMAGE_DELAY_LOAD * firstDelayLd()
virtual bool loadNextEntry(size_t cntr)
virtual bufsize_t getSize()
virtual void * getPtr()
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 char * getLibraryName()
virtual void * getPtr()
virtual bufsize_t getSize()
virtual size_t getFieldsCount()
DelayImpEntryWrapper(PEFile *pe, DelayImpDirWrapper *importsDir, size_t entryNumber)
virtual IMAGE_IMPORT_BY_NAME * getFirstImpByNamePtr()
DelayImpDirFID
@ TIMESTAMP
@ BOUND_IAT
@ UNLOAD_IAT
@ IAT
@ MOD
@ ATTRS
@ NAME
@ NONE
@ FIELD_COUNTER
@ INT
bool loadNextEntry(size_t entryNum)
virtual QString getName()
virtual size_t getFieldsCount()
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField)
DelayImpFuncWrapper(PEFile *pe, DelayImpEntryWrapper *parentDir, size_t entryNumber)
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
virtual uint64_t getOrdinal()
virtual QString getFieldName(size_t fieldId)
virtual size_t getSubFieldsCount()
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual void * getPtr()
virtual bufsize_t getSize()
virtual exe_bits getBitMode()
Definition Executable.h:56
bool wrap()