Skip to content

Instantly share code, notes, and snippets.

View Jeremy-D-Miller's full-sized avatar

Jeremy D. Miller Jeremy-D-Miller

View GitHub Profile
@Jeremy-D-Miller
Jeremy-D-Miller / parse_pbzx2.py
Created October 28, 2015 06:42 — 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
@Jeremy-D-Miller
Jeremy-D-Miller / parse_pbzx.py
Created October 28, 2015 06:42 — forked from pudquick/parse_pbzx.py
Pure python reimplementation of .cpio.xz content extraction from pbzx file payload for OS X packages
# 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
# Example usage:
# parse_pbzx('PayloadJava', 'PayloadJava.cpio.xz')
import struct
@Jeremy-D-Miller
Jeremy-D-Miller / pbzx.c
Created October 28, 2015 06:42 — forked from bruienne/pbzx.c
PBZX handling of Yosemite-style Payload archives
//
// main.c
// pbzx
//
// Created by PHPdev32 on 6/20/14.
// Licensed under GPLv3, full text at http://www.gnu.org/licenses/gpl-3.0.txt
//
#include <stdint.h>
#include <stdio.h>
@Jeremy-D-Miller
Jeremy-D-Miller / pbxz.c
Created October 28, 2015 06:42
PBXZ extractor that takes OS X .pkg directly - by PHPdev32 (posted by SJ_UnderWater)
//
// http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
//
// main.c
// pbzx
//
// Created by PHPdev32 on 6/20/14.
// Licensed under GPLv3, full text at http://www.gnu.org/licenses/gpl-3.0.txt
//
@Jeremy-D-Miller
Jeremy-D-Miller / pbxz.c
Created October 28, 2015 06:38
PBXZ "extractor" from 'Mac OS X Internals - To The Apple's Core' by Jonathan Levin
/*
* From 'Mac OS X Internals - To The Apple's Core' by Jonathan Levin
*
* http://www.newosxbook.com/articles/OTA.html
* http://www.newosxbook.com/src.jl?tree=listings&file=pbzx.c
*
*/
#include <stdio.h> // for printf
#include <string.h> // for strncmp