mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 16:28:10 +00:00
better AS1/2 parser
This commit is contained in:
@@ -77,7 +77,8 @@ public class SWFInputStream extends InputStream {
|
||||
private long percentMax;
|
||||
private List<byte[]> buffered = new ArrayList<byte[]>();
|
||||
private ByteArrayOutputStream buffer;
|
||||
private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = true;
|
||||
private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = (Boolean)Configuration.getConfig("deobfuscateUsePrevTagOnly",true);
|
||||
private static boolean AUTO_DEOBFUSCATE = (Boolean)Configuration.getConfig("autoDeobfuscate",true);
|
||||
|
||||
public int getBufferLength() {
|
||||
return buffer.size();
|
||||
@@ -585,7 +586,7 @@ public class SWFInputStream extends InputStream {
|
||||
|
||||
if (ins.isBranch() || ins.isJump()) {
|
||||
|
||||
if (ins instanceof ActionIf && !stack.isEmpty() && (stack.peek().isCompileTime() && (!stack.peek().hasSideEffect()))) {
|
||||
if (AUTO_DEOBFUSCATE && (ins instanceof ActionIf) && !stack.isEmpty() && (stack.peek().isCompileTime() && (!stack.peek().hasSideEffect()))) {
|
||||
ActionIf aif = (ActionIf) ins;
|
||||
if (aif.ignoreUsed && (!aif.jumpUsed)) {
|
||||
ins.setIgnored(true);
|
||||
@@ -872,7 +873,7 @@ public class SWFInputStream extends InputStream {
|
||||
} else if (next.equals("c")) {
|
||||
goaif = true;
|
||||
}
|
||||
} else if (top.isCompileTime() && (!top.hasSideEffect()) && ((!top.isVariableComputed()) || (top.isVariableComputed() && enableVariables && (!notCompileTime)))) {
|
||||
} else if (AUTO_DEOBFUSCATE && top.isCompileTime() && (!top.hasSideEffect()) && ((!top.isVariableComputed()) || (top.isVariableComputed() && enableVariables && (!notCompileTime)))) {
|
||||
//if(top.isCompileTime()) {
|
||||
//if(false){
|
||||
if (enableVariables) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,8 @@ public class ActionJump extends Action {
|
||||
|
||||
private int offset;
|
||||
public String identifier;
|
||||
public boolean isContinue=false;
|
||||
public boolean isBreak=false;
|
||||
|
||||
public int getJumpOffset() {
|
||||
return offset;
|
||||
|
||||
@@ -51,6 +51,21 @@ public class ActionTry extends Action implements GraphSourceItemContainer {
|
||||
long finallySize;
|
||||
private int version;
|
||||
|
||||
public ActionTry(boolean catchInRegisterFlag, boolean finallyBlockFlag, boolean catchBlockFlag, String catchName, int catchRegister, long trySize, long catchSize, long finallySize, int version) {
|
||||
super(0x8F, 0);
|
||||
this.catchInRegisterFlag = catchInRegisterFlag;
|
||||
this.finallyBlockFlag = finallyBlockFlag;
|
||||
this.catchBlockFlag = catchBlockFlag;
|
||||
this.catchName = catchName;
|
||||
this.catchRegister = catchRegister;
|
||||
this.trySize = trySize;
|
||||
this.catchSize = catchSize;
|
||||
this.finallySize = finallySize;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ActionTry(int actionLength, SWFInputStream sis, ReReadableInputStream rri, int version) throws IOException {
|
||||
super(0x8F, actionLength);
|
||||
long startPos = sis.getPos();
|
||||
|
||||
Reference in New Issue
Block a user