1
0
Fork
You've already forked zacho
0
Like otool but written from scratch in Zig
  • Zig 98.7%
  • Nix 1.3%
Find a file
2026年01月13日 07:10:21 +01:00
.github/workflows Update CI to use Zig master 2025年07月29日 07:27:18 +02:00
src Add some minor fixes wrt vm_prot_t changes 2026年01月12日 08:15:52 +01:00
.envrc Add nix support 2024年12月27日 11:45:37 +01:00
.gitignore Introduce jj 2026年01月09日 10:07:05 +01:00
.gitmodules zacho: remove clap dependency 2023年12月06日 12:11:25 +01:00
build.zig Update to latest zig 2026年01月11日 22:12:16 +01:00
build.zig.zon Update to latest zig 2026年01月11日 22:12:16 +01:00
flake.lock Update nix flake 2026年01月13日 07:10:21 +01:00
flake.nix Update nix 2026年01月12日 07:20:16 +01:00
LICENSE Add readme and license 2020年08月26日 21:37:26 +02:00
README.md Update README 2026年01月06日 23:58:17 +01:00
shell.nix Add nix support 2024年12月27日 11:45:37 +01:00

zacho

...or Zig's Mach-O parser. This project started off as a dummy scratchpad for reinforcing my understanding of the Mach-O file format while I was working on the Zig's stage2 Mach-O linker (I still am working on it, in case anyone was asking).

My current vision for zacho is for it to be a cross-platform version of otool and pagestuff macOS utilities. These seem to be very useful when battling the Darwin kernel and dyld when those refuse to load your hand-crafter binary, or you just like looking at Mach-O dissected output.

Usage

Usage: zacho [options] file
General options:
-c, --code-signature Print the contents of code signature (if any)
-d, --dyld-info Print the contents of dyld rebase and bind opcodes
-e, --exports-trie Print export trie (if any)
-h, --header Print the Mach-O header
-i, --indirect-symbol-table Print the indirect symbol table
-l, --load-commands Print load commands
-r, --relocations Print relocation entries (if any)
-s, --symbol-table Print the symbol table
-u, --unwind-info Print the contents of (compact) unwind info section (if any)
-v, --verbose Print more detailed info for each flag
--archive-index Print archive index (if any)
--string-table Print the string table
--data-in-code Print data-in-code entries (if any)
--chained-fixups Print chained fixups (if any)
--hex-dump=[name] Dump section contents as bytes
--string-dump=[name] Dump section contents as strings
--verify-memory-layout Print virtual memory layout and verify there is no overlap
--help Display this help and exit

Building from source

Building from source requires nightly Zig.

$ git clone https://github.com/kubkon/zacho.git
$ zig build

Additionally, on macOS, you will need to provide Foundation and Security frameworks.