LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
ResourceDialogItem.hpp
Go to the documentation of this file.
1
2/* Copyright 2017 - 2024 R. Thomas
3 * Copyright 2017 - 2024 Quarkslab
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_RESOURCE_DIALOG_ITEM_H
18#define LIEF_PE_RESOURCE_DIALOG_ITEM_H
19#include <ostream>
20#include <sstream>
21#include <set>
22
23#include "LIEF/visibility.h"
24
25#include "LIEF/Object.hpp"
26
27#include "LIEF/PE/enums.hpp"
28
29namespace LIEF {
30namespace PE {
32struct ResourcesParser;
33
34namespace details {
35struct pe_dialog_item_template_ext;
36struct pe_dialog_item_template;
37}
38class LIEF_API ResourceDialogItem : public Object {
41
42 friend class ResourcesManager;
43 friend struct ResourcesParser;
44
45 public:
47 ResourceDialogItem(const details::pe_dialog_item_template_ext& header);
48 ResourceDialogItem(const details::pe_dialog_item_template& header);
49
50 ResourceDialogItem(const ResourceDialogItem&);
51 ResourceDialogItem& operator=(const ResourceDialogItem&);
52
54 bool is_extended() const;
57 uint32_t extended_style() const;
60 std::set<EXTENDED_WINDOW_STYLES> extended_style_list() const;
64 bool has_extended_style(EXTENDED_WINDOW_STYLES style) const;
67 uint32_t style() const;
70
71 std::set<WINDOW_STYLES> style_list() const;
72 bool has_style(WINDOW_STYLES style) const;
73 int16_t x() const;
77 int16_t y() const;
81 int16_t cx() const;
84 int16_t cy() const;
87 uint32_t id() const;
90
91
92 // Extended API
93 // ============
94 uint32_t help_id() const;
97 const std::u16string& title() const;
100
101 void accept(Visitor& visitor) const override;
102
103
104 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceDialogItem& dialog_item);
105
106 private:
107 bool is_extended_ = true;
108 uint32_t help_id_ = 0;
109 uint32_t ext_style_ = 0;
110 uint32_t style_ = 0;
111 uint32_t id_ = 0;
112
113 int16_t x_ = 0;
114 int16_t y_ = 0;
115 int16_t cx_ = 0;
116 int16_t cy_ = 0;
117
118 std::u16string window_class_;
119 std::u16string title_;
120
121 uint16_t extra_count_ = 0;
122};
123
124
125}
126}
127
128
129#endif
This class represents an item in the ResourceDialog.
Definition ResourceDialogItem.hpp:40
friend std::ostream & operator<<(std::ostream &os, const ResourceDialogItem &dialog_item)
bool has_style(WINDOW_STYLES style) const
uint32_t id() const
The control identifier.
ResourceDialogItem(const ResourceDialogItem &)
ResourceDialogItem & operator=(const ResourceDialogItem &)
std::set< EXTENDED_WINDOW_STYLES > extended_style_list() const
List of PE::EXTENDED_WINDOW_STYLES associated with the ResourceDialogItem::extended_style value.
int16_t cy() const
The height, in dialog box units, of the control.
std::set< WINDOW_STYLES > style_list() const
int16_t y() const
The y-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is al...
bool is_extended() const
True if the control is an extended one
void accept(Visitor &visitor) const override
uint32_t style() const
The style of the control.
ResourceDialogItem(const details::pe_dialog_item_template_ext &header)
int16_t cx() const
The width, in dialog box units, of the control.
int16_t x() const
The x-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is al...
ResourceDialogItem(const details::pe_dialog_item_template &header)
uint32_t extended_style() const
The extended styles for a window.
const std::u16string & title() const
Initial text of the control.
uint32_t help_id() const
The help context identifier for the control.
bool has_extended_style(EXTENDED_WINDOW_STYLES style) const
Check if the DialogItem has the given PE::EXTENDED_WINDOW_STYLES.
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Definition CodeIntegrity.hpp:26
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41