BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
ResourceContentWrapper.h
Go to the documentation of this file.
1#pragma once
2
5#include "../pe_formats.h"
6
8
10{
11public:
12 static QString translateType(pe::resource_type type);
13
15
16 void* getResContentPtr();
19
20 pe::resource_type getType() { return typeId; }
21
22 virtual void* getPtr() { return getResContentPtr(); }
23 virtual bufsize_t getSize() { return getResContentSize(); }
24
25 virtual QString getName() { return translateType(this->typeId); }
26 virtual size_t getFieldsCount() { return 1; }
27 virtual size_t getSubFieldsCount() { return 1; }
28
29 /* specific field boundatries */
30 virtual void* getFieldPtr(size_t fieldId, size_t subField) { return getPtr(); }
31 virtual QString getFieldName(size_t fieldId) { return getName(); }
32 virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField = FIELD_NONE) { return WrappedValue::COMPLEX; }
33
34protected:
35 ResourceContentWrapper(Executable *pe, ResourceLeafWrapper* v_leaf, pe::resource_type v_typeId)
36 : ExeNodeWrapper(pe), myLeaf(v_leaf), typeId(v_typeId) {}
37
38 BYTE* getContentAt(offset_t dataAddr, Executable::addr_type aT, bufsize_t dataSize);
39
41 pe::resource_type typeId;
42
44};
45
46
48{
49public:
50 virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField = FIELD_NONE) { return WrappedValue::STRING; }
51
52protected:
54 : ResourceContentWrapper(pe, v_leaf, pe::RESTYPE_MANIFEST) {}
55
57};
58
60{
61public:
62 virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField = FIELD_NONE) { return WrappedValue::STRING; }
63
64protected:
66 : ResourceContentWrapper(pe, v_leaf, pe::RESTYPE_HTML
67 ) {}
68
70};
uint32_t bufsize_t
uint64_t offset_t
#define FIELD_NONE
virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField=FIELD_NONE)
ReourceHTMLWrapper(Executable *pe, ResourceLeafWrapper *v_leaf)
ReourceManifestWrapper(Executable *pe, ResourceLeafWrapper *v_leaf)
virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField=FIELD_NONE)
ResourceContentWrapper(Executable *pe, ResourceLeafWrapper *v_leaf, pe::resource_type v_typeId)
static QString translateType(pe::resource_type type)
BYTE * getContentAt(offset_t dataAddr, Executable::addr_type aT, bufsize_t dataSize)
virtual void * getFieldPtr(size_t fieldId, size_t subField)
virtual QString getFieldName(size_t fieldId)
ResourceLeafWrapper * myLeaf
virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField=FIELD_NONE)