mirror of
https://github.com/QuasarApp/LIEF.git
synced 2025-04-29 13:54:33 +00:00
Binding and rebase bytes codes are now parsed as well as export info trie. Through ``RelocationDyld`` we created kind of *virtual* relocation to modeling relocation process performed by Dyld API Changes (Python / C++) * MachO::RelocationDyld - Added * MachO::RelocationObject - Added * MachO::Relocation - Updated according to previous ones * MachO::ExportInfo - Added * MachO::BindingInfo - Added * MachO::DyldInfo::rebase_opcodes - Added * MachO::DyldInfo::bindings - Added * MachO::DyldInfo::bind_opcodes - Added * MachO::DyldInfo::weak_bind_opcodes - Added * MachO::DyldInfo::lazy_bind_opcodes - Added * MachO::DyldInfo::exports - Added * MachO::DyldInfo::export_trie - Added * MachO::Symbol - Tied to MachO::BindingInfo (if any) - Tied to MachO::ExportInfo (if any) * MachO::Binary::relocations - Added * MachO::Binary::has_symbol - Added * MachO::Binary::get_symbol - Added Resolve: #67
76 lines
2.7 KiB
C++
76 lines
2.7 KiB
C++
/* Copyright 2017 R. Thomas
|
|
* Copyright 2017 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 "pyLIEF.hpp"
|
|
#include "pyIterators.hpp"
|
|
|
|
#include "LIEF/PE/signature/types.hpp"
|
|
|
|
void init_LIEF_iterators(py::module& m) {
|
|
// Abstract
|
|
// ========
|
|
init_ref_iterator<LIEF::it_sections>(m);
|
|
init_ref_iterator<LIEF::it_symbols>(m);
|
|
|
|
// ELF
|
|
// ===
|
|
#if defined(LIEF_ELF_MODULE)
|
|
init_ref_iterator<LIEF::ELF::it_sections>(m);
|
|
init_ref_iterator<LIEF::ELF::it_segments>(m);
|
|
init_ref_iterator<LIEF::ELF::it_dynamic_entries>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols>(m);
|
|
init_ref_iterator<LIEF::filter_iterator<LIEF::ELF::relocations_t>>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols_version>(m);
|
|
init_ref_iterator<LIEF::ELF::it_relocations>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols_version_requirement>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols_version_definition>(m);
|
|
init_ref_iterator<LIEF::filter_iterator<LIEF::ELF::symbols_t>>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols_version_aux>(m);
|
|
init_ref_iterator<LIEF::ELF::it_symbols_version_aux_requirement>(m);
|
|
init_ref_iterator<LIEF::ELF::it_notes>(m);
|
|
#endif
|
|
|
|
// PE
|
|
// ==
|
|
#if defined(LIEF_PE_MODULE)
|
|
init_ref_iterator<LIEF::PE::it_sections>(m);
|
|
init_ref_iterator<LIEF::PE::it_data_directories>(m);
|
|
init_ref_iterator<LIEF::PE::it_relocations>(m);
|
|
init_ref_iterator<LIEF::PE::it_imports>(m);
|
|
init_ref_iterator<LIEF::PE::it_import_entries>(m);
|
|
init_ref_iterator<LIEF::PE::it_export_entries>(m);
|
|
init_ref_iterator<LIEF::PE::it_symbols>(m);
|
|
init_ref_iterator<LIEF::PE::it_const_crt>(m);
|
|
init_ref_iterator<LIEF::PE::it_childs>(m);
|
|
init_ref_iterator<LIEF::PE::it_rich_entries>(m);
|
|
#endif
|
|
|
|
|
|
// MachO
|
|
// =====
|
|
#if defined(LIEF_MACHO_MODULE)
|
|
init_ref_iterator<LIEF::MachO::it_relocations>(m);
|
|
init_ref_iterator<LIEF::MachO::it_commands>(m);
|
|
init_ref_iterator<LIEF::MachO::it_symbols>(m);
|
|
init_ref_iterator<LIEF::filter_iterator<LIEF::MachO::symbols_t>>(m);
|
|
init_ref_iterator<LIEF::MachO::it_libraries>(m);
|
|
init_ref_iterator<LIEF::MachO::it_segments>(m);
|
|
init_ref_iterator<LIEF::MachO::it_sections>(m);
|
|
init_ref_iterator<LIEF::MachO::it_binding_info>(m);
|
|
init_ref_iterator<LIEF::MachO::it_export_info>(m);
|
|
#endif
|
|
|
|
}
|