BearParser
Portable Executable parsing library (from PE-bear)
Loading...
Searching...
No Matches
parser
include
bearparser
pe
rsrc
ResourceVersionWrapper.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../ResourceLeafWrapper.h
"
4
#include "
ResourceContentWrapper.h
"
5
#include "../pe_formats.h"
6
7
class
ResourceVersionWrapper
:
public
ResourceContentWrapper
8
{
9
public
:
10
enum
ResourceFID
{
11
NONE
=
FIELD_NONE
,
12
STRUCT_LEN
,
13
VAL_LEN
,
14
STRUCT_TYPE
,
15
INFO
,
16
SIGNATURE
,
17
STRUCT_VER
,
18
FILE_VER_0
,
19
FILE_VER_1
,
20
PRODUCT_VER_0
,
21
PRODUCT_VER_1
,
22
FLAGS_MASK
,
23
FLAGS
,
24
OS
,
25
TYPE
,
26
SUBTYPE
,
27
TIMESTAMP_0
,
28
TIMESTAMP_1
,
29
CHILDREN
,
30
FIELD_COUNTER
31
};
32
33
ResourceVersionWrapper
(
Executable
*pe,
ResourceLeafWrapper
* v_leaf);
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
();
49
QString
getVersionText
()
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
63
friend
class
ResourceContentFactory
;
64
};
65
bufsize_t
uint32_t bufsize_t
Definition
AbstractByteBuffer.h:14
FIELD_NONE
#define FIELD_NONE
Definition
ExeElementWrapper.h:9
ResourceContentWrapper.h
ResourceLeafWrapper.h
Executable
Definition
Executable.h:26
ResourceContentFactory
Definition
ResourceContentFactory.h:6
ResourceContentWrapper
Definition
ResourceContentWrapper.h:10
ResourceLeafWrapper
Definition
ResourceLeafWrapper.h:10
ResourceVersionWrapper
Definition
ResourceVersionWrapper.h:8
ResourceVersionWrapper::containsDataType
virtual WrappedValue::data_type containsDataType(size_t fieldId, size_t subField=FIELD_NONE)
Definition
ResourceVersionWrapper.cpp:111
ResourceVersionWrapper::ResourceVersionWrapper
ResourceVersionWrapper(Executable *pe, ResourceLeafWrapper *v_leaf)
Definition
ResourceVersionWrapper.cpp:3
ResourceVersionWrapper::getSubFieldsCount
virtual size_t getSubFieldsCount()
Definition
ResourceVersionWrapper.h:40
ResourceVersionWrapper::getVersionText
QString getVersionText()
Definition
ResourceVersionWrapper.h:49
ResourceVersionWrapper::getPtr
virtual void * getPtr()
Definition
ResourceVersionWrapper.h:36
ResourceVersionWrapper::getSize
virtual bufsize_t getSize()
Definition
ResourceVersionWrapper.h:37
ResourceVersionWrapper::getFieldPtr
virtual void * getFieldPtr(size_t fieldId, size_t subField)
Definition
ResourceVersionWrapper.cpp:77
ResourceVersionWrapper::ResourceFID
ResourceFID
Definition
ResourceVersionWrapper.h:10
ResourceVersionWrapper::PRODUCT_VER_1
@ PRODUCT_VER_1
Definition
ResourceVersionWrapper.h:21
ResourceVersionWrapper::FLAGS_MASK
@ FLAGS_MASK
Definition
ResourceVersionWrapper.h:22
ResourceVersionWrapper::VAL_LEN
@ VAL_LEN
Definition
ResourceVersionWrapper.h:13
ResourceVersionWrapper::INFO
@ INFO
Definition
ResourceVersionWrapper.h:15
ResourceVersionWrapper::CHILDREN
@ CHILDREN
Definition
ResourceVersionWrapper.h:29
ResourceVersionWrapper::SUBTYPE
@ SUBTYPE
Definition
ResourceVersionWrapper.h:26
ResourceVersionWrapper::SIGNATURE
@ SIGNATURE
Definition
ResourceVersionWrapper.h:16
ResourceVersionWrapper::FILE_VER_1
@ FILE_VER_1
Definition
ResourceVersionWrapper.h:19
ResourceVersionWrapper::OS
@ OS
Definition
ResourceVersionWrapper.h:24
ResourceVersionWrapper::STRUCT_VER
@ STRUCT_VER
Definition
ResourceVersionWrapper.h:17
ResourceVersionWrapper::TIMESTAMP_1
@ TIMESTAMP_1
Definition
ResourceVersionWrapper.h:28
ResourceVersionWrapper::STRUCT_TYPE
@ STRUCT_TYPE
Definition
ResourceVersionWrapper.h:14
ResourceVersionWrapper::FIELD_COUNTER
@ FIELD_COUNTER
Definition
ResourceVersionWrapper.h:30
ResourceVersionWrapper::NONE
@ NONE
Definition
ResourceVersionWrapper.h:11
ResourceVersionWrapper::TYPE
@ TYPE
Definition
ResourceVersionWrapper.h:25
ResourceVersionWrapper::PRODUCT_VER_0
@ PRODUCT_VER_0
Definition
ResourceVersionWrapper.h:20
ResourceVersionWrapper::FILE_VER_0
@ FILE_VER_0
Definition
ResourceVersionWrapper.h:18
ResourceVersionWrapper::FLAGS
@ FLAGS
Definition
ResourceVersionWrapper.h:23
ResourceVersionWrapper::TIMESTAMP_0
@ TIMESTAMP_0
Definition
ResourceVersionWrapper.h:27
ResourceVersionWrapper::STRUCT_LEN
@ STRUCT_LEN
Definition
ResourceVersionWrapper.h:12
ResourceVersionWrapper::getFieldName
virtual QString getFieldName(size_t fieldId)
Definition
ResourceVersionWrapper.cpp:48
ResourceVersionWrapper::getName
virtual QString getName()
Definition
ResourceVersionWrapper.h:38
ResourceVersionWrapper::getVersionInfo
pe::version_info * getVersionInfo()
Definition
ResourceVersionWrapper.cpp:36
ResourceVersionWrapper::getFieldsCount
virtual size_t getFieldsCount()
Definition
ResourceVersionWrapper.h:39
WrappedValue::data_type
data_type
Definition
WrappedValue.h:15
Generated by
1.12.0