Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: segfault
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 0.801 kb
// Copyright (C) 2011-2012, Parrot Foundation.
// Basic disassembler to demonstrate the PACT.Packfile classes
class PACT.Packfile.Decompile;
function main[main](var argv) {
load_bytecode('pact/packfile/decompile.pbc');
load_bytecode('dumper.pbc');
// Process arguments
string progname = argv[0];
if (elements(argv) != 2) {
cry('Usage: ', progname, ' <PBC file>');
exit(1);
}
string filename = argv[1];
// Get a Packfile
var packfile;
try {
:PACT.Packfile.Decompile decomp(filename);
_dumper(decomp.pact, 'Packfile');
} catch (e) {
cry( progname, ': Error during disassembly ', filename );
cry( e.message );
for ( string bt in e.backtrace_strings() )
cry(bt);
exit(1);
}
}
Jump to Line
Something went wrong with that request. Please try again.