Skip to content

Commit

Permalink
Fix disasm.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuji Goro committed Aug 30, 2011
1 parent b665c05 commit e0d967a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tool/disasm.pl
@@ -1,16 +1,26 @@
#!perl -w
use strict;
use Text::Xslate;
use Data::MessagePack;
use Data::Dumper;
my $tx = Text::Xslate->new(cache => 2);
use File::Slurp qw(slurp);

$Data::Dumper::Indent = 0;
$Data::Dumper::Terse = 1;
$Data::Dumper::Useqq = 1;

foreach my $file(@ARGV) {
my $asm = $tx->load_file($file);
foreach my $c(@{$asm}) {
my $data = slurp($file);
my $unpacker = Data::MessagePack::Unpacker->new();

my $offset = $unpacker->execute($data);
my $is_utf8 = $unpacker->data();
$unpacker->reset();
$unpacker->utf8($is_utf8);

while($offset < length($data)) {
$offset = $unpacker->execute($data, $offset);
my $c = $unpacker->data();
$unpacker->reset();
print Dumper($c), "\n";
}
}

0 comments on commit e0d967a

Please sign in to comment.