LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
QNXStack.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_ELF_QNX_STACK_H
17#define LIEF_ELF_QNX_STACK_H
18
19#include <ostream>
20#include <memory>
21
22#include "LIEF/visibility.h"
23#include "LIEF/ELF/Note.hpp"
24
25namespace LIEF {
26namespace ELF {
27class LIEF_API QNXStack : public Note {
30 public:
31 std::unique_ptr<Note> clone() const override {
32 return std::unique_ptr<QNXStack>(new QNXStack(*this));
33 }
34 uint32_t stack_size() const;
37 uint32_t stack_allocated() const;
40 bool is_executable() const;
43
44 void stack_size(uint32_t value);
45 void stack_allocated(uint32_t value);
46 void set_is_executable(bool value);
47
48 void dump(std::ostream& os) const override;
49
50 void accept(Visitor& visitor) const override;
51
52 static bool classof(const Note* note) {
53 return note->type() == Note::TYPE::QNX_STACK;
54 }
55
56 ~QNXStack() override = default;
57
58 LIEF_API friend
59 std::ostream& operator<<(std::ostream& os, const QNXStack& note) {
60 note.dump(os);
61 return os;
62 }
63 protected:
64 using Note::Note;
65};
66
67
68} // namepsace ELF
69} // namespace LIEF
70
71#endif
Class which represents an ELF note. This class can be instantiated using the static Note::create func...
Definition Note.hpp:39
TYPE type() const
Return the type of the note. This type does not match the NT_ type value. For accessing the original ...
Definition Note.hpp:195
Class representing the QNX QNT_STACK note.
Definition QNXStack.hpp:29
void stack_size(uint32_t value)
~QNXStack() override=default
static bool classof(const Note *note)
Definition QNXStack.hpp:52
void set_is_executable(bool value)
bool is_executable() const
Whether the stack is executable.
friend std::ostream & operator<<(std::ostream &os, const QNXStack &note)
Definition QNXStack.hpp:59
std::unique_ptr< Note > clone() const override
Clone the current note and keep its polymorphic type.
Definition QNXStack.hpp:31
void dump(std::ostream &os) const override
uint32_t stack_allocated() const
Size of the stack pre-allocated (upfront)
uint32_t stack_size() const
Size of the stack.
void stack_allocated(uint32_t value)
void accept(Visitor &visitor) const override
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41