AS3 instruction name padding is optional (can be enabled in settings/scripts)

as it may be hard to search an instruction with spaces behind it
This commit is contained in:
Jindra Petřík
2021-02-08 20:15:19 +01:00
parent 8bf95a9076
commit 47e6737422
5 changed files with 21 additions and 10 deletions
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns;
import com.jpexs.decompiler.flash.abc.types.Float4;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphSource;
@@ -380,8 +381,10 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
public String toStringNoAddress(AVM2ConstantPool constants, List<DottedChain> fullyQualifiedNames) {
String s = definition.instructionName;
for (int i = s.length(); i < 19; i++) {
s += " ";
if (Configuration.padAs3PCodeInstructionName.get()) {
for (int i = s.length(); i < 19; i++) {
s += " ";
}
}
s += getParams(constants, fullyQualifiedNames) + getComment();
return s.trim();
@@ -190,6 +190,10 @@ public final class Configuration {
@ConfigurationInternal
public static ConfigurationItem<Boolean> showOriginalBytesInPcodeHex = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("script")
public static ConfigurationItem<Boolean> padAs3PCodeInstructionName = null;
/**
* Limit of code subs (for obfuscated code)
*/