mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
Add Mach-O UnknownCommand.
This command is a placeholder when LIEF does not a Mach-O load command
This commit is contained in:
@@ -1,46 +1,47 @@
|
||||
target_sources(pyLIEF PRIVATE
|
||||
pyDylibCommand.cpp
|
||||
pyBinary.cpp
|
||||
pyBindingInfo.cpp
|
||||
pyBuildVersion.cpp
|
||||
pyBuilder.cpp
|
||||
pyChainedBindingInfo.cpp
|
||||
pyCodeSignature.cpp
|
||||
pyCodeSignatureDir.cpp
|
||||
pyDataCodeEntry.cpp
|
||||
pyDataInCode.cpp
|
||||
pyDyldBindingInfo.cpp
|
||||
pyDyldChainedFixups.cpp
|
||||
pyDyldEnvironment.cpp
|
||||
pyDyldExportsTrie.cpp
|
||||
pyDyldInfo.cpp
|
||||
pyDylibCommand.cpp
|
||||
pyDylinker.cpp
|
||||
pyDynamicSymbolCommand.cpp
|
||||
pyEncryptionInfo.cpp
|
||||
pyExportInfo.cpp
|
||||
pyFatBinary.cpp
|
||||
pyLoadCommand.cpp
|
||||
pySegmentCommand.cpp
|
||||
pyFilesetCommand.cpp
|
||||
pyFunctionStarts.cpp
|
||||
pyHeader.cpp
|
||||
pySection.cpp
|
||||
pyLinkerOptHint.cpp
|
||||
pyLoadCommand.cpp
|
||||
pyMainCommand.cpp
|
||||
pyParser.cpp
|
||||
pyParserConfig.cpp
|
||||
pyRPathCommand.cpp
|
||||
pyRelocation.cpp
|
||||
pyRelocationDyld.cpp
|
||||
pyRelocationFixup.cpp
|
||||
pyRelocationObject.cpp
|
||||
pySection.cpp
|
||||
pySegmentCommand.cpp
|
||||
pySegmentSplitInfo.cpp
|
||||
pySourceVersion.cpp
|
||||
pySubFramework.cpp
|
||||
pySymbol.cpp
|
||||
pySymbolCommand.cpp
|
||||
pyUUID.cpp
|
||||
pySourceVersion.cpp
|
||||
pyVersionMin.cpp
|
||||
pyMainCommand.cpp
|
||||
pyDylinker.cpp
|
||||
pyDyldInfo.cpp
|
||||
pyDyldChainedFixups.cpp
|
||||
pyChainedBindingInfo.cpp
|
||||
pyDyldBindingInfo.cpp
|
||||
pyDyldExportsTrie.cpp
|
||||
pyRelocationFixup.cpp
|
||||
pyFunctionStarts.cpp
|
||||
pyRelocation.cpp
|
||||
pyRelocationObject.cpp
|
||||
pyRelocationDyld.cpp
|
||||
pyBindingInfo.cpp
|
||||
pyExportInfo.cpp
|
||||
pyThreadCommand.cpp
|
||||
pyRPathCommand.cpp
|
||||
pyParserConfig.cpp
|
||||
pyDynamicSymbolCommand.cpp
|
||||
pyCodeSignature.cpp
|
||||
pySegmentSplitInfo.cpp
|
||||
pyDataInCode.cpp
|
||||
pyDataCodeEntry.cpp
|
||||
pySubFramework.cpp
|
||||
pyDyldEnvironment.cpp
|
||||
pyEncryptionInfo.cpp
|
||||
pyBuildVersion.cpp
|
||||
pyFilesetCommand.cpp
|
||||
pyCodeSignatureDir.cpp
|
||||
pyTwoLevelHints.cpp
|
||||
pyLinkerOptHint.cpp
|
||||
pyBuilder.cpp
|
||||
pyUUID.cpp
|
||||
pyUnknownCommand.cpp
|
||||
pyVersionMin.cpp
|
||||
)
|
||||
|
||||
@@ -116,6 +116,7 @@ void create<LoadCommand>(nb::module_& m) {
|
||||
.value(PY_ENUM(LoadCommand::TYPE::DYLD_EXPORTS_TRIE))
|
||||
.value(PY_ENUM(LoadCommand::TYPE::DYLD_CHAINED_FIXUPS))
|
||||
.value(PY_ENUM(LoadCommand::TYPE::FILESET_ENTRY))
|
||||
.value(PY_ENUM(LoadCommand::TYPE::LIEF_UNKNOWN))
|
||||
#undef PY_ENUM
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/* Copyright 2017 - 2024 R. Thomas
|
||||
* Copyright 2017 - 2024 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <nanobind/stl/string.h>
|
||||
#include <nanobind/stl/array.h>
|
||||
|
||||
#include "LIEF/MachO/UnknownCommand.hpp"
|
||||
|
||||
#include "MachO/pyMachO.hpp"
|
||||
|
||||
namespace LIEF::MachO::py {
|
||||
|
||||
template<>
|
||||
void create<UnknownCommand>(nb::module_& m) {
|
||||
|
||||
nb::class_<UnknownCommand, LoadCommand>(m, "UnknownCommand",
|
||||
"Generic class when the command is not recognized by LIEF"_doc)
|
||||
|
||||
.def_prop_ro("original_command",
|
||||
nb::overload_cast<>(&UnknownCommand::original_command, nb::const_))
|
||||
|
||||
LIEF_DEFAULT_STR(UnknownCommand);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user