Skip to main content

Crate kh_loader

Crate kh_loader 

Source
Expand description

Mach-O loading, image planning, and process session orchestration.

Depends on kh-runtime for page geometry and register types. Must not depend on kh-cli.

Re-exports§

pub use bind::BindResolveCache;
pub use bind::BindSite;
pub use bind::bind_process;
pub use bind::collect_bind_sites;
pub use bind::encode_pointer_bind;
pub use chained::ChainDecode;
pub use chained::ChainedImport;
pub use chained::DYLD_CHAINED_PTR_64;
pub use chained::DYLD_CHAINED_PTR_64_OFFSET;
pub use chained::apply_chained_fixups;
pub use chained::bytes_have_chained_fixups;
pub use chained::decode_ptr_64;
pub use chained::encode_chained_fixups_blob;
pub use chained::encode_ptr_64_bind;
pub use chained::encode_ptr_64_rebase;
pub use chained::image_has_chained_fixups;
pub use deps::DepEdge;
pub use deps::MAX_DYLIBS;
pub use deps::is_followable;
pub use error::LoadError;
pub use execute::RunOptions;
pub use execute::RunResult;
pub use execute::run_micro;
pub use file_image::FileImage;
pub use image::DylibDep;
pub use image::DylibKind;
pub use image::ImagePlan;
pub use image::LoadCommandInfo;
pub use image::MachOImage;
pub use image::MachOSummary;
pub use image::PlannedMapping;
pub use image::SectionInfo;
pub use image::SegmentInfo;
pub use init::InitFunc;
pub use init::S_INIT_FUNC_OFFSETS;
pub use init::S_MOD_INIT_FUNC_POINTERS;
pub use init::collect_mod_init;
pub use init::plan_initializers;
pub use init::run_initializers;
pub use link::DefinedSymbol;
pub use link::UndefinedSymbol;
pub use link::defined_exports;
pub use link::undefined_imports;
pub use parse::Arm64Slice;
pub use parse::locate_arm64_slice;
pub use parse::parse_bytes;
pub use parse::parse_path;
pub use parse::read_thin_arm64;
pub use parse::thin_arm64_bytes;
pub use rebase::S_INTERPOSING;
pub use rebase::S_LITERAL_POINTERS;
pub use rebase::S_MOD_TERM_FUNC_POINTERS;
pub use rebase::is_rebasable_section_type;
pub use rebase::rebase_image;
pub use rebase::rebase_memory;
pub use rebase::rebase_process;
pub use resolve::ResolveContext;
pub use resolve::ResolveError;
pub use resolve::resolve_install_name;
pub use session::DryLoadImageInfo;
pub use session::DryLoadReport;
pub use session::ImageLoadStatus;
pub use session::ImageRole;
pub use session::LoadSession;
pub use session::MappedRegionInfo;
pub use session::ProcessImage;
pub use session::SkipReason;
pub use session::map_requests_from_plan;

Modules§

bind
Classic dyld bind opcodes (LC_DYLD_INFO / LC_DYLD_INFO_ONLY).
chained
Dyld chained fixups (LC_DYLD_CHAINED_FIXUPS).
deps
Dependency walk helpers for multi-image load (Phase 6 dyld-lite).
error
Loader and image-planning errors.
execute
Micro execution: map, patch traps, bootstrap stack, jump to entry.
file_image
On-disk Mach-O container bytes for parse → map → bind.
image
Owned Mach-O views and image planning types.
init
Load-time initializers (S_MOD_INIT_FUNC_POINTERS / S_INIT_FUNC_OFFSETS).
link
Nlist export/import extraction and nlist→GOT fallback bind.
load_timing
Opt-in load-path phase timings (KAKEHASHI_LOAD_TIMING).
missing_stub
Per-import AArch64 trampolines for unresolved strong symbols.
parse
Mach-O arm64 parsing via goblin (thin + fat).
rebase
In-place rebase of absolute pointer arrays after image slide.
resolve
Install-name → host path resolution with a map allowlist.
session
Load session: ties a bottle root, page layout, planned images, and maps.