BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
ResourceVersionWrapper.h
Go to the documentation of this file.
1#pragma once
2
5#include "../pe_formats.h"
6
8{
9public:
32
34
35 /* full structure boundatries */
36 virtual void* getPtr() { return getVersionInfo(); }
37 virtual bufsize_t getSize() { return (getVersionInfo() == NULL) ? 0 :sizeof(pe::version_info); }
38 virtual QString getName() { return "Version"; }
39 virtual size_t getFieldsCount() { return FIELD_COUNTER; }
40 virtual size_t getSubFieldsCount() { return 1; } //TODO: children
41
42 /* specific field boundatries */
43 virtual void* getFieldPtr(size_t fieldId, size_t subField);
44 virtual QString getFieldName(size_t fieldId);
45
46 virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField = FIELD_NONE);
47
48 pe::version_info *getVersionInfo();
50 {
51 pe::version_info *info = getVersionInfo();
52 if (info == NULL) return ""; //ERROR
53
54 int size = INFOTEXT_LEN;
55 WORD *content = info->key;
56 if (content == NULL) return "";
57
58 return QString::fromUtf16(content, size);
59 }
60
61
62
64};
65
uint32_t bufsize_t
#define FIELD_NONE
virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField=FIELD_NONE)
ResourceVersionWrapper(Executable *pe, ResourceLeafWrapper *v_leaf)
virtual void * getFieldPtr(size_t fieldId, size_t subField)
virtual QString getFieldName(size_t fieldId)
pe::version_info * getVersionInfo()