Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing Mach-O magic bytes #136

Closed
wants to merge 1 commit into from
Closed

Add missing Mach-O magic bytes #136

wants to merge 1 commit into from

Conversation

jan-br
Copy link
Contributor

@jan-br jan-br commented Jan 22, 2024

As in #132 introduced, the scanning for Mach-O files to sign was not implemented correctly. It is missing two magic byte combinations which are required for signing core dumps and electron binaries on x86 macos devices. Not sure why, but it seems they have their own magic bytes there

@jan-br jan-br marked this pull request as draft January 22, 2024 21:51
@@ -90,8 +90,15 @@ pub(crate) fn package(ctx: &Context) -> crate::Result<Vec<PathBuf>> {
let mut buffer = [0; 4];
std::io::Read::read_exact(&mut open_file, &mut buffer)?;

const MACH_O_MAGIC_NUMBERS: [u32; 5] =
[0xfeedface, 0xfeedfacf, 0xcafebabe, 0xcefaedfe, 0xcffaedfe];
const MACH_O_MAGIC_NUMBERS: [u32; 5] = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with [u32; 7]

@jan-br
Copy link
Contributor Author

jan-br commented Jan 24, 2024

I misinterpreted some debugging results, this isn't necessary, Sorry

@jan-br jan-br closed this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants