LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
MachO/hash.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_MACHO_HASH_H
17#define LIEF_MACHO_HASH_H
18
19#include "LIEF/visibility.h"
20#include "LIEF/hash.hpp"
21
22namespace LIEF {
23namespace MachO {
24
25class Binary;
26class BindingInfo;
27class BuildToolVersion;
28class BuildVersion;
29class ChainedBindingInfo;
30class CodeSignature;
31class CodeSignatureDir;
32class DataCodeEntry;
33class DataInCode;
34class DyldBindingInfo;
35class DyldEnvironment;
36class DyldExportsTrie;
37class DylibCommand;
38class DylinkerCommand;
39class DynamicSymbolCommand;
40class EncryptionInfo;
41class ExportInfo;
42class FilesetCommand;
43class FunctionStarts;
44class Header;
45class LinkerOptHint;
46class LoadCommand;
47class MainCommand;
48class RPathCommand;
49class Relocation;
50class RelocationDyld;
51class RelocationFixup;
52class RelocationObject;
53class Section;
54class SegmentCommand;
55class SegmentSplitInfo;
56class SourceVersion;
57class SubFramework;
58class Symbol;
59class SymbolCommand;
60class ThreadCommand;
61class TwoLevelHints;
62class UUIDCommand;
63class VersionMin;
64class UnknownCommand;
65
68class LIEF_API Hash : public LIEF::Hash {
69 public:
71
72 public:
73 using LIEF::Hash::Hash;
75
76 public:
77 void visit(const Binary& binary) override;
78 void visit(const BindingInfo& binding) override;
79 void visit(const BuildToolVersion& e) override;
80 void visit(const BuildVersion& e) override;
81 void visit(const ChainedBindingInfo& binding) override;
82 void visit(const CodeSignature& cs) override;
83 void visit(const CodeSignatureDir& e) override;
84 void visit(const DataCodeEntry& dce) override;
85 void visit(const DataInCode& dic) override;
86 void visit(const DyldBindingInfo& binding) override;
87 void visit(const DyldEnvironment& sf) override;
88 void visit(const DyldExportsTrie& trie) override;
89 void visit(const DylibCommand& dylib) override;
90 void visit(const DylinkerCommand& dylinker) override;
91 void visit(const DynamicSymbolCommand& dynamic_symbol) override;
92 void visit(const EncryptionInfo& e) override;
93 void visit(const ExportInfo& einfo) override;
94 void visit(const FilesetCommand& e) override;
95 void visit(const FunctionStarts& fs) override;
96 void visit(const Header& header) override;
97 void visit(const LinkerOptHint& e) override;
98 void visit(const LoadCommand& cmd) override;
99 void visit(const MainCommand& maincmd) override;
100 void visit(const RPathCommand& rpath) override;
101 void visit(const Relocation& relocation) override;
102 void visit(const RelocationDyld& rdyld) override;
103 void visit(const RelocationFixup& fixup) override;
104 void visit(const RelocationObject& robject) override;
105 void visit(const Section& section) override;
106 void visit(const SegmentCommand& segment) override;
107 void visit(const SegmentSplitInfo& ssi) override;
108 void visit(const SourceVersion& sv) override;
109 void visit(const SubFramework& sf) override;
110 void visit(const Symbol& symbol) override;
111 void visit(const SymbolCommand& symbol) override;
112 void visit(const ThreadCommand& threadcmd) override;
113 void visit(const TwoLevelHints& e) override;
114 void visit(const UUIDCommand& uuid) override;
115 void visit(const VersionMin& vmin) override;
116 void visit(const UnknownCommand& ukn) override;
117
118 ~Hash() override;
119};
120
121}
122}
123
124#endif
Definition hash.hpp:31
size_t value_type
Definition hash.hpp:33
virtual void visit(const Object &)
Class which represents a MachO binary.
Definition MachO/Binary.hpp:77
Class that provides an interface over a binding operation.
Definition BindingInfo.hpp:38
Class that represents a tool's version that was involved in the build of the binary.
Definition BuildToolVersion.hpp:34
Definition BuildVersion.hpp:34
This class represents a symbol binding operation associated with the LC_DYLD_CHAINED_FIXUPS command.
Definition ChainedBindingInfo.hpp:46
Definition CodeSignatureDir.hpp:36
Definition CodeSignature.hpp:37
Interface over an entry in the DataInCode command.
Definition DataCodeEntry.hpp:33
Interface of the LC_DATA_IN_CODE command This command is used to list slices of code sections that co...
Definition DataInCode.hpp:42
This class represents a symbol binding operation associated with the LC_DYLD_INFO bytecode.
Definition DyldBindingInfo.hpp:34
Class that represents a LC_DYLD_ENVIRONMENT command which is used by the Mach-O linker/loader to init...
Definition DyldEnvironment.hpp:34
Class that represents the LC_DYLD_EXPORTS_TRIE command.
Definition DyldExportsTrie.hpp:40
Class which represents a library dependency.
Definition DylibCommand.hpp:34
Class that represents the Mach-O linker, also named loader. Most of the time, DylinkerCommand::name()...
Definition DylinkerCommand.hpp:34
Class that represents the LC_DYSYMTAB command.
Definition DynamicSymbolCommand.hpp:39
Class that represents the LC_ENCRYPTION_INFO / LC_ENCRYPTION_INFO_64 commands.
Definition EncryptionInfo.hpp:35
Class that provides an interface over the Dyld export info.
Definition ExportInfo.hpp:38
Class associated with the LC_FILESET_ENTRY commands.
Definition FilesetCommand.hpp:35
Class which represents the LC_FUNCTION_STARTS command.
Definition FunctionStarts.hpp:39
Class which implements a visitor to compute a deterministic hash for LIEF MachO objects.
Definition MachO/hash.hpp:68
void visit(const DylibCommand &dylib) override
Method to visit a LIEF::MachO::DylibCommand.
void visit(const RelocationObject &robject) override
Method to visit a LIEF::MachO::RelocationObject.
void visit(const RPathCommand &rpath) override
Method to visit a LIEF::MachO::RPathCommand.
void visit(const MainCommand &maincmd) override
Method to visit a LIEF::MachO::MainCommand.
void visit(const DyldEnvironment &sf) override
Method to visit a LIEF::MachO::DyldEnvironment.
void visit(const UUIDCommand &uuid) override
Method to visit a LIEF::MachO::UUIDCommand.
void visit(const EncryptionInfo &e) override
Method to visit a LIEF::MachO::DyldEnvironment.
void visit(const RelocationDyld &rdyld) override
Method to visit a LIEF::MachO::RelocationDyld.
void visit(const DataCodeEntry &dce) override
Method to visit a LIEF::MachO::DataCodeEntry.
void visit(const CodeSignatureDir &e) override
Method to visit a LIEF::MachO::CodeSignatureDir.
void visit(const BuildVersion &e) override
Method to visit a LIEF::MachO:BuildVersion:
void visit(const BindingInfo &binding) override
Method to visit a LIEF::MachO::BindingInfo.
void visit(const SymbolCommand &symbol) override
Method to visit a LIEF::MachO::SymbolCommand.
void visit(const DyldExportsTrie &trie) override
Method to visit a LIEF::MachO::DyldExportsTrie.
void visit(const ThreadCommand &threadcmd) override
Method to visit a LIEF::MachO::ThreadCommand.
static LIEF::Hash::value_type hash(const Object &obj)
void visit(const Binary &binary) override
Method to visit a LIEF::MachO::Binary.
void visit(const FunctionStarts &fs) override
Method to visit a LIEF::MachO::FunctionStarts.
void visit(const SubFramework &sf) override
Method to visit a LIEF::MachO::SubFramework.
void visit(const VersionMin &vmin) override
Method to visit a LIEF::MachO::VersionMin.
void visit(const DyldBindingInfo &binding) override
Method to visit a LIEF::MachO::DyldBindingInfo.
void visit(const Relocation &relocation) override
Method to visit a LIEF::MachO::Relocation.
void visit(const DataInCode &dic) override
Method to visit a LIEF::MachO::DataInCode.
void visit(const Header &header) override
Method to visit a LIEF::MachO::Header.
void visit(const Section &section) override
Method to visit a LIEF::MachO::Section.
void visit(const CodeSignature &cs) override
Method to visit a LIEF::MachO::CodeSignature.
void visit(const ExportInfo &einfo) override
Method to visit a LIEF::MachO::ExportInfo.
~Hash() override
void visit(const DylinkerCommand &dylinker) override
Method to visit a LIEF::MachO::DylinkerCommand.
void visit(const RelocationFixup &fixup) override
Method to visit a LIEF::MachO::RelocationFixup.
void visit(const BuildToolVersion &e) override
Method to visit a LIEF::MachO:BuildToolVersion:
void visit(const SourceVersion &sv) override
Method to visit a LIEF::MachO::SourceVersion.
void visit(const UnknownCommand &ukn) override
Method to visit a LIEF::MachO::UnknownCommand.
void visit(const ChainedBindingInfo &binding) override
Method to visit a LIEF::MachO::ChainedBindingInfo.
void visit(const LoadCommand &cmd) override
Method to visit a LIEF::MachO::LoadCommand.
void visit(const Symbol &symbol) override
Method to visit a LIEF::MachO::Symbol.
void visit(const SegmentCommand &segment) override
Method to visit a LIEF::MachO::SegmentCommand.
void visit(const SegmentSplitInfo &ssi) override
Method to visit a LIEF::MachO::SegmentSplitInfo.
void visit(const LinkerOptHint &e) override
Method to visit a LIEF::MachO::LinkerOptHint.
void visit(const FilesetCommand &e) override
Method to visit a LIEF::MachO:BuildToolVersion:
void visit(const TwoLevelHints &e) override
Method to visit a LIEF::MachO::TwoLevelHints.
void visit(const DynamicSymbolCommand &dynamic_symbol) override
Method to visit a LIEF::MachO::DynamicSymbolCommand.
Class that represents the Mach-O header.
Definition MachO/Header.hpp:41
Class which represents the LC_LINKER_OPTIMIZATION_HINT command.
Definition LinkerOptHint.hpp:37
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
Class that represent the LC_MAIN command. This kind of command can be used to determine the entrypoin...
Definition MainCommand.hpp:33
Class that represents the LC_RPATH command.
Definition RPathCommand.hpp:36
Class that represents a relocation found in the DyldInfo structure.
Definition RelocationDyld.hpp:33
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command.
Definition RelocationFixup.hpp:49
Class that represents a relocation presents in the MachO object file (.o). Usually,...
Definition RelocationObject.hpp:38
Class that represents a Mach-O relocation.
Definition MachO/Relocation.hpp:40
Class that represents a Mach-O section.
Definition MachO/Section.hpp:44
Class which represents a LoadCommand::TYPE::SEGMENT / LoadCommand::TYPE::SEGMENT_64 command.
Definition SegmentCommand.hpp:48
Class that represents the LoadCommand::TYPE::SEGMENT_SPLIT_INFO command.
Definition SegmentSplitInfo.hpp:35
Class that represents the MachO LoadCommand::TYPE::SOURCE_VERSION This command is used to provide the...
Definition SourceVersion.hpp:35
Class that represents the SubFramework command. Accodring to the Mach-O loader.h documentation:
Definition SubFramework.hpp:46
Class that represents the LC_SYMTAB command.
Definition SymbolCommand.hpp:35
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:47
Class that represents the LC_THREAD / LC_UNIXTHREAD commands and that can be used to get the binary e...
Definition ThreadCommand.hpp:41
Class which represents the LC_TWOLEVEL_HINTS command.
Definition TwoLevelHints.hpp:39
Class that represents the UUID command.
Definition UUIDCommand.hpp:35
Generic class when the command is not recognized by LIEF.
Definition UnknownCommand.hpp:32
Class that wraps the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, ... commands.
Definition VersionMin.hpp:33
Definition Object.hpp:25
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41