mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
Add is_pdb helper
This commit is contained in:
@@ -6,5 +6,6 @@ target_sources(pyLIEF PRIVATE
|
||||
pyFunction.cpp
|
||||
pyPublicSymbol.cpp
|
||||
pyType.cpp
|
||||
pyUtils.cpp
|
||||
)
|
||||
add_subdirectory(types)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
|
||||
namespace LIEF::pdb::py {
|
||||
void init(nb::module_& m);
|
||||
void init_utils(nb::module_& m);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user