Skip to content

Instantly share code, notes, and snippets.

@CodeAsm
Forked from phracker/unpackxip.md
Last active September 28, 2023 22:16
Show Gist options
  • Save CodeAsm/fcb2ec55e45afcd68d2e30084ac9270c to your computer and use it in GitHub Desktop.
Save CodeAsm/fcb2ec55e45afcd68d2e30084ac9270c to your computer and use it in GitHub Desktop.
Unpack XIP on Linux

Unpacking XIP files on Linux:

  1. Install xar from https://mackyle.github.io/xar/ or install from AUR: yay -S xar pbzx (skip step 2 now)
  2. Install pbzx from https://github.com/NiklasRosenstein/pbzx (use gcc -llzma -lxar -I /usr/local/include pbzx.c -o pbzx and copy the binary into your PATH)
  3. use xar -xf XIP_FILE -C /path/to/extract/to
  4. Change to the directory where you extracted the file.
  5. Use pbzx -n Content | cpio -i to extract the contents.

OR:

Alternatively, with less patching & compiling required: use the tool developed by bitcoin

https://github.com/bitcoin-core/apple-sdk-tools

python extract_xcode.py -f Xcode_11.3.1.xip | cpio -d -i

https://gist.github.com/phracker/1944ce190e01963c550566b749bd2b54?permalink_comment_id=4549014#gistcomment-4549014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment