Skip to content
Browse files

Added option to only disassemble multinames, this is useful for post …

…processing / analyzing what library features an .abc file uses.
  • Loading branch information...
1 parent c29bab4 commit 1960d417a9f6f0a7d374c972f99dace1018e37f1 @mbebenita mbebenita committed
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/avm2/disassembler.js
View
14 src/avm2/disassembler.js
@@ -1,4 +1,4 @@
-var filter = options.register(new Option("filter", "f", "SpciMsm", "[S]ource, constant[p]ool, [c]lasses, [i]nstances, [M]etadata, [s]cripts, [m]ethods"));
+var filter = options.register(new Option("filter", "f", "SpciMsm", "[S]ource, constant[p]ool, [c]lasses, [i]nstances, [M]etadata, [s]cripts, [m]ethods, multi[N]ames"));
var IndentingWriter = (function () {
function indentingWriter(suppressOutput, out) {
@@ -38,7 +38,7 @@ var IndentingWriter = (function () {
}
};
- indentingWriter.prototype.writeArray = function writeArray(arr, detailed) {
+ indentingWriter.prototype.writeArray = function writeArray(arr, detailed, noNumbers) {
detailed = detailed || false;
for (var i = 0, j = arr.length; i < j; i++) {
var prefix = "";
@@ -52,7 +52,8 @@ var IndentingWriter = (function () {
}
prefix += " ";
}
- this.writeLn(("" + i).padRight(' ', 4) + prefix + arr[i]);
+ var number = noNumbers ? "" : ("" + i).padRight(' ', 4);
+ this.writeLn(number + prefix + arr[i]);
}
};
@@ -74,6 +75,9 @@ AbcFile.prototype.trace = function trace(writer) {
if (filter.value.indexOf("p") >= 0) {
this.constantPool.trace(writer);
}
+ if (filter.value.indexOf("N") >= 0) {
+ this.constantPool.traceMultinamesOnly(writer);
+ }
if (filter.value.indexOf("c") >= 0) {
traceArray(writer, "classes", this.classes);
}
@@ -114,6 +118,10 @@ ConstantPool.prototype.trace = function (writer) {
writer.leave("}");
};
+ConstantPool.prototype.traceMultinamesOnly = function (writer) {
+ writer.writeArray(this.multinames, null, true);
+};
+
Traits.prototype.trace = function (writer) {
traceArray(writer, "traits", this.traits);
};

0 comments on commit 1960d41

Please sign in to comment.
Something went wrong with that request. Please try again.