Skip to content

Commit

Permalink
Handles Mach-O magic
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Oct 14, 2024
1 parent 5cd1877 commit 5a8fbd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions macros/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ impl Metadata {

if mem.starts_with(b"\x7FELF") {
Self::parse_elf(&mut types)?;
} else if mem.starts_with(&0xFEEDFACFu32.to_le_bytes()) {
Self::parse_macho(&mut types)?;
} else {
return Err(MetadataError::UnknownMember(
mem.iter().take(4).map(|v| *v).collect(),
Expand All @@ -50,6 +52,10 @@ impl Metadata {
fn parse_elf(_: &mut HashMap<String, TypeInfo>) -> Result<(), MetadataError> {
todo!("ELF parser")
}

fn parse_macho(_: &mut HashMap<String, TypeInfo>) -> Result<(), MetadataError> {
todo!("Mach-O parser");
}
}

/// Represents an error when [`Metadata`] fails to load.
Expand Down

0 comments on commit 5a8fbd0

Please sign in to comment.