LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
ResourceAccelerator.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 * Copyright 2017 - 2021 K. Nakagawa
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_ACCELERATOR_H
18#define LIEF_PE_RESOURCE_ACCELERATOR_H
19
20#include <string>
21#include <set>
22#include <ostream>
23
24#include "LIEF/visibility.h"
25
26#include "LIEF/Object.hpp"
27
28#include "LIEF/PE/enums.hpp"
29
30namespace LIEF {
31namespace PE {
33
34namespace details {
35struct pe_resource_acceltableentry;
36}
37
38class LIEF_API ResourceAccelerator : public Object {
39
40 friend class ResourcesManager;
41
42 public:
44 explicit ResourceAccelerator(const details::pe_resource_acceltableentry&);
45
46 ResourceAccelerator(const ResourceAccelerator&) = default;
47 ResourceAccelerator& operator=(const ResourceAccelerator&) = default;
48
49 ~ResourceAccelerator() override = default;
50
51 std::set<ACCELERATOR_FLAGS> flags_list() const;
52 std::string ansi_str() const;
53 int16_t flags() const {
56 return flags_;
57 }
58 int16_t ansi() const {
61 return ansi_;
62 }
63 uint16_t id() const {
66 return id_;
67 }
68 int16_t padding() const {
71 return padding_;
72 }
73
74 void accept(Visitor& visitor) const override;
75
76
77 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceAccelerator& acc);
78
79 private:
80 int16_t flags_ = 0;
81 int16_t ansi_ = 0;
82 uint16_t id_ = 0;
83 int16_t padding_ = 0;
84
85};
86
87}
88}
89
90#endif
Object.hpp
enums.hpp
LIEF::PE::ResourceAccelerator
Definition ResourceAccelerator.hpp:38
LIEF::PE::ResourceAccelerator::ResourceAccelerator
ResourceAccelerator(const details::pe_resource_acceltableentry &)
LIEF::PE::ResourceAccelerator::ansi_str
std::string ansi_str() const
LIEF::PE::ResourceAccelerator::flags_list
std::set< ACCELERATOR_FLAGS > flags_list() const
LIEF::PE::ResourceAccelerator::ansi
int16_t ansi() const
An ANSI character value or a virtual-key code that identifies the accelerator key.
Definition ResourceAccelerator.hpp:60
LIEF::PE::ResourceAccelerator::operator=
ResourceAccelerator & operator=(const ResourceAccelerator &)=default
LIEF::PE::ResourceAccelerator::id
uint16_t id() const
An identifier for the keyboard accelerator.
Definition ResourceAccelerator.hpp:65
LIEF::PE::ResourceAccelerator::ResourceAccelerator
ResourceAccelerator()=default
LIEF::PE::ResourceAccelerator::~ResourceAccelerator
~ResourceAccelerator() override=default
LIEF::PE::ResourceAccelerator::flags
int16_t flags() const
Describe the keyboard accelerator characteristics.
Definition ResourceAccelerator.hpp:55
LIEF::PE::ResourceAccelerator::ResourceAccelerator
ResourceAccelerator(const ResourceAccelerator &)=default
LIEF::PE::ResourceAccelerator::accept
void accept(Visitor &visitor) const override
LIEF::PE::ResourceAccelerator::padding
int16_t padding() const
The number of bytes inserted to ensure that the structure is aligned on a DWORD boundary.
Definition ResourceAccelerator.hpp:70
LIEF::PE::ResourceAccelerator::operator<<
friend std::ostream & operator<<(std::ostream &os, const ResourceAccelerator &acc)
LIEF::PE::ResourcesManager
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
LIEF::PE::details
Definition CodeIntegrity.hpp:26
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41