BearParser
Portable Executable parsing library (from PE-bear)
Toggle main menu visibility
Loading...
Searching...
No Matches
parser
include
bearparser
pe
ResourceLeafWrapper.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
../ExeNodeWrapper.h
"
4
5
#include <map>
6
#include <vector>
7
#include "pe_formats.h"
8
9
class
ResourceLeafWrapper
:
public
ExeNodeWrapper
10
{
11
public
:
12
// fields :
13
enum
FieldID
{
14
NONE
=
FIELD_NONE
,
15
OFFSET_TO_DATA
,
16
DATA_SIZE
,
17
CODE_PAGE
,
18
RESERVED
,
19
FIELD_COUNTER
20
};
21
22
ResourceLeafWrapper
(
Executable
*pe,
offset_t
rawOffset,
long
topEntryId)
23
:
ExeNodeWrapper
(pe),
offset
(rawOffset),
topEntryID
(topEntryId){ }
24
25
virtual
~ResourceLeafWrapper
() { }
26
27
virtual
void
*
getPtr
() {
return
leafEntryPtr
(); }
28
virtual
bufsize_t
getSize
() {
return
sizeof
(IMAGE_RESOURCE_DATA_ENTRY); }
29
30
virtual
QString
getName
() {
return
"Resource Data"
; }
31
virtual
size_t
getFieldsCount
() {
return
FIELD_COUNTER
; }
32
33
virtual
void
*
getFieldPtr
(
size_t
fieldId,
size_t
subField);
34
virtual
QString
getFieldName
(
size_t
fieldId);
35
virtual
Executable::addr_type
containsAddrType
(
size_t
fieldId,
size_t
subField)
36
{
37
return
(fieldId ==
OFFSET_TO_DATA
) ?
Executable::RVA
:
Executable::NOT_ADDR
;
38
}
39
40
IMAGE_RESOURCE_DATA_ENTRY *
leafEntryPtr
();
41
42
Executable
*
getExe
() {
return
this->
m_Exe
; }
43
44
protected
:
45
offset_t
offset
;
46
long
topEntryID
;
47
//ResourceEntryWrapper* parentEntry;
48
};
49
offset_t
uint64_t offset_t
Definition
AbstractByteBuffer.h:20
bufsize_t
size_t bufsize_t
Definition
AbstractByteBuffer.h:17
FIELD_NONE
#define FIELD_NONE
Definition
ExeElementWrapper.h:9
ExeNodeWrapper.h
ExeElementWrapper::Executable
friend class Executable
Definition
ExeElementWrapper.h:67
ExeElementWrapper::m_Exe
Executable * m_Exe
Definition
ExeElementWrapper.h:65
ExeNodeWrapper::ExeNodeWrapper
ExeNodeWrapper(Executable *pe, ExeNodeWrapper *parent=NULL)
Definition
ExeNodeWrapper.cpp:3
Executable::addr_type
addr_type
Definition
Executable.h:42
Executable::NOT_ADDR
@ NOT_ADDR
Definition
Executable.h:43
Executable::RVA
@ RVA
Definition
Executable.h:45
ResourceLeafWrapper::leafEntryPtr
IMAGE_RESOURCE_DATA_ENTRY * leafEntryPtr()
Definition
ResourceDirWrapper.cpp:341
ResourceLeafWrapper::getExe
Executable * getExe()
Definition
ResourceLeafWrapper.h:42
ResourceLeafWrapper::getFieldPtr
virtual void * getFieldPtr(size_t fieldId, size_t subField)
Definition
ResourceDirWrapper.cpp:349
ResourceLeafWrapper::getFieldsCount
virtual size_t getFieldsCount()
Definition
ResourceLeafWrapper.h:31
ResourceLeafWrapper::getPtr
virtual void * getPtr()
Definition
ResourceLeafWrapper.h:27
ResourceLeafWrapper::offset
offset_t offset
Definition
ResourceLeafWrapper.h:45
ResourceLeafWrapper::getFieldName
virtual QString getFieldName(size_t fieldId)
Definition
ResourceDirWrapper.cpp:363
ResourceLeafWrapper::FieldID
FieldID
Definition
ResourceLeafWrapper.h:13
ResourceLeafWrapper::NONE
@ NONE
Definition
ResourceLeafWrapper.h:14
ResourceLeafWrapper::FIELD_COUNTER
@ FIELD_COUNTER
Definition
ResourceLeafWrapper.h:19
ResourceLeafWrapper::DATA_SIZE
@ DATA_SIZE
Definition
ResourceLeafWrapper.h:16
ResourceLeafWrapper::RESERVED
@ RESERVED
Definition
ResourceLeafWrapper.h:18
ResourceLeafWrapper::CODE_PAGE
@ CODE_PAGE
Definition
ResourceLeafWrapper.h:17
ResourceLeafWrapper::OFFSET_TO_DATA
@ OFFSET_TO_DATA
Definition
ResourceLeafWrapper.h:15
ResourceLeafWrapper::ResourceLeafWrapper
ResourceLeafWrapper(Executable *pe, offset_t rawOffset, long topEntryId)
Definition
ResourceLeafWrapper.h:22
ResourceLeafWrapper::getSize
virtual bufsize_t getSize()
Definition
ResourceLeafWrapper.h:28
ResourceLeafWrapper::getName
virtual QString getName()
Definition
ResourceLeafWrapper.h:30
ResourceLeafWrapper::containsAddrType
virtual Executable::addr_type containsAddrType(size_t fieldId, size_t subField)
Definition
ResourceLeafWrapper.h:35
ResourceLeafWrapper::topEntryID
long topEntryID
Definition
ResourceLeafWrapper.h:46
ResourceLeafWrapper::~ResourceLeafWrapper
virtual ~ResourceLeafWrapper()
Definition
ResourceLeafWrapper.h:25
Generated by
1.17.0