diff --git a/_delay_imp_dir_wrapper_8h_source.html b/_delay_imp_dir_wrapper_8h_source.html index ea72f44b..16ad4fa3 100644 --- a/_delay_imp_dir_wrapper_8h_source.html +++ b/_delay_imp_dir_wrapper_8h_source.html @@ -284,9 +284,9 @@ $(function(){ initResizable(false); });
Executable::BITS_64
@ BITS_64
Definition Executable.h:32
Executable::getBitMode
virtual exe_bits getBitMode()
Definition Executable.h:49
ImportBaseDirWrapper
Definition ImportBaseDirWrapper.h:16
-
ImportBaseDirWrapper::wrap
virtual bool wrap()
Definition ImportBaseDirWrapper.cpp:115
+
ImportBaseDirWrapper::wrap
virtual bool wrap()
Definition ImportBaseDirWrapper.cpp:114
ImportBaseEntryWrapper
Definition ImportBaseDirWrapper.h:67
-
ImportBaseEntryWrapper::wrap
bool wrap()
Definition ImportBaseDirWrapper.cpp:169
+
ImportBaseEntryWrapper::wrap
bool wrap()
Definition ImportBaseDirWrapper.cpp:168
ImportBaseFuncWrapper
Definition ImportBaseDirWrapper.h:94
PEFile
Definition PEFile.h:45
diff --git a/_export_dir_wrapper_8cpp_source.html b/_export_dir_wrapper_8cpp_source.html index 34c7391e..4a88e5cc 100644 --- a/_export_dir_wrapper_8cpp_source.html +++ b/_export_dir_wrapper_8cpp_source.html @@ -155,314 +155,313 @@ $(function(){ initResizable(false); });
56 nameOrdRVA += sizeof(WORD);
57 //nameRVA += sizeof(DWORD);
58 }
-
59 //printf("parsed num: %d\n", this->ordToNameRVA.size());
-
60 return i;
-
61}
+
59 return i;
+
60}
-
62
-
-
63bool ExportDirWrapper::wrap()
-
64{
-
65 clear();
-
66 size_t mapNum = mapNames();
-
67
-
68 IMAGE_EXPORT_DIRECTORY* exp = exportDir();
-
69 if (exp == NULL) return 0;
-
70
-
71 size_t maxFunc = exp->NumberOfFunctions;
-
72
-
73 for (size_t i = 0; i < maxFunc; i++) {
-
74 //TODO: build entries...
-
75 ExportEntryWrapper *entry = new ExportEntryWrapper(m_Exe, this, i);
-
76 if (entry->getPtr() == NULL) {
-
77 delete entry;
-
78 break;
-
79 }
-
80 this->entries.push_back(entry);
-
81 }
-
82 return true;
-
83}
+
61
+
+ +
63{
+
64 clear();
+
65 mapNames();
+
66
+
67 IMAGE_EXPORT_DIRECTORY* exp = exportDir();
+
68 if (exp == NULL) return 0;
+
69
+
70 size_t maxFunc = exp->NumberOfFunctions;
+
71
+
72 for (size_t i = 0; i < maxFunc; i++) {
+
73 //TODO: build entries...
+
74 ExportEntryWrapper *entry = new ExportEntryWrapper(m_Exe, this, i);
+
75 if (entry->getPtr() == NULL) {
+
76 delete entry;
+
77 break;
+
78 }
+
79 this->entries.push_back(entry);
+
80 }
+
81 return true;
+
82}
-
84
-
- -
86{
-
87 if (getPtr() == NULL) return 0;
-
88 return sizeof(IMAGE_EXPORT_DIRECTORY);
-
89}
+
83
+
+ +
85{
+
86 if (getPtr() == NULL) return 0;
+
87 return sizeof(IMAGE_EXPORT_DIRECTORY);
+
88}
-
90
-
- -
92{
-
93 QString infoName = "Export";
-
94 QString libName = this->getLibraryName();
-
95 if (libName.length() >= 0) {
-
96 infoName += ": "+ libName;
-
97 }
-
98 return infoName;
-
99}
+
89
+
+ +
91{
+
92 QString infoName = "Export";
+
93 QString libName = this->getLibraryName();
+
94 if (libName.length() >= 0) {
+
95 infoName += ": "+ libName;
+
96 }
+
97 return infoName;
+
98}
-
100
-
-
101void* ExportDirWrapper::getFieldPtr(size_t fId, size_t subField)
-
102{
-
103 IMAGE_EXPORT_DIRECTORY* d = exportDir();
-
104 if (d == NULL) return NULL;
-
105
-
106 switch (fId) {
-
107 case CHARACTERISTIC: return &d->Characteristics;
-
108 case TIMESTAMP: return &d->TimeDateStamp;
-
109 case MAJOR_VER: return &d->MajorVersion;
-
110 case MINOR_VER: return &d->MinorVersion;
-
111 case NAME_RVA: return &d->Name;
-
112 case BASE: return &d->Base;
-
113 case FUNCTIONS_NUM: return &d->NumberOfFunctions;
-
114 case NAMES_NUM: return &d->NumberOfNames;
-
115 case FUNCTIONS_RVA: return &d->AddressOfFunctions;
-
116 case FUNC_NAMES_RVA: return &d->AddressOfNames;
-
117 case NAMES_ORDINALS_RVA: return &d->AddressOfNameOrdinals;
-
118 }
-
119 return this->getPtr();
-
120}
+
99
+
+
100void* ExportDirWrapper::getFieldPtr(size_t fId, size_t subField)
+
101{
+
102 IMAGE_EXPORT_DIRECTORY* d = exportDir();
+
103 if (d == NULL) return NULL;
+
104
+
105 switch (fId) {
+
106 case CHARACTERISTIC: return &d->Characteristics;
+
107 case TIMESTAMP: return &d->TimeDateStamp;
+
108 case MAJOR_VER: return &d->MajorVersion;
+
109 case MINOR_VER: return &d->MinorVersion;
+
110 case NAME_RVA: return &d->Name;
+
111 case BASE: return &d->Base;
+
112 case FUNCTIONS_NUM: return &d->NumberOfFunctions;
+
113 case NAMES_NUM: return &d->NumberOfNames;
+
114 case FUNCTIONS_RVA: return &d->AddressOfFunctions;
+
115 case FUNC_NAMES_RVA: return &d->AddressOfNames;
+
116 case NAMES_ORDINALS_RVA: return &d->AddressOfNameOrdinals;
+
117 }
+
118 return this->getPtr();
+
119}
-
121
-
-
122QString ExportDirWrapper::getFieldName(size_t fieldId)
-
123{
-
124 switch (fieldId) {
-
125 case CHARACTERISTIC: return "Characteristics";
-
126 case TIMESTAMP: {
-
127 PEFile* myPe = dynamic_cast<PEFile*>(this->m_Exe);
-
128 if (myPe && myPe->isReproBuild()) {
-
129 return "ReproChecksum";
-
130 }
-
131 return "TimeDateStamp";
-
132 }
-
133 case MAJOR_VER: return "MajorVersion";
-
134 case MINOR_VER: return "MinorVersion";
-
135 case NAME_RVA: return "Name";
-
136 case BASE: return "Base";
-
137 case FUNCTIONS_NUM: return "NumberOfFunctions";
-
138 case NAMES_NUM: return "NumberOfNames";
-
139 case FUNCTIONS_RVA: return "AddressOfFunctions";
-
140 case FUNC_NAMES_RVA: return "AddressOfNames";
-
141 case NAMES_ORDINALS_RVA: return "AddressOfNameOrdinals";
-
142 }
-
143 return getName();
-
144}
+
120
+
+
121QString ExportDirWrapper::getFieldName(size_t fieldId)
+
122{
+
123 switch (fieldId) {
+
124 case CHARACTERISTIC: return "Characteristics";
+
125 case TIMESTAMP: {
+
126 PEFile* myPe = dynamic_cast<PEFile*>(this->m_Exe);
+
127 if (myPe && myPe->isReproBuild()) {
+
128 return "ReproChecksum";
+
129 }
+
130 return "TimeDateStamp";
+
131 }
+
132 case MAJOR_VER: return "MajorVersion";
+
133 case MINOR_VER: return "MinorVersion";
+
134 case NAME_RVA: return "Name";
+
135 case BASE: return "Base";
+
136 case FUNCTIONS_NUM: return "NumberOfFunctions";
+
137 case NAMES_NUM: return "NumberOfNames";
+
138 case FUNCTIONS_RVA: return "AddressOfFunctions";
+
139 case FUNC_NAMES_RVA: return "AddressOfNames";
+
140 case NAMES_ORDINALS_RVA: return "AddressOfNameOrdinals";
+
141 }
+
142 return getName();
+
143}
-
145
-
- -
147{
-
148 switch (fieldId) {
-
149 case NAME_RVA:
-
150 case FUNCTIONS_RVA:
-
151 case FUNC_NAMES_RVA:
- -
153 return Executable::RVA;
-
154 }
- -
156}
+
144
+
+ +
146{
+
147 switch (fieldId) {
+
148 case NAME_RVA:
+
149 case FUNCTIONS_RVA:
+
150 case FUNC_NAMES_RVA:
+ +
152 return Executable::RVA;
+
153 }
+ +
155}
-
157
-
- -
159{
-
160 bool isOk = false;
-
161 offset_t offset = this->getNumValue(NAME_RVA, &isOk);
-
162 if (!isOk) return NULL;
-
163
- -
165 if (aT == Executable::NOT_ADDR) return NULL;
-
166
-
167 char *ptr = (char*) m_Exe->getContentAt(offset, aT, 1);
-
168 if (!ptr) return NULL;
-
169
-
170 return ptr;
-
171}
+
156
+
+ +
158{
+
159 bool isOk = false;
+
160 offset_t offset = this->getNumValue(NAME_RVA, &isOk);
+
161 if (!isOk) return NULL;
+
162
+ +
164 if (aT == Executable::NOT_ADDR) return NULL;
+
165
+
166 char *ptr = (char*) m_Exe->getContentAt(offset, aT, 1);
+
167 if (!ptr) return NULL;
+
168
+
169 return ptr;
+
170}
-
172
-
- -
174{
-
175 char *name = this->_getLibraryName();
-
176 if (!name) return name;
-
177
-
178 if (pe_util::isStrLonger(name, 100)) {
-
179 return INVALID_NAME;
-
180 }
-
181 return QString(name);
-
182}
+
171
+
+ +
173{
+
174 char *name = this->_getLibraryName();
+
175 if (!name) return name;
+
176
+
177 if (pe_util::isStrLonger(name, 100)) {
+
178 return INVALID_NAME;
+
179 }
+
180 return QString(name);
+
181}
-
183
-
184//----------------------------------------------------------------------------------------------------
-
-
185void* ExportEntryWrapper::getFieldPtr(size_t fieldId, size_t subField)
-
186{
-
187 switch (fieldId) {
-
188 case FUNCTION_RVA: return getFuncRvaPtr();
-
189 case NAME_RVA: return getFuncNameRvaPtr();
-
190 }
-
191 return getPtr();
-
192}
+
182
+
183//----------------------------------------------------------------------------------------------------
+
+
184void* ExportEntryWrapper::getFieldPtr(size_t fieldId, size_t subField)
+
185{
+
186 switch (fieldId) {
+
187 case FUNCTION_RVA: return getFuncRvaPtr();
+
188 case NAME_RVA: return getFuncNameRvaPtr();
+
189 }
+
190 return getPtr();
+
191}
-
193
-
194DWORD* ExportEntryWrapper::getFuncRvaPtr()
-
195{
-
196 if (this->parentDir == NULL) return NULL;
-
197 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
-
198 if (exp == NULL) return NULL;
-
199
-
200 uint64_t funcRva = exp->AddressOfFunctions;
-
201 funcRva += (this->entryNum * sizeof(DWORD));
-
202
-
203 DWORD *ptr = (DWORD*) m_Exe->getContentAt(funcRva, Executable::RVA, sizeof(DWORD));
-
204 return ptr;
-
205}
-
206
-
- -
208{
-
209 if (this->parentDir == NULL || parentDir->exportDir() == NULL) {
-
210 return 0;
-
211 }
-
212 return sizeof(DWORD);
-
213}
+
192
+
193DWORD* ExportEntryWrapper::getFuncRvaPtr()
+
194{
+
195 if (this->parentDir == NULL) return NULL;
+
196 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
+
197 if (exp == NULL) return NULL;
+
198
+
199 uint64_t funcRva = exp->AddressOfFunctions;
+
200 funcRva += (this->entryNum * sizeof(DWORD));
+
201
+
202 DWORD *ptr = (DWORD*) m_Exe->getContentAt(funcRva, Executable::RVA, sizeof(DWORD));
+
203 return ptr;
+
204}
+
205
+
+ +
207{
+
208 if (this->parentDir == NULL || parentDir->exportDir() == NULL) {
+
209 return 0;
+
210 }
+
211 return sizeof(DWORD);
+
212}
-
214
-
- -
216{
-
217 if (getFuncName() == NULL) return true;
-
218 return false;
-
219}
+
213
+
+ +
215{
+
216 if (getFuncName() == NULL) return true;
+
217 return false;
+
218}
-
220
-
- -
222{
-
223 if (isByOrdinal()) {
-
224 uint32_t val = getOrdinal();
-
225 QString ordStr;
-
226 QTextStream(&ordStr) << "<ord: " << QString::number(val, 16) << ">";
-
227 return ordStr;
-
228 }
-
229 char* name = getFuncName();
-
230 if (name == NULL) return "";
-
231 return QString(name);
-
232}
+
219
+
+ +
221{
+
222 if (isByOrdinal()) {
+
223 uint32_t val = getOrdinal();
+
224 QString ordStr;
+
225 QTextStream(&ordStr) << "<ord: " << QString::number(val, 16) << ">";
+
226 return ordStr;
+
227 }
+
228 char* name = getFuncName();
+
229 if (name == NULL) return "";
+
230 return QString(name);
+
231}
-
233
-
-
234QString ExportEntryWrapper::getFieldName(size_t fieldId)
-
235{
-
236 switch (fieldId) {
-
237 case FUNCTION_RVA: return "FuncRva";
-
238 case NAME_RVA: return "FuncNameRva";
-
239 }
-
240 return "";
-
241}
+
232
+
+
233QString ExportEntryWrapper::getFieldName(size_t fieldId)
+
234{
+
235 switch (fieldId) {
+
236 case FUNCTION_RVA: return "FuncRva";
+
237 case NAME_RVA: return "FuncNameRva";
+
238 }
+
239 return "";
+
240}
-
242
-
- -
244{
-
245 DWORD *ptr = this->getFuncRvaPtr();
-
246 if (ptr == NULL) return INVALID_ADDR;
-
247 offset_t addr = static_cast<offset_t>(*ptr);
-
248 return addr;
-
249}
+
241
+
+ +
243{
+
244 DWORD *ptr = this->getFuncRvaPtr();
+
245 if (ptr == NULL) return INVALID_ADDR;
+
246 offset_t addr = static_cast<offset_t>(*ptr);
+
247 return addr;
+
248}
-
250
-
- -
252{
-
253 if (this->parentDir == NULL) return 0;
-
254 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
-
255 if (exp == NULL) return 0;
-
256
-
257 uint32_t ordinal = static_cast<uint32_t>(this->entryNum) + exp->Base;
-
258 return ordinal;
-
259}
+
249
+
+ +
251{
+
252 if (this->parentDir == NULL) return 0;
+
253 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
+
254 if (exp == NULL) return 0;
+
255
+
256 uint32_t ordinal = static_cast<uint32_t>(this->entryNum) + exp->Base;
+
257 return ordinal;
+
258}
-
260
-
261uint32_t ExportEntryWrapper::getFuncNameId()
-
262{
-
263 if (this->parentDir == NULL) return INVALID_ID;
-
264
-
265 WORD ord = static_cast<WORD>(this->entryNum);
-
266 std::map<WORD, DWORD>::iterator found = parentDir->ordToNameId.find(ord);
-
267 if (found == parentDir->ordToNameId.end()) {
-
268 return INVALID_ID;
-
269 }
-
270 return found->second;
-
271}
-
272
-
273void* ExportEntryWrapper::getFuncNameRvaPtr()
-
274{
-
275 uint32_t nameId = getFuncNameId();
-
276 if (nameId == INVALID_ID) return NULL;
-
277
-
278 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
-
279 if (exp == NULL) return NULL;
-
280
-
281 if (nameId >= exp->NumberOfNames) return NULL;
-
282
-
283 uint64_t nameAddrRVA = exp->AddressOfNames + (nameId * sizeof(DWORD));
-
284 DWORD* valuePtr = (DWORD*) this->m_Exe->getContentAt(nameAddrRVA, Executable::RVA, sizeof(DWORD));
-
285 return valuePtr;
-
286}
-
287
-
- -
289{
-
290 DWORD* valuePtr = (DWORD*) getFuncNameRvaPtr();
-
291 if (valuePtr == NULL) return INVALID_ADDR;
-
292 DWORD value = (*valuePtr);
-
293 return static_cast<offset_t>(value);
-
294}
+
259
+
260uint32_t ExportEntryWrapper::getFuncNameId()
+
261{
+
262 if (this->parentDir == NULL) return INVALID_ID;
+
263
+
264 WORD ord = static_cast<WORD>(this->entryNum);
+
265 std::map<WORD, DWORD>::iterator found = parentDir->ordToNameId.find(ord);
+
266 if (found == parentDir->ordToNameId.end()) {
+
267 return INVALID_ID;
+
268 }
+
269 return found->second;
+
270}
+
271
+
272void* ExportEntryWrapper::getFuncNameRvaPtr()
+
273{
+
274 uint32_t nameId = getFuncNameId();
+
275 if (nameId == INVALID_ID) return NULL;
+
276
+
277 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
+
278 if (exp == NULL) return NULL;
+
279
+
280 if (nameId >= exp->NumberOfNames) return NULL;
+
281
+
282 uint64_t nameAddrRVA = exp->AddressOfNames + (nameId * sizeof(DWORD));
+
283 DWORD* valuePtr = (DWORD*) this->m_Exe->getContentAt(nameAddrRVA, Executable::RVA, sizeof(DWORD));
+
284 return valuePtr;
+
285}
+
286
+
+ +
288{
+
289 DWORD* valuePtr = (DWORD*) getFuncNameRvaPtr();
+
290 if (valuePtr == NULL) return INVALID_ADDR;
+
291 DWORD value = (*valuePtr);
+
292 return static_cast<offset_t>(value);
+
293}
-
295
-
- -
297{
-
298 uint64_t funcRva = getFuncNameRva();
-
299 if (funcRva == INVALID_ADDR) return NULL;
-
300
-
301 char* name = (char*) this->m_Exe->getContentAt(funcRva, Executable::RVA, 1);
-
302 if (name == NULL) return NULL;
-
303 //TODO.... verify
-
304 return name;
-
305}
+
294
+
+ +
296{
+
297 uint64_t funcRva = getFuncNameRva();
+
298 if (funcRva == INVALID_ADDR) return NULL;
+
299
+
300 char* name = (char*) this->m_Exe->getContentAt(funcRva, Executable::RVA, 1);
+
301 if (name == NULL) return NULL;
+
302 //TODO.... verify
+
303 return name;
+
304}
-
306
-
- -
308{
-
309 if (this->parentDir == NULL) return NULL;
-
310 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
-
311 if (exp == NULL) return NULL;
-
312
-
313 DWORD* funcRvaPtr = (DWORD*) this->getFuncRvaPtr();
-
314 if (funcRvaPtr == NULL) return NULL;
-
315
-
316 char* strPtr = (char*) m_Exe->getContentAt( (*funcRvaPtr), Executable::RVA, 1);
-
317 if (strPtr == NULL) return NULL;
-
318
-
319 uint64_t offset = m_Exe->getOffset((BYTE*) strPtr);
-
320 if (offset == INVALID_ADDR) return NULL;
-
321
-
322 size_t maxLen = m_Exe->getRawSize() - offset;
-
323 size_t forwarderNameLen = pe_util::forwarderNameLen(strPtr, maxLen);
-
324 if (forwarderNameLen > 0) {
-
325 return strPtr;
-
326 }
-
327 return NULL;
-
328}
+
305
+
+ +
307{
+
308 if (this->parentDir == NULL) return NULL;
+
309 IMAGE_EXPORT_DIRECTORY* exp = parentDir->exportDir();
+
310 if (exp == NULL) return NULL;
+
311
+
312 DWORD* funcRvaPtr = (DWORD*) this->getFuncRvaPtr();
+
313 if (funcRvaPtr == NULL) return NULL;
+
314
+
315 char* strPtr = (char*) m_Exe->getContentAt( (*funcRvaPtr), Executable::RVA, 1);
+
316 if (strPtr == NULL) return NULL;
+
317
+
318 uint64_t offset = m_Exe->getOffset((BYTE*) strPtr);
+
319 if (offset == INVALID_ADDR) return NULL;
+
320
+
321 size_t maxLen = m_Exe->getRawSize() - offset;
+
322 size_t forwarderNameLen = pe_util::forwarderNameLen(strPtr, maxLen);
+
323 if (forwarderNameLen > 0) {
+
324 return strPtr;
+
325 }
+
326 return NULL;
+
327}
-
329
+
328
uint32_t bufsize_t
const offset_t INVALID_ADDR
uint64_t offset_t
@@ -482,7 +481,7 @@ $(function(){ initResizable(false); });
BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)
Definition Executable.h:57
virtual offset_t getRawSize() const
Definition Executable.h:54
-
virtual QString getLibraryName()
+
virtual QString getLibraryName()
@@ -497,30 +496,30 @@ $(function(){ initResizable(false); });
virtual void * getPtr()
std::map< WORD, DWORD > ordToNameId
-
virtual void * getFieldPtr(size_t fieldId, size_t subField)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField)
IMAGE_EXPORT_DIRECTORY * exportDir()
- -
virtual QString getName()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+ +
virtual QString getName()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual QString getFieldName(size_t fieldId)
-
virtual bufsize_t getSize()
+
virtual QString getFieldName(size_t fieldId)
+
virtual bufsize_t getSize()
friend class ExportEntryWrapper
- +
-
virtual QString getFieldName(size_t fieldId)
-
char * getFuncName()
-
uint32_t getOrdinal()
+
virtual QString getFieldName(size_t fieldId)
+
char * getFuncName()
+
uint32_t getOrdinal()
virtual void * getPtr()
-
bool isByOrdinal()
-
virtual bufsize_t getSize()
-
offset_t getFuncNameRva()
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
-
offset_t getFuncRva()
+
bool isByOrdinal()
+
virtual bufsize_t getSize()
+
offset_t getFuncNameRva()
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
offset_t getFuncRva()
@ FUNCTION_RVA
@ NAME_RVA
-
char * getForwarder()
-
virtual QString getName()
+
char * getForwarder()
+
virtual QString getName()
bool isReproBuild()
Definition PEFile.h:333
size_t forwarderNameLen(const char *ptr, size_t max_len)
Definition Util.cpp:113
diff --git a/_export_dir_wrapper_8h_source.html b/_export_dir_wrapper_8h_source.html index f2076bb3..5183c603 100644 --- a/_export_dir_wrapper_8h_source.html +++ b/_export_dir_wrapper_8h_source.html @@ -215,7 +215,7 @@ $(function(){ initResizable(false); }); -
virtual QString getLibraryName()
+
virtual QString getLibraryName()
virtual size_t getSubFieldsCount()
@@ -236,38 +236,38 @@ $(function(){ initResizable(false); });
ExportDirWrapper(PEFile *pe)
std::map< WORD, DWORD > ordToNameId
-
virtual void * getFieldPtr(size_t fieldId, size_t subField)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField)
IMAGE_EXPORT_DIRECTORY * exportDir()
- -
virtual QString getName()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+ +
virtual QString getName()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual QString getFieldName(size_t fieldId)
-
virtual bufsize_t getSize()
- +
virtual QString getFieldName(size_t fieldId)
+
virtual bufsize_t getSize()
+
-
virtual QString getFieldName(size_t fieldId)
+
virtual QString getFieldName(size_t fieldId)
virtual size_t getSubFieldsCount()
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
QString getForwarderStr()
ExportEntryWrapper(Executable *pe, ExportDirWrapper *parentDir, size_t entryNumber)
-
char * getFuncName()
-
uint32_t getOrdinal()
+
char * getFuncName()
+
uint32_t getOrdinal()
virtual void * getPtr()
-
bool isByOrdinal()
-
virtual bufsize_t getSize()
+
bool isByOrdinal()
+
virtual bufsize_t getSize()
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField)
-
offset_t getFuncNameRva()
+
offset_t getFuncNameRva()
QString getuncNameStr()
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
-
offset_t getFuncRva()
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
offset_t getFuncRva()
FieldID
@ FUNCTION_RVA
@ NONE
@ FIELD_COUNTER
@ NAME_RVA
-
char * getForwarder()
-
virtual QString getName()
+
char * getForwarder()
+
virtual QString getName()
virtual size_t getFieldsCount()
diff --git a/_import_base_dir_wrapper_8cpp_source.html b/_import_base_dir_wrapper_8cpp_source.html index ec80b984..26973f42 100644 --- a/_import_base_dir_wrapper_8cpp_source.html +++ b/_import_base_dir_wrapper_8cpp_source.html @@ -166,225 +166,224 @@ $(function(){ initResizable(false); });
63
64 for (size_t i = 0; i < entriesCount; i++) {
65 ImportBaseEntryWrapper* lib = dynamic_cast<ImportBaseEntryWrapper*> (this->getEntryAt(i));
-
66 if (lib == NULL) continue;
-
67 size_t libId = lib->entryNum;
-
68
-
69 size_t funcCount = lib->getEntriesCount();
-
70 for (size_t fI = 0; fI < funcCount; fI++) {
-
71 addMapping(lib->getEntryAt(fI));
-
72 }
-
73 }
-
74}
+
66 if (!lib) continue;
+
67
+
68 size_t funcCount = lib->getEntriesCount();
+
69 for (size_t fI = 0; fI < funcCount; fI++) {
+
70 addMapping(lib->getEntryAt(fI));
+
71 }
+
72 }
+
73}
-
75
-
- -
77{
-
78 std::map<offset_t, size_t>::iterator libItr = thunkToLibMap.find(thunk);
-
79 if (libItr == thunkToLibMap.end()) return NULL;
-
80
-
81 size_t libId = libItr->second;
-
82 ImportBaseEntryWrapper* lib = dynamic_cast<ImportBaseEntryWrapper*>(this->getEntryAt(libId));
-
83 return lib;
-
84}
+
74
+
+ +
76{
+
77 std::map<offset_t, size_t>::iterator libItr = thunkToLibMap.find(thunk);
+
78 if (libItr == thunkToLibMap.end()) return NULL;
+
79
+
80 size_t libId = libItr->second;
+
81 ImportBaseEntryWrapper* lib = dynamic_cast<ImportBaseEntryWrapper*>(this->getEntryAt(libId));
+
82 return lib;
+
83}
-
85
-
- -
87{
- -
89 if (!lib) return NULL;
-
90
-
91 std::map<offset_t, size_t>::iterator funcItr = lib->thunkToFuncMap.find(thunk);
-
92 if (funcItr == lib->thunkToFuncMap.end()) return NULL;
-
93
-
94 ImportBaseFuncWrapper* func = dynamic_cast<ImportBaseFuncWrapper*>(lib->getEntryAt(funcItr->second));
-
95 return func;
-
96}
+
84
+
+ +
86{
+ +
88 if (!lib) return NULL;
+
89
+
90 std::map<offset_t, size_t>::iterator funcItr = lib->thunkToFuncMap.find(thunk);
+
91 if (funcItr == lib->thunkToFuncMap.end()) return NULL;
+
92
+
93 ImportBaseFuncWrapper* func = dynamic_cast<ImportBaseFuncWrapper*>(lib->getEntryAt(funcItr->second));
+
94 return func;
+
95}
-
97
-
-
98QString ImportBaseDirWrapper::thunkToFuncName(offset_t thunk, bool shortName)
-
99{
- -
101 if (func == NULL) return "";
-
102 if (shortName) {
-
103 return func->getShortName();
-
104 }
-
105 return func->getName();
-
106}
+
96
+
+
97QString ImportBaseDirWrapper::thunkToFuncName(offset_t thunk, bool shortName)
+
98{
+ +
100 if (func == NULL) return "";
+
101 if (shortName) {
+
102 return func->getShortName();
+
103 }
+
104 return func->getName();
+
105}
-
107
-
- -
109{
- -
111 if (!lib) return "";
-
112 return lib->getName();
-
113}
+
106
+
+ +
108{
+ +
110 if (!lib) return "";
+
111 return lib->getName();
+
112}
-
114
-
- -
116{
-
117 clearMapping();
-
118 clear();
-
119
-
120 size_t oldCount = this->importsCount;
-
121 this->importsCount = 0;
-
122 this->invalidEntries = 0;
-
123
-
124 if (!getDataDirectory()) {
-
125 return (oldCount != this->importsCount); //has count changed
-
126 }
-
127
-
128 const size_t LIMIT = (-1);
-
129 const size_t INVALID_LIMIT = 100;
-
130 size_t cntr = 0;
-
131 size_t invalidSeries = 0;
-
132 for (cntr = 0; cntr < LIMIT; cntr++) {
-
133 if (loadNextEntry(cntr) == false) break;
-
134 ExeNodeWrapper* entry = this->entries.at(cntr);
-
135 if (!entry) break;
-
136 if (entry->isValid()) {
-
137 invalidSeries = 0;
-
138 }
-
139 else {
-
140 invalidSeries++;
-
141 this->invalidEntries++;
-
142 if (invalidSeries >= INVALID_LIMIT) break;
-
143 }
-
144 }
-
145
-
146 this->importsCount = cntr;
-
147 return (oldCount != this->importsCount); //has count changed
-
148}
+
113
+
+ +
115{
+
116 clearMapping();
+
117 clear();
+
118
+
119 size_t oldCount = this->importsCount;
+
120 this->importsCount = 0;
+
121 this->invalidEntries = 0;
+
122
+
123 if (!getDataDirectory()) {
+
124 return (oldCount != this->importsCount); //has count changed
+
125 }
+
126
+
127 const size_t LIMIT = (-1);
+
128 const size_t INVALID_LIMIT = 100;
+
129 size_t cntr = 0;
+
130 size_t invalidSeries = 0;
+
131 for (cntr = 0; cntr < LIMIT; cntr++) {
+
132 if (loadNextEntry(cntr) == false) break;
+
133 ExeNodeWrapper* entry = this->entries.at(cntr);
+
134 if (!entry) break;
+
135 if (entry->isValid()) {
+
136 invalidSeries = 0;
+
137 }
+
138 else {
+
139 invalidSeries++;
+
140 this->invalidEntries++;
+
141 if (invalidSeries >= INVALID_LIMIT) break;
+
142 }
+
143 }
+
144
+
145 this->importsCount = cntr;
+
146 return (oldCount != this->importsCount); //has count changed
+
147}
-
149
-
- -
151{
-
152 if (this->invalidEntries > 0) return false;
-
153
-
154 const QList<offset_t> thunks = getThunksList();
-
155 if (!thunks.size()) return false;
-
156 return true;
-
157}
+
148
+
+ +
150{
+
151 if (this->invalidEntries > 0) return false;
+
152
+
153 const QList<offset_t> thunks = getThunksList();
+
154 if (!thunks.size()) return false;
+
155 return true;
+
156}
-
158
-
159//--------------------------------------------------------------------------------------------------------------
-
160
-
- -
162{
-
163 if (this->invalidEntries > 0) return false;
-
164 char *libName = this->getLibraryName();
-
165 if (!imports_util::isNameValid(m_Exe, libName)) return false;
-
166 return true;
-
167}
+
157
+
158//--------------------------------------------------------------------------------------------------------------
+
159
+
+ +
161{
+
162 if (this->invalidEntries > 0) return false;
+
163 char *libName = this->getLibraryName();
+
164 if (!imports_util::isNameValid(m_Exe, libName)) return false;
+
165 return true;
+
166}
-
168
-
- -
170{
-
171 clear();
-
172 thunkToFuncMap.clear();
-
173
-
174 this->invalidEntries = 0;
-
175
-
176 const size_t LIMIT = (-1);
-
177 const size_t INVALID_LIMIT = 100;
-
178 if (!isValid()) {
-
179 return false;
-
180 }
-
181
-
182 if (this->getPtr() == NULL) {
-
183 return false;
-
184 }
-
185
-
186 size_t cntr = 0;
-
187 size_t invalidSeries = 0;
-
188 for (cntr = 0; cntr < LIMIT; cntr++) {
-
189 if (loadNextEntry(cntr) == false) break;
-
190 ExeNodeWrapper* entry = this->entries.at(cntr);
-
191 if (!entry) break;
-
192 if (entry->isValid()) {
-
193 invalidSeries = 0;
-
194 }
-
195 else {
-
196 invalidSeries++;
-
197 this->invalidEntries++;
-
198 if (invalidSeries >= INVALID_LIMIT) break;
-
199 }
-
200 }
-
201 //printf("Entries: %d\n", entries.size());
-
202 return true;
-
203}
+
167
+
+ +
169{
+
170 clear();
+
171 thunkToFuncMap.clear();
+
172
+
173 this->invalidEntries = 0;
+
174
+
175 const size_t LIMIT = (-1);
+
176 const size_t INVALID_LIMIT = 100;
+
177 if (!isValid()) {
+
178 return false;
+
179 }
+
180
+
181 if (this->getPtr() == NULL) {
+
182 return false;
+
183 }
+
184
+
185 size_t cntr = 0;
+
186 size_t invalidSeries = 0;
+
187 for (cntr = 0; cntr < LIMIT; cntr++) {
+
188 if (loadNextEntry(cntr) == false) break;
+
189 ExeNodeWrapper* entry = this->entries.at(cntr);
+
190 if (!entry) break;
+
191 if (entry->isValid()) {
+
192 invalidSeries = 0;
+
193 }
+
194 else {
+
195 invalidSeries++;
+
196 this->invalidEntries++;
+
197 if (invalidSeries >= INVALID_LIMIT) break;
+
198 }
+
199 }
+
200 //printf("Entries: %d\n", entries.size());
+
201 return true;
+
202}
-
204
-
205//--------------------------------------------------------------------------------------------------------------
-
- -
207{
-
208 QString functionName;
-
209 if (isByOrdinal()) {
-
210 uint64_t val = getOrdinal();
-
211 QString out;
-
212#if QT_VERSION >= 0x050000
-
213 out = QString::asprintf("<ord: %llX>", static_cast<unsigned long long>(val));
-
214#else
-
215 out.sprintf("<ord: %llX>", static_cast<unsigned long long>(val));
-
216#endif
-
217 functionName = out;
-
218 } else {
-
219 char *fName = this->getFunctionName();
-
220 if (!fName) return "";
-
221 functionName = fName;
-
222 }
-
223 return functionName;
-
224}
+
203
+
204//--------------------------------------------------------------------------------------------------------------
+
+ +
206{
+
207 QString functionName;
+
208 if (isByOrdinal()) {
+
209 uint64_t val = getOrdinal();
+
210 QString out;
+
211#if QT_VERSION >= 0x050000
+
212 out = QString::asprintf("<ord: %llX>", static_cast<unsigned long long>(val));
+
213#else
+
214 out.sprintf("<ord: %llX>", static_cast<unsigned long long>(val));
+
215#endif
+
216 functionName = out;
+
217 } else {
+
218 char *fName = this->getFunctionName();
+
219 if (!fName) return "";
+
220 functionName = fName;
+
221 }
+
222 return functionName;
+
223}
-
225
-
- -
227{
- -
229 if (!p) return "";
-
230
-
231 char *libName = p->getLibraryName();
-
232 if (!libName) return "";
-
233
-
234 return QString(libName);
-
235}
+
224
+
+ +
226{
+ +
228 if (!p) return "";
+
229
+
230 char *libName = p->getLibraryName();
+
231 if (!libName) return "";
+
232
+
233 return QString(libName);
+
234}
-
236
-
- -
238{
-
239 QString libName = getLibName();
-
240 QString functionName = getShortName();
-
241
-
242 if (!libName.length()) return functionName;
-
243
-
244 return "[" + QString(libName) + "]." + functionName;
-
245}
+
235
+
+ +
237{
+
238 QString libName = getLibName();
+
239 QString functionName = getShortName();
+
240
+
241 if (!libName.length()) return functionName;
+
242
+
243 return "[" + QString(libName) + "]." + functionName;
+
244}
-
246
-
- -
248{
- -
250 if (!p) return false;
-
251
-
252 char *libName = p->getLibraryName();
-
253 if (!imports_util::isNameValid(m_Exe, libName)) return false;
-
254
-
255 if (!isByOrdinal()) {
-
256 char *fName = this->getFunctionName();
-
257 if (!imports_util::isNameValid(m_Exe, libName)) return false;
-
258 }
-
259 return true;
-
260}
+
245
+
+ +
247{
+ +
249 if (!p) return false;
+
250
+
251 char *libName = p->getLibraryName();
+
252 if (!imports_util::isNameValid(m_Exe, libName)) return false;
+
253
+
254 if (!isByOrdinal()) {
+
255 char *fName = this->getFunctionName();
+
256 if (!imports_util::isNameValid(m_Exe, fName)) return false;
+
257 }
+
258 return true;
+
259}
uint32_t bufsize_t
const offset_t INVALID_ADDR
@@ -402,42 +401,41 @@ $(function(){ initResizable(false); });
virtual bool loadNextEntry(size_t entryNum)
virtual bool isValid()
virtual size_t getEntriesCount()
-
virtual void clear()
static bufsize_t thunkSize(Executable::exe_bits bits)
-
ImportBaseEntryWrapper * thunkToLib(offset_t thunk)
+
ImportBaseEntryWrapper * thunkToLib(offset_t thunk)
QList< offset_t > thunksList
std::map< offset_t, size_t > thunkToLibMap
- +
QList< offset_t > getThunksList()
- + -
QString thunkToLibName(offset_t thunk)
-
ImportBaseFuncWrapper * thunkToFunction(offset_t thunk)
+
QString thunkToLibName(offset_t thunk)
+
ImportBaseFuncWrapper * thunkToFunction(offset_t thunk)
void addMapping(ExeNodeWrapper *func)
-
QString thunkToFuncName(offset_t thunk, bool shortName=true)
+
QString thunkToFuncName(offset_t thunk, bool shortName=true)
size_t invalidEntries
static bufsize_t NameLenLimit
-
bool wrap()
-
virtual bool isValid()
+
bool wrap()
+
virtual bool isValid()
virtual char * getLibraryName()=0
std::map< offset_t, size_t > thunkToFuncMap
- - + +
virtual uint64_t getOrdinal()=0
virtual char * getFunctionName()=0
virtual offset_t callVia()=0
- - + +
virtual bool isByOrdinal()=0
virtual PENodeWrapper * getParentNode()
diff --git a/_import_base_dir_wrapper_8h_source.html b/_import_base_dir_wrapper_8h_source.html index 73aaba44..1335d2b6 100644 --- a/_import_base_dir_wrapper_8h_source.html +++ b/_import_base_dir_wrapper_8h_source.html @@ -246,7 +246,7 @@ $(function(){ initResizable(false); });
static bufsize_t thunkSize(Executable::exe_bits bits)
-
ImportBaseEntryWrapper * thunkToLib(offset_t thunk)
+
ImportBaseEntryWrapper * thunkToLib(offset_t thunk)
QList< offset_t > thunksList
virtual QString getFieldName(size_t fieldId, size_t subField)
bool hasThunk(offset_t thunk)
@@ -254,16 +254,16 @@ $(function(){ initResizable(false); });
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
- +
QList< offset_t > getThunksList()
- + -
QString thunkToLibName(offset_t thunk)
-
ImportBaseFuncWrapper * thunkToFunction(offset_t thunk)
+
QString thunkToLibName(offset_t thunk)
+
ImportBaseFuncWrapper * thunkToFunction(offset_t thunk)
virtual QString getFieldName(size_t fieldId)
void addMapping(ExeNodeWrapper *func)
-
QString thunkToFuncName(offset_t thunk, bool shortName=true)
+
QString thunkToFuncName(offset_t thunk, bool shortName=true)
ImportBaseDirWrapper(PEFile *pe, pe::dir_entry v_entryType)
virtual size_t getFieldsCount()
virtual void * getFieldPtr(size_t fieldId, size_t subField)
@@ -272,22 +272,22 @@ $(function(){ initResizable(false); });
ImportBaseDirWrapper * impDir
virtual size_t getSubFieldsCount()
static bufsize_t NameLenLimit
-
bool wrap()
+
bool wrap()
void addMapping(ExeNodeWrapper *func)
-
virtual bool isValid()
+
virtual bool isValid()
ImportBaseEntryWrapper(PEFile *pe, ImportBaseDirWrapper *importsDir, size_t entryNumber)
virtual char * getLibraryName()=0
std::map< offset_t, size_t > thunkToFuncMap
- - + +
virtual uint64_t getOrdinal()=0
virtual char * getFunctionName()=0
virtual offset_t callVia()=0
- - + +
virtual bool isByOrdinal()=0
ImportBaseFuncWrapper(PEFile *pe, ImportBaseEntryWrapper *parentLib, size_t entryNumber)
diff --git a/_import_dir_wrapper_8cpp_source.html b/_import_dir_wrapper_8cpp_source.html index fc62046b..b4a4d870 100644 --- a/_import_dir_wrapper_8cpp_source.html +++ b/_import_dir_wrapper_8cpp_source.html @@ -192,322 +192,316 @@ $(function(){ initResizable(false); });
89{
-
90 bool isOk = false;
-
91
- - -
94 if (!p) return false;
-
95
-
96 if (isBit64()) {
-
97 uint64_t* ptr = (uint64_t*) p;
-
98 if ((*ptr) & ORDINAL_FLAG64) return true;
-
99
-
100 } else {
-
101 uint32_t* ptr = (uint32_t*) p;
-
102 if ((*ptr) & ORDINAL_FLAG32) return true;
-
103 }
-
104 return false;
-
105}
+ + +
92 if (!p) return false;
+
93
+
94 if (isBit64()) {
+
95 uint64_t* ptr = (uint64_t*) p;
+
96 if ((*ptr) & ORDINAL_FLAG64) return true;
+
97
+
98 } else {
+
99 uint32_t* ptr = (uint32_t*) p;
+
100 if ((*ptr) & ORDINAL_FLAG32) return true;
+
101 }
+
102 return false;
+
103}
-
106
-
107
-
- -
109{
-
110 if (isByOrdinal()) return NULL;
-
111
-
112 IMAGE_IMPORT_BY_NAME* dataPtr = this->getImportByNamePtr();
-
113 if (!dataPtr) return NULL;
-
114 char *name = (char*) dataPtr->Name;
-
115 return name;
-
116}
+
104
+
105
+
+ +
107{
+
108 if (isByOrdinal()) return NULL;
+
109
+
110 IMAGE_IMPORT_BY_NAME* dataPtr = this->getImportByNamePtr();
+
111 if (!dataPtr) return NULL;
+
112 char *name = (char*) dataPtr->Name;
+
113 return name;
+
114}
-
117
-
- -
119{
-
120 return getAddrSize();
-
121}
+
115
+
+ +
117{
+
118 return getAddrSize();
+
119}
-
122
-
-
123void* ImportedFuncWrapper::getFieldPtr(size_t fId, size_t subField)
-
124{
-
125 bool is64 = isBit64();
-
126 void *entryPtr = this->getPtr();
-
127 if (entryPtr == NULL) return NULL;
-
128
-
129 IMAGE_THUNK_DATA32* en32 = is64 ? NULL : (IMAGE_THUNK_DATA32*) entryPtr;
-
130 IMAGE_THUNK_DATA64* en64 = is64 ? (IMAGE_THUNK_DATA64*) entryPtr : NULL;
-
131
-
132 switch (fId) {
- - - -
136 case HINT :
-
137 {
-
138 if (isByOrdinal()) return NULL;
-
139 IMAGE_IMPORT_BY_NAME* dataPtr = this->getImportByNamePtr();
-
140 return (void*) &dataPtr->Hint;
-
141 }
-
142 };
-
143 return entryPtr;
-
144}
+
120
+
+
121void* ImportedFuncWrapper::getFieldPtr(size_t fId, size_t subField)
+
122{
+
123 void *entryPtr = this->getPtr();
+
124 if (entryPtr == NULL) return NULL;
+
125
+
126 switch (fId) {
+ + + +
130 case HINT :
+
131 {
+
132 if (isByOrdinal()) return NULL;
+
133 IMAGE_IMPORT_BY_NAME* dataPtr = this->getImportByNamePtr();
+
134 return (void*) &dataPtr->Hint;
+
135 }
+
136 };
+
137 return entryPtr;
+
138}
-
145
-
-
146bufsize_t ImportedFuncWrapper::getFieldSize(size_t fieldId, size_t subField)
-
147{
-
148 if (fieldId == HINT) return sizeof (WORD);
-
149 bufsize_t entrySize = (isBit64()) ? sizeof(uint64_t) : sizeof(uint32_t);
-
150 return entrySize;
-
151}
+
139
+
+
140bufsize_t ImportedFuncWrapper::getFieldSize(size_t fieldId, size_t subField)
+
141{
+
142 if (fieldId == HINT) return sizeof (WORD);
+
143 bufsize_t entrySize = (isBit64()) ? sizeof(uint64_t) : sizeof(uint32_t);
+
144 return entrySize;
+
145}
-
152
-
- -
154{
-
155 switch (fId) {
-
156 case ORIG_THUNK: return "Original Thunk";
-
157 case THUNK: return "Thunk";
-
158 case FORWARDER: return "Forwarder";
-
159 case HINT : return "Hint";
-
160 };
-
161 return "";
-
162}
+
146
+
+ +
148{
+
149 switch (fId) {
+
150 case ORIG_THUNK: return "Original Thunk";
+
151 case THUNK: return "Thunk";
+
152 case FORWARDER: return "Forwarder";
+
153 case HINT : return "Hint";
+
154 };
+
155 return "";
+
156}
-
163
-
- -
165{
-
166 if (this->isByOrdinal()) {
- -
168 }
-
169 switch (fId) {
-
170 case ORIG_THUNK:
-
171 case THUNK:
-
172 return Executable::RVA;
-
173 }
- -
175}
+
157
+
+ +
159{
+
160 if (this->isByOrdinal()) {
+ +
162 }
+
163 switch (fId) {
+
164 case ORIG_THUNK:
+
165 case THUNK:
+
166 return Executable::RVA;
+
167 }
+ +
169}
-
176//-------------------------------------------------------------------------------
+
170//-------------------------------------------------------------------------------
+
171
+
172
+
+ +
174 {
+ +
176 offset_t thunk = func->getThunkValue();
177
-
178
-
- -
180 {
- -
182 offset_t thunk = func->getThunkValue();
-
183
-
184 if (thunk == 0 || thunk == INVALID_ADDR) {
-
185 delete func;
-
186 func = NULL;
-
187 return false;
-
188 } else {
-
189 entries.push_back(func);
-
190 addMapping(func);
-
191 }
-
192 return true;
-
193 }
+
178 if (thunk == 0 || thunk == INVALID_ADDR) {
+
179 delete func;
+
180 func = NULL;
+
181 return false;
+
182 } else {
+
183 entries.push_back(func);
+
184 addMapping(func);
+
185 }
+
186 return true;
+
187 }
-
194
-
195
-
- -
197{
-
198 if (m_PE == NULL) return NULL;
-
199 IMAGE_DATA_DIRECTORY *d = m_PE->getDataDirectory();
-
200 if (!d) return NULL;
-
201
-
202 offset_t importRva = static_cast<offset_t>(d[pe::DIR_IMPORT].VirtualAddress);
-
203 if (importRva == 0) return NULL;
-
204
-
205 offset_t descAddr = this->m_PE->toRaw(importRva, Executable::RVA);
-
206 if (descAddr == INVALID_ADDR) {
-
207 return NULL; // address invalid
-
208 }
-
209 BYTE *dirPtr = this->m_PE->getContentAt(descAddr, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
-
210 if (dirPtr == NULL) return NULL; // address invalid
-
211
-
212 offset_t entryOffset = descAddr + (this->entryNum * sizeof(IMAGE_IMPORT_DESCRIPTOR));
-
213
-
214 BYTE *content = this->m_PE->getContentAt(entryOffset, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
-
215 if (!content) return NULL;
-
216 return (void*) content;
-
217}
+
188
+
189
+
+ +
191{
+
192 if (m_PE == NULL) return NULL;
+
193 IMAGE_DATA_DIRECTORY *d = m_PE->getDataDirectory();
+
194 if (!d) return NULL;
+
195
+
196 offset_t importRva = static_cast<offset_t>(d[pe::DIR_IMPORT].VirtualAddress);
+
197 if (importRva == 0) return NULL;
+
198
+
199 offset_t descAddr = this->m_PE->toRaw(importRva, Executable::RVA);
+
200 if (descAddr == INVALID_ADDR) {
+
201 return NULL; // address invalid
+
202 }
+
203 BYTE *dirPtr = this->m_PE->getContentAt(descAddr, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
+
204 if (dirPtr == NULL) return NULL; // address invalid
+
205
+
206 offset_t entryOffset = descAddr + (this->entryNum * sizeof(IMAGE_IMPORT_DESCRIPTOR));
+
207
+
208 BYTE *content = this->m_PE->getContentAt(entryOffset, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
+
209 if (!content) return NULL;
+
210 return (void*) content;
+
211}
-
218
-
- -
220{
-
221 return sizeof(IMAGE_IMPORT_DESCRIPTOR);
-
222}
+
212
+
+ +
214{
+
215 return sizeof(IMAGE_IMPORT_DESCRIPTOR);
+
216}
-
223
-
- -
225{
-
226 char *name = getLibraryName();
-
227 if (!name) return "";
-
228 return name;
-
229}
+
217
+
+ +
219{
+
220 char *name = getLibraryName();
+
221 if (!name) return "";
+
222 return name;
+
223}
+
224
+
+ +
226{
+
227 void *ptr = this->getPtr();
+
228 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) ptr;
+
229 if (!desc) return false;
230
-
- -
232{
-
233 void *ptr = this->getPtr();
-
234 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) ptr;
-
235 if (!desc) return false;
-
236
-
237 if (desc->TimeDateStamp == (-1)) return true;
-
238 return false;
-
239}
+
231 if (desc->TimeDateStamp == (-1)) return true;
+
232 return false;
+
233}
+
234
+
+
235void* ImportEntryWrapper::getFieldPtr(size_t fId, size_t subField)
+
236{
+
237 void *ptr = this->getPtr();
+
238 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) ptr;
+
239 if (!desc) return NULL;
240
-
-
241void* ImportEntryWrapper::getFieldPtr(size_t fId, size_t subField)
-
242{
-
243 void *ptr = this->getPtr();
-
244 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) ptr;
-
245 if (!desc) return NULL;
-
246
-
247 switch (fId) {
-
248 case ORIG_FIRST_THUNK: return (void*) &desc->OriginalFirstThunk;
-
249 case TIMESTAMP: return (void*) &desc->TimeDateStamp;
-
250 case FORWARDER: return (void*) &desc->ForwarderChain;
-
251 case NAME: return (void*) &desc->Name;
-
252 case FIRST_THUNK: return (void*) &desc->FirstThunk;
-
253 }
-
254 return desc;
-
255}
+
241 switch (fId) {
+
242 case ORIG_FIRST_THUNK: return (void*) &desc->OriginalFirstThunk;
+
243 case TIMESTAMP: return (void*) &desc->TimeDateStamp;
+
244 case FORWARDER: return (void*) &desc->ForwarderChain;
+
245 case NAME: return (void*) &desc->Name;
+
246 case FIRST_THUNK: return (void*) &desc->FirstThunk;
+
247 }
+
248 return desc;
+
249}
-
256
-
- -
258{
-
259 switch (fId) {
-
260 case ORIG_FIRST_THUNK: return "OriginalFirstThunk";
-
261 case TIMESTAMP: return "TimeDateStamp";
-
262 case FORWARDER: return "Forwarder";
-
263 case NAME: return "NameRVA";
-
264 case FIRST_THUNK: return "FirstThunk";
-
265 }
-
266 return this->getName();
-
267}
+
250
+
+ +
252{
+
253 switch (fId) {
+
254 case ORIG_FIRST_THUNK: return "OriginalFirstThunk";
+
255 case TIMESTAMP: return "TimeDateStamp";
+
256 case FORWARDER: return "Forwarder";
+
257 case NAME: return "NameRVA";
+
258 case FIRST_THUNK: return "FirstThunk";
+
259 }
+
260 return this->getName();
+
261}
-
268
-
- -
270{
-
271 switch (fId) {
-
272 case ORIG_FIRST_THUNK:
-
273 case NAME:
-
274 case FIRST_THUNK:
-
275 return Executable::RVA;
-
276 }
- -
278}
+
262
+
+ +
264{
+
265 switch (fId) {
+
266 case ORIG_FIRST_THUNK:
+
267 case NAME:
+
268 case FIRST_THUNK:
+
269 return Executable::RVA;
+
270 }
+ +
272}
-
279
-
- -
281{
-
282 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) getPtr();
-
283 if (!desc) {
-
284 return NULL;
-
285 }
-
286
-
287 offset_t nameRVA = desc->Name;
-
288 offset_t nAddr = m_Exe->toRaw(nameRVA, Executable::RVA);
-
289 if (nAddr == INVALID_ADDR) return NULL;
-
290
-
291 //TODO: reimplement it:
-
292 char *name = (char*) m_Exe->getContentAt(nAddr, sizeof(char));
-
293 offset_t peSize = m_Exe->getRawSize();
-
294
-
295 bufsize_t upperLimit = m_Exe->getMaxSizeFromPtr((BYTE*) name);
- -
297 size_t limit = (size_t) upperLimit < HARD_LIMIT ? upperLimit : HARD_LIMIT;
-
298
-
299 if (pe_util::isStrLonger(name, limit)) {
-
300 if (upperLimit < HARD_LIMIT) {
-
301 return name; // Name at the end of File. FileBuffer secures it with appended \0
-
302 }
-
303 return NULL;
-
304 }
-
305 return name;
-
306}
+
273
+
+ +
275{
+
276 IMAGE_IMPORT_DESCRIPTOR* desc = (IMAGE_IMPORT_DESCRIPTOR*) getPtr();
+
277 if (!desc) {
+
278 return NULL;
+
279 }
+
280
+
281 offset_t nameRVA = desc->Name;
+
282 offset_t nAddr = m_Exe->toRaw(nameRVA, Executable::RVA);
+
283 if (nAddr == INVALID_ADDR) return NULL;
+
284
+
285 //TODO: reimplement it:
+
286 char *name = (char*) m_Exe->getContentAt(nAddr, sizeof(char));
+
287 offset_t peSize = m_Exe->getRawSize();
+
288
+
289 bufsize_t upperLimit = m_Exe->getMaxSizeFromPtr((BYTE*) name);
+ +
291 size_t limit = (size_t) upperLimit < HARD_LIMIT ? upperLimit : HARD_LIMIT;
+
292
+
293 if (pe_util::isStrLonger(name, limit)) {
+
294 if (upperLimit < HARD_LIMIT) {
+
295 return name; // Name at the end of File. FileBuffer secures it with appended \0
+
296 }
+
297 return NULL;
+
298 }
+
299 return name;
+
300}
-
307
-
308//---------------------------------
-
309
-
- -
311{
-
312 PEFile *pe = dynamic_cast<PEFile*> (this->m_Exe);
-
313 if (pe == NULL) return NULL;
-
314
-
315 IMAGE_DATA_DIRECTORY *d = pe->getDataDirectory();
-
316 return d;
-
317}
+
301
+
302//---------------------------------
+
303
+
+ +
305{
+
306 PEFile *pe = dynamic_cast<PEFile*> (this->m_Exe);
+
307 if (pe == NULL) return NULL;
+
308
+
309 IMAGE_DATA_DIRECTORY *d = pe->getDataDirectory();
+
310 return d;
+
311}
-
318
-
-
319IMAGE_IMPORT_DESCRIPTOR* ImportDirWrapper::firstDescriptor()
-
320{
-
321 IMAGE_DATA_DIRECTORY *d = getDataDirectory();
-
322 if (!d) return NULL;
+
312
+
+
313IMAGE_IMPORT_DESCRIPTOR* ImportDirWrapper::firstDescriptor()
+
314{
+
315 IMAGE_DATA_DIRECTORY *d = getDataDirectory();
+
316 if (!d) return NULL;
+
317
+
318 uint32_t importRva = d[pe::DIR_IMPORT].VirtualAddress;
+
319 if (importRva == 0) return NULL;
+
320
+
321 offset_t descAddr = this->m_Exe->toRaw(importRva, Executable::RVA);
+
322 if (descAddr == INVALID_ADDR) return NULL; // address invalid
323
-
324 uint32_t importRva = d[pe::DIR_IMPORT].VirtualAddress;
-
325 if (importRva == 0) return NULL;
-
326
-
327 offset_t descAddr = this->m_Exe->toRaw(importRva, Executable::RVA);
-
328 if (descAddr == INVALID_ADDR) return NULL; // address invalid
-
329
-
330 BYTE *dirPtr = this->m_Exe->getContentAt(descAddr, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
-
331 if (dirPtr == NULL) return NULL; // address invalid
-
332 return (IMAGE_IMPORT_DESCRIPTOR*) dirPtr;
-
333}
+
324 BYTE *dirPtr = this->m_Exe->getContentAt(descAddr, Executable::RAW, sizeof(IMAGE_IMPORT_DESCRIPTOR));
+
325 if (dirPtr == NULL) return NULL; // address invalid
+
326 return (IMAGE_IMPORT_DESCRIPTOR*) dirPtr;
+
327}
-
334
-
- -
336{
-
337 ImportEntryWrapper* imp = new ImportEntryWrapper(m_PE, this, cntr);
-
338 if (!imp || !imp->getPtr()) {
+
328
+
+ +
330{
+
331 ImportEntryWrapper* imp = new ImportEntryWrapper(m_PE, this, cntr);
+
332 if (!imp || !imp->getPtr()) {
+
333 delete imp;
+
334 return false;
+
335 }
+
336 bool isOk = false;
+
337 uint64_t thunk = imp->getNumValue(ImportEntryWrapper::FIRST_THUNK, &isOk);
+
338 if (!isOk) {
339 delete imp;
340 return false;
341 }
-
342 bool isOk = false;
-
343 uint64_t thunk = imp->getNumValue(ImportEntryWrapper::FIRST_THUNK, &isOk);
-
344 if (!isOk) {
-
345 delete imp;
-
346 return false;
-
347 }
-
348 uint64_t oThunk = imp->getNumValue(ImportEntryWrapper::ORIG_FIRST_THUNK, &isOk);
-
349 if (!isOk) {
-
350 delete imp;
-
351 return false;
-
352 }
-
353 if (!thunk && !oThunk) {
-
354 delete imp;
-
355 return false;
-
356 }
-
357 entries.push_back(imp);
-
358 return true;
+
342 uint64_t oThunk = imp->getNumValue(ImportEntryWrapper::ORIG_FIRST_THUNK, &isOk);
+
343 if (!isOk) {
+
344 delete imp;
+
345 return false;
+
346 }
+
347 if (!thunk && !oThunk) {
+
348 delete imp;
+
349 return false;
+
350 }
+
351 entries.push_back(imp);
+
352 return true;
+
353}
+
+
354
+
+ +
356{
+
357 size_t fields = getFieldsCount() + 1; //fields + terminating field
+
358 return static_cast<bufsize_t>(fields) * sizeof(IMAGE_IMPORT_DESCRIPTOR);
359}
360
-
- -
362{
-
363 size_t fields = getFieldsCount() + 1; //fields + terminating field
-
364 return static_cast<bufsize_t>(fields) * sizeof(IMAGE_IMPORT_DESCRIPTOR);
-
365}
-
-
366
uint32_t bufsize_t
const offset_t INVALID_ADDR
uint64_t offset_t
@@ -535,44 +529,44 @@ $(function(){ initResizable(false); });
void addMapping(ExeNodeWrapper *func)
-
IMAGE_DATA_DIRECTORY * getDataDirectory()
-
virtual bufsize_t getSize()
-
virtual bool loadNextEntry(size_t cntr)
-
IMAGE_IMPORT_DESCRIPTOR * firstDescriptor()
+
IMAGE_DATA_DIRECTORY * getDataDirectory()
+
virtual bufsize_t getSize()
+
virtual bool loadNextEntry(size_t cntr)
+
IMAGE_IMPORT_DESCRIPTOR * firstDescriptor()
friend class ImportEntryWrapper
-
bool isBound()
+
bool isBound()
FieldID
@ FIRST_THUNK
@ FORWARDER
@ ORIG_FIRST_THUNK
@ NAME
@ TIMESTAMP
-
virtual QString getName()
-
char * getLibraryName()
-
virtual QString getFieldName(size_t fieldId)
-
bool loadNextEntry(size_t entryNum)
-
virtual void * getPtr()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual bufsize_t getSize()
+
virtual QString getName()
+
char * getLibraryName()
+
virtual QString getFieldName(size_t fieldId)
+
bool loadNextEntry(size_t entryNum)
+
virtual void * getPtr()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual bufsize_t getSize()
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual void * getPtr()
-
virtual bufsize_t getSize()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual bufsize_t getSize()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual QString getFieldName(size_t fieldId)
- +
virtual QString getFieldName(size_t fieldId)
+
void * getValuePtr(ImportEntryWrapper::FieldID fId)
offset_t getFieldRVA(ImportEntryWrapper::FieldID fId)
virtual IMAGE_IMPORT_BY_NAME * getImportByNamePtr()
-
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
IMAGE_DATA_DIRECTORY * getDataDirectory()
Definition PEFile.cpp:292
diff --git a/_import_dir_wrapper_8h_source.html b/_import_dir_wrapper_8h_source.html index 25d4b386..64fa6e2e 100644 --- a/_import_dir_wrapper_8h_source.html +++ b/_import_dir_wrapper_8h_source.html @@ -287,20 +287,20 @@ $(function(){ initResizable(false); });
virtual offset_t convertAddr(offset_t inAddr, Executable::addr_type inType, Executable::addr_type outType)
static bufsize_t thunkSize(Executable::exe_bits bits)
- +
-
bool wrap()
+
bool wrap()
ImportDirWrapper(PEFile *pe)
-
IMAGE_DATA_DIRECTORY * getDataDirectory()
+
IMAGE_DATA_DIRECTORY * getDataDirectory()
virtual void * getPtr()
virtual QString getName()
-
virtual bufsize_t getSize()
-
virtual bool loadNextEntry(size_t cntr)
-
IMAGE_IMPORT_DESCRIPTOR * firstDescriptor()
+
virtual bufsize_t getSize()
+
virtual bool loadNextEntry(size_t cntr)
+
IMAGE_IMPORT_DESCRIPTOR * firstDescriptor()
-
bool isBound()
+
bool isBound()
FieldID
@ FIRST_THUNK
@ FORWARDER
@@ -309,21 +309,21 @@ $(function(){ initResizable(false); });
@ NAME
@ TIMESTAMP
@ FIELD_COUNTER
-
virtual QString getName()
+
virtual QString getName()
bufsize_t geEntrySize()
-
char * getLibraryName()
-
virtual QString getFieldName(size_t fieldId)
+
char * getLibraryName()
+
virtual QString getFieldName(size_t fieldId)
ImportEntryWrapper(PEFile *pe, ImportDirWrapper *importsDir, size_t entryNumber)
-
bool loadNextEntry(size_t entryNum)
+
bool loadNextEntry(size_t entryNum)
virtual size_t getFieldsCount()
-
virtual void * getPtr()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual void * getPtr()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual offset_t getNextEntryOffset()
-
virtual bufsize_t getSize()
+
virtual bufsize_t getSize()
virtual uint64_t getOrdinal()
-
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
ImportedFuncWrapper(PEFile *pe, ImportEntryWrapper *parentLib, size_t entryNumber)
virtual void * getPtr()
@@ -333,19 +333,19 @@ $(function(){ initResizable(false); }); -
virtual bufsize_t getSize()
-
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual bufsize_t getSize()
+
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
virtual size_t getFieldsCount()
-
virtual QString getFieldName(size_t fieldId)
- +
virtual QString getFieldName(size_t fieldId)
+
void * getValuePtr(ImportEntryWrapper::FieldID fId)
offset_t getFieldRVA(ImportEntryWrapper::FieldID fId)
virtual offset_t callVia()
virtual IMAGE_IMPORT_BY_NAME * getImportByNamePtr()
virtual size_t getSubFieldsCount()
-
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
+
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField=FIELD_NONE)
diff --git a/_p_e_file_8cpp_source.html b/_p_e_file_8cpp_source.html index d2e91acf..0485555e 100644 --- a/_p_e_file_8cpp_source.html +++ b/_p_e_file_8cpp_source.html @@ -948,8 +948,8 @@ $(function(){ initResizable(false); });
QString getForwarderStr()
-
offset_t getFuncRva()
-
virtual QString getName()
+
offset_t getFuncRva()
+
virtual QString getName()
virtual void * getPtr()
diff --git a/_sect_hdrs_wrapper_8cpp_source.html b/_sect_hdrs_wrapper_8cpp_source.html index bef6252f..da2fb195 100644 --- a/_sect_hdrs_wrapper_8cpp_source.html +++ b/_sect_hdrs_wrapper_8cpp_source.html @@ -685,72 +685,71 @@ $(function(){ initResizable(false); });
536{
-
537 size_t size = this->entries.size();
-
538 std::map<offset_t, SectionHdrWrapper*> *secMap = NULL;
-
539
-
540 if (addrType == Executable::RAW) {
-
541 secMap = &this->rSec;
-
542 } else if (addrType == Executable::RVA || addrType == Executable::VA) {
-
543 secMap = &this->vSec;
-
544 }
-
545 if (secMap == NULL) return NULL;
-
546
-
547 std::map<offset_t, SectionHdrWrapper*>::iterator found = secMap->lower_bound(offset);
-
548 std::map<offset_t, SectionHdrWrapper*>::iterator itr;
-
549 for (itr = found; itr != secMap->end(); ++itr) {
-
550 SectionHdrWrapper* sec = itr->second;
-
551 if (sec == NULL) continue; //TODO: check it
-
552 if (verbose) {
-
553 printf("found [%llX] key: %llX sec: %llX %llX\n",
-
554 static_cast<unsigned long long>(offset),
-
555 static_cast<unsigned long long>(itr->first),
-
556 static_cast<unsigned long long>(sec->getContentOffset(addrType)),
-
557 static_cast<unsigned long long>(sec->getContentEndOffset(addrType, false))
-
558 );
-
559 }
-
560
-
561 offset_t startOffset = sec->getContentOffset(addrType);
-
562 if (startOffset == INVALID_ADDR) continue;
-
563
-
564 offset_t endOffset = sec->getContentEndOffset(addrType, recalculate);
-
565
-
566 if (offset >= startOffset && offset < endOffset) {
-
567 return sec;
-
568 }
-
569 if (offset < startOffset) break;
-
570 }
-
571 return NULL;
-
572}
+
537 std::map<offset_t, SectionHdrWrapper*> *secMap = NULL;
+
538
+
539 if (addrType == Executable::RAW) {
+
540 secMap = &this->rSec;
+
541 } else if (addrType == Executable::RVA || addrType == Executable::VA) {
+
542 secMap = &this->vSec;
+
543 }
+
544 if (!secMap) return NULL;
+
545
+
546 std::map<offset_t, SectionHdrWrapper*>::iterator found = secMap->lower_bound(offset);
+
547 std::map<offset_t, SectionHdrWrapper*>::iterator itr;
+
548 for (itr = found; itr != secMap->end(); ++itr) {
+
549 SectionHdrWrapper* sec = itr->second;
+
550 if (sec == NULL) continue; //TODO: check it
+
551 if (verbose) {
+
552 printf("found [%llX] key: %llX sec: %llX %llX\n",
+
553 static_cast<unsigned long long>(offset),
+
554 static_cast<unsigned long long>(itr->first),
+
555 static_cast<unsigned long long>(sec->getContentOffset(addrType)),
+
556 static_cast<unsigned long long>(sec->getContentEndOffset(addrType, false))
+
557 );
+
558 }
+
559
+
560 offset_t startOffset = sec->getContentOffset(addrType);
+
561 if (startOffset == INVALID_ADDR) continue;
+
562
+
563 offset_t endOffset = sec->getContentEndOffset(addrType, recalculate);
+
564
+
565 if (offset >= startOffset && offset < endOffset) {
+
566 return sec;
+
567 }
+
568 if (offset < startOffset) break;
+
569 }
+
570 return NULL;
+
571}
-
573
-
- -
575{
-
576 std::map<offset_t, SectionHdrWrapper*> *secMap = NULL;
-
577
-
578 if (aType == Executable::RAW) {
-
579 secMap = &this->rSec;
-
580 } else if (aType == Executable::RVA || aType == Executable::VA) {
-
581 secMap = &this->vSec;
-
582 }
-
583 if (secMap == NULL) return;
-
584
-
585 std::map<offset_t, SectionHdrWrapper*>::iterator itr;
-
586 for (itr = secMap->begin(); itr != secMap->end(); ++itr) {
-
587 SectionHdrWrapper* sec = itr->second;
-
588 offset_t secEnd = itr->first;
-
589
-
590 printf("[%llX] %s %llX %llX\n",
-
591 static_cast<unsigned long long>(secEnd),
-
592 sec->getName().toStdString().c_str(),
-
593 static_cast<unsigned long long>(sec->getContentOffset(aType)),
-
594 static_cast<unsigned long long>(sec->getContentEndOffset(aType, true))
-
595 );
-
596 }
-
597 printf("---\n\n");
-
598}
+
572
+
+ +
574{
+
575 std::map<offset_t, SectionHdrWrapper*> *secMap = NULL;
+
576
+
577 if (aType == Executable::RAW) {
+
578 secMap = &this->rSec;
+
579 } else if (aType == Executable::RVA || aType == Executable::VA) {
+
580 secMap = &this->vSec;
+
581 }
+
582 if (secMap == NULL) return;
+
583
+
584 std::map<offset_t, SectionHdrWrapper*>::iterator itr;
+
585 for (itr = secMap->begin(); itr != secMap->end(); ++itr) {
+
586 SectionHdrWrapper* sec = itr->second;
+
587 offset_t secEnd = itr->first;
+
588
+
589 printf("[%llX] %s %llX %llX\n",
+
590 static_cast<unsigned long long>(secEnd),
+
591 sec->getName().toStdString().c_str(),
+
592 static_cast<unsigned long long>(sec->getContentOffset(aType)),
+
593 static_cast<unsigned long long>(sec->getContentEndOffset(aType, true))
+
594 );
+
595 }
+
596 printf("---\n\n");
+
597}
-
599
+
598
uint32_t bufsize_t
const offset_t INVALID_ADDR
uint64_t offset_t
@@ -786,7 +785,7 @@ $(function(){ initResizable(false); });
virtual bufsize_t getAlignment(Executable::addr_type aType) const
Definition PEFile.h:69
size_t _getSectionsCount(bool useMapped=true) const
Definition PEFile.cpp:371
-
void printSectionsMapping(Executable::addr_type aType)
+
void printSectionsMapping(Executable::addr_type aType)
ExeNodeWrapper * addEntry(ExeNodeWrapper *entry)
virtual bufsize_t getSize()
diff --git a/_sect_hdrs_wrapper_8h_source.html b/_sect_hdrs_wrapper_8h_source.html index 898eb476..c6e0e622 100644 --- a/_sect_hdrs_wrapper_8h_source.html +++ b/_sect_hdrs_wrapper_8h_source.html @@ -319,7 +319,7 @@ $(function(){ initResizable(false); });
virtual bufsize_t getFieldSize(size_t fieldId, size_t subField)
SectionHdrWrapper * _getSecHdr(size_t index)
SectionHdrWrapper * getSecHdr(size_t index)
-
void printSectionsMapping(Executable::addr_type aType)
+
void printSectionsMapping(Executable::addr_type aType)
ExeNodeWrapper * addEntry(ExeNodeWrapper *entry)
virtual bufsize_t getSize()
diff --git a/class_export_dir_wrapper.html b/class_export_dir_wrapper.html index b3a666fc..3695020a 100644 --- a/class_export_dir_wrapper.html +++ b/class_export_dir_wrapper.html @@ -564,7 +564,7 @@ Here is the call graph for this function:
-

Definition at line 158 of file ExportDirWrapper.cpp.

+

Definition at line 157 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -679,7 +679,7 @@ Here is the call graph for this function:

Reimplemented from ExeElementWrapper.

-

Definition at line 146 of file ExportDirWrapper.cpp.

+

Definition at line 145 of file ExportDirWrapper.cpp.

@@ -786,7 +786,7 @@ Here is the call graph for this function:

Implements ExeNodeWrapper.

-

Definition at line 122 of file ExportDirWrapper.cpp.

+

Definition at line 121 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -874,7 +874,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 101 of file ExportDirWrapper.cpp.

+

Definition at line 100 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -986,7 +986,7 @@ Here is the call graph for this function:
-

Definition at line 173 of file ExportDirWrapper.cpp.

+

Definition at line 172 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1061,7 +1061,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 91 of file ExportDirWrapper.cpp.

+

Definition at line 90 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1220,7 +1220,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 85 of file ExportDirWrapper.cpp.

+

Definition at line 84 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1414,7 +1414,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 63 of file ExportDirWrapper.cpp.

+

Definition at line 62 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_export_entry_wrapper.html b/class_export_entry_wrapper.html index 0b11fccc..66b5d2e5 100644 --- a/class_export_entry_wrapper.html +++ b/class_export_entry_wrapper.html @@ -449,7 +449,7 @@ Additional Inherited Members

Implements ExeNodeWrapper.

-

Definition at line 234 of file ExportDirWrapper.cpp.

+

Definition at line 233 of file ExportDirWrapper.cpp.

@@ -482,7 +482,7 @@ Additional Inherited Members

Implements ExeElementWrapper.

-

Definition at line 185 of file ExportDirWrapper.cpp.

+

Definition at line 184 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -573,7 +573,7 @@ Here is the call graph for this function:
-

Definition at line 307 of file ExportDirWrapper.cpp.

+

Definition at line 306 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -751,7 +751,7 @@ Here is the call graph for this function:
-

Definition at line 296 of file ExportDirWrapper.cpp.

+

Definition at line 295 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -788,7 +788,7 @@ Here is the call graph for this function:
-

Definition at line 288 of file ExportDirWrapper.cpp.

+

Definition at line 287 of file ExportDirWrapper.cpp.

@@ -807,7 +807,7 @@ Here is the call graph for this function:
-

Definition at line 243 of file ExportDirWrapper.cpp.

+

Definition at line 242 of file ExportDirWrapper.cpp.

@@ -836,7 +836,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 221 of file ExportDirWrapper.cpp.

+

Definition at line 220 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -918,7 +918,7 @@ Here is the call graph for this function:
-

Definition at line 251 of file ExportDirWrapper.cpp.

+

Definition at line 250 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1029,7 +1029,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 207 of file ExportDirWrapper.cpp.

+

Definition at line 206 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1177,7 +1177,7 @@ Here is the call graph for this function:
-

Definition at line 215 of file ExportDirWrapper.cpp.

+

Definition at line 214 of file ExportDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_import_base_dir_wrapper.html b/class_import_base_dir_wrapper.html index 5e4df07d..8b6c10c9 100644 --- a/class_import_base_dir_wrapper.html +++ b/class_import_base_dir_wrapper.html @@ -806,7 +806,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 150 of file ImportBaseDirWrapper.cpp.

+

Definition at line 149 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -919,7 +919,7 @@ Here is the call graph for this function:
-

Definition at line 98 of file ImportBaseDirWrapper.cpp.

+

Definition at line 97 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -971,7 +971,7 @@ Here is the call graph for this function:
-

Definition at line 86 of file ImportBaseDirWrapper.cpp.

+

Definition at line 85 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -1012,7 +1012,7 @@ Here is the call graph for this function:
-

Definition at line 76 of file ImportBaseDirWrapper.cpp.

+

Definition at line 75 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -1042,7 +1042,7 @@ Here is the call graph for this function:
-

Definition at line 108 of file ImportBaseDirWrapper.cpp.

+

Definition at line 107 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -1086,7 +1086,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 115 of file ImportBaseDirWrapper.cpp.

+

Definition at line 114 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_import_base_entry_wrapper.html b/class_import_base_entry_wrapper.html index 1d7ae20c..109d1feb 100644 --- a/class_import_base_entry_wrapper.html +++ b/class_import_base_entry_wrapper.html @@ -546,7 +546,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 161 of file ImportBaseDirWrapper.cpp.

+

Definition at line 160 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -602,7 +602,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 169 of file ImportBaseDirWrapper.cpp.

+

Definition at line 168 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_import_base_func_wrapper.html b/class_import_base_func_wrapper.html index a334c67d..179d3c2c 100644 --- a/class_import_base_func_wrapper.html +++ b/class_import_base_func_wrapper.html @@ -520,7 +520,7 @@ Here is the call graph for this function:
-

Definition at line 226 of file ImportBaseDirWrapper.cpp.

+

Definition at line 225 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -561,7 +561,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 237 of file ImportBaseDirWrapper.cpp.

+

Definition at line 236 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -629,7 +629,7 @@ Here is the call graph for this function:
-

Definition at line 206 of file ImportBaseDirWrapper.cpp.

+

Definition at line 205 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
@@ -741,7 +741,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 247 of file ImportBaseDirWrapper.cpp.

+

Definition at line 246 of file ImportBaseDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_import_dir_wrapper.html b/class_import_dir_wrapper.html index c0414f97..0fdd25d2 100644 --- a/class_import_dir_wrapper.html +++ b/class_import_dir_wrapper.html @@ -489,7 +489,7 @@ Here is the call graph for this function:
-

Definition at line 319 of file ImportDirWrapper.cpp.

+

Definition at line 313 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -555,7 +555,7 @@ Here is the call graph for this function:
-

Definition at line 310 of file ImportDirWrapper.cpp.

+

Definition at line 304 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -693,7 +693,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 361 of file ImportDirWrapper.cpp.

+

Definition at line 355 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -732,7 +732,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 335 of file ImportDirWrapper.cpp.

+

Definition at line 329 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_import_entry_wrapper.html b/class_import_entry_wrapper.html index 805b5c8b..d2a2f3b4 100644 --- a/class_import_entry_wrapper.html +++ b/class_import_entry_wrapper.html @@ -533,7 +533,7 @@ Here is the call graph for this function:

Reimplemented from ExeElementWrapper.

-

Definition at line 269 of file ImportDirWrapper.cpp.

+

Definition at line 263 of file ImportDirWrapper.cpp.

@@ -603,7 +603,7 @@ Here is the call graph for this function:

Implements ExeNodeWrapper.

-

Definition at line 257 of file ImportDirWrapper.cpp.

+

Definition at line 251 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -693,7 +693,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 241 of file ImportDirWrapper.cpp.

+

Definition at line 235 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -790,7 +790,7 @@ Here is the call graph for this function:

Implements ImportBaseEntryWrapper.

-

Definition at line 280 of file ImportDirWrapper.cpp.

+

Definition at line 274 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -872,7 +872,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 224 of file ImportDirWrapper.cpp.

+

Definition at line 218 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1049,7 +1049,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 196 of file ImportDirWrapper.cpp.

+

Definition at line 190 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1115,7 +1115,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 219 of file ImportDirWrapper.cpp.

+

Definition at line 213 of file ImportDirWrapper.cpp.

@@ -1134,7 +1134,7 @@ Here is the call graph for this function:
-

Definition at line 231 of file ImportDirWrapper.cpp.

+

Definition at line 225 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1202,7 +1202,7 @@ Here is the call graph for this function:

Reimplemented from ExeNodeWrapper.

-

Definition at line 179 of file ImportDirWrapper.cpp.

+

Definition at line 173 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_imported_func_wrapper.html b/class_imported_func_wrapper.html index 5a92a261..7afeb721 100644 --- a/class_imported_func_wrapper.html +++ b/class_imported_func_wrapper.html @@ -575,7 +575,7 @@ Here is the call graph for this function:

Reimplemented from ExeElementWrapper.

-

Definition at line 164 of file ImportDirWrapper.cpp.

+

Definition at line 158 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -678,7 +678,7 @@ Here is the call graph for this function:

Implements ExeNodeWrapper.

-

Definition at line 153 of file ImportDirWrapper.cpp.

+

Definition at line 147 of file ImportDirWrapper.cpp.

@@ -711,43 +711,41 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 123 of file ImportDirWrapper.cpp.

+

Definition at line 121 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
- - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - + - + @@ -757,42 +755,43 @@ Here is the call graph for this function:
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -926,7 +925,7 @@ Here is the call graph for this function:

Reimplemented from ExeElementWrapper.

-

Definition at line 146 of file ImportDirWrapper.cpp.

+

Definition at line 140 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -968,7 +967,7 @@ Here is the call graph for this function:

Implements ImportBaseFuncWrapper.

-

Definition at line 108 of file ImportDirWrapper.cpp.

+

Definition at line 106 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
@@ -1348,7 +1347,7 @@ Here is the call graph for this function:

Implements ExeElementWrapper.

-

Definition at line 118 of file ImportDirWrapper.cpp.

+

Definition at line 116 of file ImportDirWrapper.cpp.

Here is the call graph for this function:
diff --git a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.map b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.map index ac6fcd8f..62a66f1a 100644 --- a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.map +++ b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.map @@ -1,35 +1,33 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - + - + @@ -39,40 +37,41 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.md5 b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.md5 index 99f5b1cb..d5ba84ac 100644 --- a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.md5 +++ b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.md5 @@ -1 +1 @@ -8a9ac94facb258ef47c2ac961c566d26 \ No newline at end of file +bca829074c09689ee5305b1953faa398 \ No newline at end of file diff --git a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.png b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.png index c053f392..938fa4eb 100644 Binary files a/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.png and b/class_imported_func_wrapper_a26d38df3d80ae19d4b93dfe2551690c9_cgraph.png differ diff --git a/class_sect_hdrs_wrapper.html b/class_sect_hdrs_wrapper.html index dee70970..d21aa84a 100644 --- a/class_sect_hdrs_wrapper.html +++ b/class_sect_hdrs_wrapper.html @@ -1082,7 +1082,7 @@ Here is the call graph for this function:
-

Definition at line 574 of file SectHdrsWrapper.cpp.

+

Definition at line 573 of file SectHdrsWrapper.cpp.

Here is the call graph for this function: