WINSDK / bite

Disassembler focused on comprehensive rust support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't dissasemble macOS executables: "Bad CPU type in executable"

anta40 opened this issue · comments

I'm on macOS Monterey (x86-64). Build bite using:
cargo build --release

OK let's try this simple C code:

#include <stdio.h>

int main(void){
    for (int x = 1; x <= 10; x++){
        printf("Hi this is loop #%d\n", x);
    }

    return 0;
}

Built it with Apple's clang (installed via xcode-select --install)
$ make blah

So... what is blah?

$ file blah
blah: Mach-O 64-bit executable x86_64

Looks good. Let's try poking it with bite

./bite -D blah
Failed to parse dwarf info: 'Loading(Os { code: 86, kind: Uncategorized, message: "Bad CPU type in executable" })'.

This is because bite is only bundling llvm-dsymutil for Aarch64. I'll try to bundle it for x86_64 too.

Try building 11-cant-dissasemble-macos-executables-bad-cpu-type-in-executable.
I've added a x86_64 build of llvm-dsymutil to it.

Closing this for now as 11-cant-dissasemble-macos-executables-bad-cpu-type-in-executable should have fixed this issue.

Yep, after pulling the update, disassembling x86-64 executables works fine.