LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
UnknownCommand.hpp
Go to the documentation of this file.
1/* Copyright 2024 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_MACHO_UNKNOWN_COMMAND_H
16#define LIEF_MACHO_UNKNOWN_COMMAND_H
17#include <ostream>
18
19#include "LIEF/visibility.h"
20
22
23namespace LIEF {
24namespace MachO {
25
26namespace details {
27struct load_command;
28}
29
30
33
34 public:
35 UnknownCommand() = delete;
36 UnknownCommand(const details::load_command& command) :
38 original_command_(static_cast<uint64_t>(command_)) {
40 }
41
42 UnknownCommand& operator=(const UnknownCommand& copy) = default;
43 UnknownCommand(const UnknownCommand& copy) = default;
44
45 std::unique_ptr<LoadCommand> clone() const override {
46 return std::unique_ptr<UnknownCommand>(new UnknownCommand(*this));
47 }
48
49 ~UnknownCommand() override = default;
50
52 uint64_t original_command() const {
53 return original_command_;
54 }
55
56 void accept(Visitor& visitor) const override;
57
58 std::ostream& print(std::ostream& os) const override;
59
60 static bool classof(const LoadCommand* cmd) {
62 }
63
64 private:
65 uint64_t original_command_ = 0;
66};
67
68}
69}
70#endif
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:128
@ LIEF_UNKNOWN
Definition LoadCommand.hpp:106
UnknownCommand(const details::load_command &command)
Definition UnknownCommand.hpp:36
void accept(Visitor &visitor) const override
uint64_t original_command() const
The original LC_ int that is not supported by LIEF.
Definition UnknownCommand.hpp:52
UnknownCommand & operator=(const UnknownCommand &copy)=default
std::unique_ptr< LoadCommand > clone() const override
Definition UnknownCommand.hpp:45
std::ostream & print(std::ostream &os) const override
static bool classof(const LoadCommand *cmd)
Definition UnknownCommand.hpp:60
UnknownCommand(const UnknownCommand &copy)=default
~UnknownCommand() override=default
Definition Visitor.hpp:212
Definition endianness_support.hpp:60
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43