21 const size_t dirSize = this->
getSize();
22 const size_t entriesCount = dirSize /
sizeof(IMAGE_DEBUG_DIRECTORY);
23 if (cntr >= entriesCount) {
28 if (!dbgEntry || !dbgEntry->
getPtr()) {
40 if (!dbgEntry)
continue;
44 if (isOk && typeVal == pe::DT_REPRO) {
56 this->
entries.push_back(cvWrapper);
69 return sizeof(IMAGE_DEBUG_DIRECTORY);
74 IMAGE_DEBUG_DIRECTORY* d =
debugDir();
75 if (d == NULL)
return NULL;
82 case TYPE:
return &d->Type;
97 case TYPE:
return "Type";
117 case pe::DT_UNKNOWN :
return "unknown";
118 case pe::DT_COFF :
return "COFF";
119 case pe::DT_CODEVIEW :
return "Visual C++ (CodeView)";
120 case pe::DT_FPO :
return "Frame pointer omission";
121 case pe::DT_MISC :
return "DBG file";
122 case pe::DT_EXCEPTION :
return "A copy of .pdata section";
123 case pe::DT_FIXUP :
return "Reserved";
124 case pe::DT_OMAP_TO_SRC :
return "mapping from an RVA in image to an RVA in source image";
125 case pe::DT_OMAP_FROM_SRC :
return "mapping from an RVA in source image to an RVA in image";
126 case pe::DT_BORLAND :
return "Borland";
127 case pe::DT_RESERVED10 :
return "Reserved";
128 case pe::DT_CLSID :
return "CLSID";
129 case pe::DT_VC_FEATURE :
return "VC Feature";
130 case pe::DT_POGO :
return "POGO";
131 case pe::DT_ILTCG :
return "ILTCG";
132 case pe::DT_MPX :
return "MPX";
133 case pe::DT_REPRO :
return "REPRO";
140 if (fieldId !=
TYPE)
return "";
142 IMAGE_DEBUG_DIRECTORY* d =
debugDir();
143 if (d == NULL)
return NULL;
150 IMAGE_DEBUG_DIRECTORY* d = this->
debugDir();
151 if (d == NULL)
return NULL;
152 if (d->Type != DT_CODEVIEW) {
156 size_t dirSize = d->SizeOfData;
163 IMAGE_DEBUG_DIRECTORY* d =
debugDir();
164 if (!debugStr || !d)
return NULL;
165 if (d->SizeOfData <
sizeof(DEBUG_RSDSI)) {
168 DEBUG_RSDSI* rdsi = (DEBUG_RSDSI*)debugStr;
169 if (rdsi->dwSig == CV_SIGNATURE_RSDS) {
178 IMAGE_DEBUG_DIRECTORY* d =
debugDir();
179 if (!debugStr || !d)
return NULL;
180 if (d->SizeOfData <
sizeof(DEBUG_NB10)) {
183 DEBUG_NB10* nb = (DEBUG_NB10*)debugStr;
184 if (nb->cvHdr.CvSignature == CV_SIGNATURE_NB10) {
193 DEBUG_RSDSI* rdsi = parentDir->
getRDSI();
202 IMAGE_DEBUG_DIRECTORY* d = parentDir->
debugDir();
203 if (d == NULL)
return 0;
204 return d->SizeOfData;
209 DEBUG_RSDSI* rdsi = parentDir->
getRDSI();
219 DEBUG_NB10* dbg = parentDir->
getNB10();
234 DEBUG_RSDSI* rdsi = parentDir->
getRDSI();
237 for (
size_t i = 0; i <
sizeof(rdsi->guidSig.Data4); i++) {
239#if QT_VERSION >= 0x050000
240 out = QString().asprintf(
"%02X", rdsi->guidSig.Data4[i]);
242 out = QString().sprintf(
"%02X", rdsi->guidSig.Data4[i]);
247 for (
size_t i = 0; i <
sizeof(rdsi->guidSig.Data5); i++) {
249#if QT_VERSION >= 0x050000
250 out = QString().asprintf(
"%02X", rdsi->guidSig.Data5[i]);
252 out = QString().sprintf(
"%02X", rdsi->guidSig.Data5[i]);
257#if QT_VERSION >= 0x050000
258 out = QString().asprintf(
"%08X-%04X-%04X-",
261 rdsi->guidSig.Data3);
263 out = QString().sprintf(
"%08X-%04X-%04X-",
266 rdsi->guidSig.Data3);
268 return "{" + out + chunk4 +
"-" + chunk5 +
"}";
271 DEBUG_NB10* dbg = parentDir->
getNB10();
274#if QT_VERSION >= 0x050000
275 out = QString().asprintf(
"%04X", dbg->Signature);
277 out = QString().sprintf(
"%04X", dbg->Signature);
286 DEBUG_RSDSI* rdsi = (DEBUG_RSDSI*)this->
getPtr();
287 if (!rdsi)
return "";
290#if QT_VERSION >= 0x050000
291 out = QString().asprintf(
"%.4s", (
char*)&rdsi->dwSig);
293 out = QString().sprintf(
"%.4s", (
char*)&rdsi->dwSig);
311 DEBUG_RSDSI* rdsi = parentDir->
getRDSI();
312 DEBUG_NB10* dbg = parentDir->
getNB10();
313 if (!rdsi && !dbg)
return "";
316 if (rdsi) pdb = (
char*)rdsi->szPdb;
317 if (dbg) pdb = (
char*)dbg->PdbFileName;
QString translateFieldContent(size_t fieldId)
virtual QString getFieldName(size_t fieldId)
virtual void * getFieldPtr(size_t fieldId, size_t subField=FIELD_NONE)
virtual bufsize_t getSize()
pe::DEBUG_RSDSI * getRDSI()
virtual QString getName()
DebugDirWrapper * dbgRootDir
QString translateFieldContent(size_t fieldId)
virtual QString getFieldName(size_t fieldId)
virtual bufsize_t getSize()
IMAGE_DEBUG_DIRECTORY * debugDir()
friend class DebugDirCVEntryWrapper
pe::DEBUG_NB10 * getNB10()
virtual void * getFieldPtr(size_t fieldId, size_t subField)
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField=FIELD_NONE)
QString translateType(int type)
friend class DebugDirEntryWrapper
virtual bool loadNextEntry(size_t cntr)
virtual bufsize_t getSize()
virtual uint64_t getNumValue(size_t fieldId, size_t subField, bool *isOk)
std::vector< ExeNodeWrapper * > entries
BYTE * getContentAt(offset_t offset, bufsize_t size, bool allowExceptions=false)