windows-nt/Source/XPSP1/NT/tools/x86/perl/lib/b/disassemble

23 lines
396 B
Plaintext
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
use B::Disassembler qw(disassemble_fh);
use FileHandle;
my $fh;
if (@ARGV == 0) {
$fh = \*STDIN;
} elsif (@ARGV == 1) {
$fh = new FileHandle "<$ARGV[0]";
} else {
die "Usage: disassemble [filename]\n";
}
sub print_insn {
my ($insn, $arg) = @_;
if (defined($arg)) {
printf "%s %s\n", $insn, $arg;
} else {
print $insn, "\n";
}
}
disassemble_fh($fh, \&print_insn);