mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
Add Mach-O symbol stubs iterator
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <nanobind/stl/string.h>
|
||||
#include <nanobind/stl/unique_ptr.h>
|
||||
#include "nanobind/extra/memoryview.hpp"
|
||||
#include "nanobind/extra/random_access_iterator.hpp"
|
||||
|
||||
#include "LIEF/MachO/Binary.hpp"
|
||||
#include "LIEF/MachO/BuildVersion.hpp"
|
||||
@@ -65,7 +66,6 @@
|
||||
#include "pyIterator.hpp"
|
||||
|
||||
namespace LIEF::MachO::py {
|
||||
|
||||
template<>
|
||||
void create<Binary>(nb::module_& m) {
|
||||
using namespace LIEF::py;
|
||||
@@ -680,6 +680,21 @@ void create<Binary>(nb::module_& m) {
|
||||
)doc"_doc
|
||||
)
|
||||
|
||||
.def_prop_ro("symbol_stubs",
|
||||
[] (const Binary& self) {
|
||||
auto stubs = self.symbol_stubs();
|
||||
return nb::make_random_access_iterator(nb::type<Binary>(), "stub_iterator", stubs);
|
||||
}, nb::keep_alive<0, 1>(),
|
||||
R"doc(
|
||||
Return an iterator over the symbol stubs.
|
||||
|
||||
These stubs are involved when calling an **imported** function and are
|
||||
similar to the ELF's plt/got mechanism.
|
||||
|
||||
There are located in sections like: ``__stubs,__auth_stubs,__symbol_stub,__picsymbolstub4``
|
||||
)doc"_doc
|
||||
)
|
||||
|
||||
.def_prop_ro("has_nx_heap", &Binary::has_nx_heap,
|
||||
R"doc(
|
||||
Return True if the **heap** is flagged as non-executable. False
|
||||
|
||||
Reference in New Issue
Block a user