Skip to content

Instantly share code, notes, and snippets.

View lkocman's full-sized avatar

Lubos Kocman lkocman

View GitHub Profile
@lkocman
lkocman / parse_pbzx2.py
Created March 17, 2016 09:45 — forked from pudquick/parse_pbzx2.py
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys