mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 10:55:12 +00:00
Some Actions do not require Charset parameter
This commit is contained in:
@@ -1928,7 +1928,7 @@ public class SWFInputStream implements AutoCloseable {
|
||||
try {
|
||||
actionCode = readUI8("actionCode");
|
||||
if (actionCode == 0) {
|
||||
return new ActionEnd(getCharset());
|
||||
return new ActionEnd();
|
||||
}
|
||||
if (actionCode == -1) {
|
||||
return null;
|
||||
@@ -1980,7 +1980,7 @@ public class SWFInputStream implements AutoCloseable {
|
||||
case 0x0D:
|
||||
return new ActionDivide();
|
||||
case 0x0E:
|
||||
return new ActionEquals(getCharset());
|
||||
return new ActionEquals();
|
||||
case 0x0F:
|
||||
return new ActionLess();
|
||||
case 0x10:
|
||||
@@ -2115,11 +2115,11 @@ public class SWFInputStream implements AutoCloseable {
|
||||
case 0x50:
|
||||
return new ActionIncrement();
|
||||
case 0x4C:
|
||||
return new ActionPushDuplicate(getCharset());
|
||||
return new ActionPushDuplicate();
|
||||
case 0x3E:
|
||||
return new ActionReturn();
|
||||
case 0x4D:
|
||||
return new ActionStackSwap(getCharset());
|
||||
return new ActionStackSwap();
|
||||
case 0x87:
|
||||
return new ActionStoreRegister(actionLength, this);
|
||||
// SWF6 Actions
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ActionListReader {
|
||||
Action lastAction = actionMap.get(addresses.get(addresses.size() - 1));
|
||||
long endAddress;
|
||||
if (!(lastAction instanceof ActionEnd)) {
|
||||
Action aEnd = new ActionEnd(sis.getCharset());
|
||||
Action aEnd = new ActionEnd();
|
||||
aEnd.setAddress(nextOffsets.get(lastAction.getAddress()));
|
||||
endAddress = aEnd.getAddress();
|
||||
actionMap.put(aEnd.getAddress(), aEnd);
|
||||
@@ -703,7 +703,7 @@ public class ActionListReader {
|
||||
long startIp = actions.get(0).getAddress();
|
||||
Action lastAction = actions.get(actions.size() - 1);
|
||||
if (!(lastAction instanceof ActionEnd)) {
|
||||
Action aEnd = new ActionEnd(actions.getCharset());
|
||||
Action aEnd = new ActionEnd();
|
||||
aEnd.setAddress(lastAction.getAddress() + lastAction.getTotalActionLength());
|
||||
actions.add(aEnd);
|
||||
lastAction = aEnd;
|
||||
@@ -769,7 +769,7 @@ public class ActionListReader {
|
||||
long startIp = actions.get(0).getAddress();
|
||||
Action lastAction = actions.get(actions.size() - 1);
|
||||
if (!(lastAction instanceof ActionEnd)) {
|
||||
Action aEnd = new ActionEnd(actions.getCharset());
|
||||
Action aEnd = new ActionEnd();
|
||||
aEnd.setAddress(lastAction.getAddress() + lastAction.getTotalActionLength());
|
||||
actions.add(aEnd);
|
||||
lastAction = aEnd;
|
||||
|
||||
@@ -284,14 +284,14 @@ public class TryActionItem extends ActionItem implements Block {
|
||||
fullCatchBody.addAll(0, GraphTargetItem.toSourceMerge(localData, generator,
|
||||
new DirectValueActionItem(new RegisterNumber(catchRegister)),
|
||||
ename,
|
||||
new ActionStackSwap(charset),
|
||||
new ActionStackSwap(),
|
||||
new ActionDefineLocal(),
|
||||
ebody
|
||||
));
|
||||
} else {
|
||||
List<GraphSourceItem> ifBody = GraphTargetItem.toSourceMerge(localData, generator,
|
||||
ename,
|
||||
new ActionStackSwap(charset),
|
||||
new ActionStackSwap(),
|
||||
new ActionDefineLocal(),
|
||||
ebody);
|
||||
fullCatchBody.add(0, new ActionPop());
|
||||
@@ -306,7 +306,7 @@ public class TryActionItem extends ActionItem implements Block {
|
||||
etype,
|
||||
new ActionPush(new RegisterNumber(catchRegister), charset),
|
||||
new ActionCastOp(),
|
||||
new ActionPushDuplicate(charset),
|
||||
new ActionPushDuplicate(),
|
||||
new ActionPush(Null.INSTANCE, charset),
|
||||
new ActionEquals2(),
|
||||
new ActionIf(ifBodySize, charset)
|
||||
|
||||
@@ -193,7 +193,7 @@ public class ASMParser {
|
||||
} else if (instructionName.compareToIgnoreCase("EndDrag") == 0) {
|
||||
a = new ActionEndDrag();
|
||||
} else if (instructionName.compareToIgnoreCase("Equals") == 0) {
|
||||
a = new ActionEquals(charset);
|
||||
a = new ActionEquals();
|
||||
} else if (instructionName.compareToIgnoreCase("GetProperty") == 0) {
|
||||
a = new ActionGetProperty();
|
||||
} else if (instructionName.compareToIgnoreCase("GetTime") == 0) {
|
||||
@@ -311,13 +311,13 @@ public class ASMParser {
|
||||
} else if (instructionName.compareToIgnoreCase("NewObject") == 0) {
|
||||
a = new ActionNewObject();
|
||||
} else if (instructionName.compareToIgnoreCase("PushDuplicate") == 0) {
|
||||
a = new ActionPushDuplicate(charset);
|
||||
a = new ActionPushDuplicate();
|
||||
} else if (instructionName.compareToIgnoreCase("Return") == 0) {
|
||||
a = new ActionReturn();
|
||||
} else if (instructionName.compareToIgnoreCase("SetMember") == 0) {
|
||||
a = new ActionSetMember();
|
||||
} else if (instructionName.compareToIgnoreCase("StackSwap") == 0) {
|
||||
a = new ActionStackSwap(charset);
|
||||
a = new ActionStackSwap();
|
||||
} else if (instructionName.compareToIgnoreCase("StoreRegister") == 0) {
|
||||
a = new ActionStoreRegister(lexer, charset);
|
||||
} else if (instructionName.compareToIgnoreCase("TargetPath") == 0) {
|
||||
@@ -357,9 +357,9 @@ public class ASMParser {
|
||||
} else if (instructionName.compareToIgnoreCase("StrictMode") == 0) {
|
||||
a = new ActionStrictMode(lexer, charset);
|
||||
} else if (instructionName.compareToIgnoreCase("Nop") == 0) {
|
||||
a = new ActionNop(charset);
|
||||
a = new ActionNop();
|
||||
} else if (instructionName.compareToIgnoreCase("End") == 0) {
|
||||
a = new ActionEnd(charset);
|
||||
a = new ActionEnd();
|
||||
} else if (instructionName.compareToIgnoreCase("FFDec_DeobfuscatePop") == 0) {
|
||||
a = new ActionDeobfuscatePop();
|
||||
} else if (instructionName.compareToIgnoreCase("FFDec_DeobfuscateJump") == 0) {
|
||||
@@ -595,7 +595,7 @@ public class ASMParser {
|
||||
}
|
||||
|
||||
if (ret.size() == 0 || !(ret.get(ret.size() - 1) instanceof ActionEnd)) {
|
||||
ret.add(new ActionEnd(charset));
|
||||
ret.add(new ActionEnd());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -769,7 +769,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, AndItem item) throws CompilationException {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ret.addAll(generateToActionList(localData, item.leftSide));
|
||||
ret.add(new ActionPushDuplicate(charset));
|
||||
ret.add(new ActionPushDuplicate());
|
||||
ret.add(new ActionNot());
|
||||
List<Action> andExpr = generateToActionList(localData, item.rightSide);
|
||||
andExpr.add(0, new ActionPop());
|
||||
@@ -784,7 +784,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, OrItem item) throws CompilationException {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ret.addAll(generateToActionList(localData, item.leftSide));
|
||||
ret.add(new ActionPushDuplicate(charset));
|
||||
ret.add(new ActionPushDuplicate());
|
||||
List<Action> orExpr = generateToActionList(localData, item.rightSide);
|
||||
orExpr.add(0, new ActionPop());
|
||||
int orExprLen = Action.actionsToBytes(orExpr, false, SWF.DEFAULT_VERSION).length;
|
||||
@@ -1016,7 +1016,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
@Override
|
||||
public List<GraphSourceItem> generate(SourceGeneratorLocalData localData, DuplicateItem item) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ret.add(new ActionPushDuplicate(charset));
|
||||
ret.add(new ActionPushDuplicate());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -38,10 +39,9 @@ public class ActionEnd extends Action {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param charset Charset
|
||||
*/
|
||||
public ActionEnd(String charset) {
|
||||
super(0, 0, charset);
|
||||
public ActionEnd() {
|
||||
super(0, 0, Utf8Helper.charsetName);
|
||||
setIgnored(true, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -36,11 +37,10 @@ import java.util.Set;
|
||||
public class ActionNop extends Action {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param charset Charset
|
||||
* Constructor.
|
||||
*/
|
||||
public ActionNop(String charset) {
|
||||
super(-1, 0, charset);
|
||||
public ActionNop() {
|
||||
super(-1, 0, Utf8Helper.charsetName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -42,10 +43,9 @@ public class ActionEquals extends Action {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param charset Charset
|
||||
*/
|
||||
public ActionEquals(String charset) {
|
||||
super(0x0E, 0, charset);
|
||||
public ActionEquals() {
|
||||
super(0x0E, 0, Utf8Helper.charsetName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.decompiler.graph.model.DuplicateItem;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -44,10 +45,9 @@ public class ActionPushDuplicate extends Action {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param charset Charset
|
||||
*/
|
||||
public ActionPushDuplicate(String charset) {
|
||||
super(0x4C, 0, charset);
|
||||
public ActionPushDuplicate() {
|
||||
super(0x4C, 0, Utf8Helper.charsetName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemPos;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -42,10 +43,9 @@ public class ActionStackSwap extends Action {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param charset Charset
|
||||
*/
|
||||
public ActionStackSwap(String charset) {
|
||||
super(0x4D, 0, charset);
|
||||
public ActionStackSwap() {
|
||||
super(0x4D, 0, Utf8Helper.charsetName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user