Add is_pdb helper

This commit is contained in:
Romain Thomas
2025-08-05 21:49:32 +02:00
parent f1c908976b
commit adf7266284
16 changed files with 126 additions and 1 deletions
+1
View File
@@ -6,5 +6,6 @@ target_sources(pyLIEF PRIVATE
pyFunction.cpp
pyPublicSymbol.cpp
pyType.cpp
pyUtils.cpp
)
add_subdirectory(types)
+1
View File
@@ -17,6 +17,7 @@ void init(nb::module_& m) {
Load the PDB from the given path
)doc"_doc, "path"_a
);
init_utils(m);
create<LIEF::pdb::BuildMetadata>(pdb);
create<LIEF::pdb::Type>(pdb);
+1
View File
@@ -4,5 +4,6 @@
namespace LIEF::pdb::py {
void init(nb::module_& m);
void init_utils(nb::module_& m);
}
#endif
+29
View File
@@ -0,0 +1,29 @@
/* Copyright 2025 R. Thomas
* Copyright 2025 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 "PDB/pyPDB.hpp"
#include "LIEF/PDB/utils.hpp"
#include <nanobind/stl/string.h>
namespace LIEF::pdb::py {
void init_utils(nb::module_& m) {
lief_mod->def("is_pdb", nb::overload_cast<const std::string&>(&is_pdb),
"Check if the given file is a ``PDB``"_doc,
"file"_a
);
}
}