Skip to content

Instantly share code, notes, and snippets.

@guiyomh
Forked from michelv/igdump
Created December 3, 2018 10:37
Show Gist options
  • Save guiyomh/4671f69ecb03745e624fcb2c40d2a790 to your computer and use it in GitHub Desktop.
Save guiyomh/4671f69ecb03745e624fcb2c40d2a790 to your computer and use it in GitHub Desktop.
igdump : a command line utility to unserialize and dump igbinary-serialized PHP data
#!/usr/bin/env php
<?php
if (isset($argv[1]) && ($argv[1] == '--help' || $argv[1] == '-h')) {
echo sprintf(
"Usage: \n [igbinary-serialized data] | %s\n",
basename(__FILE__)
);
exit();
}
if (file_exists('vendor/autoload.php')) {
require('vendor/autoload.php');
}
$data = igbinary_unserialize(stream_get_contents(STDIN));
if (function_exists('dump')) {
dump($data);
} else {
var_export($data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment