mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 19:54:37 +00:00
spelling: addresses
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
committed by
Jindra Petřík
parent
70504ee3ba
commit
deebc063c3
@@ -1110,7 +1110,7 @@ public class AVM2Code implements Cloneable {
|
||||
DumpInfo diParent = ais.dumpInfo;
|
||||
List<Long> addresses = new ArrayList<>();
|
||||
//Do not add new jumps when processing these addresses (unreachable code,etc.)
|
||||
List<Long> unAdresses = new ArrayList<>();
|
||||
List<Long> unAddresses = new ArrayList<>();
|
||||
//Handle lookupswitches at the end - they can be invalid. Handle other instruction first so we can decide lookupswitch to be invalid based on other instructions inside it
|
||||
//Flashplayer does not check casecount in lookupswitch instruction so the instruction can "be" long and over other instructions
|
||||
List<Long> switchAddresses = new ArrayList<>();
|
||||
@@ -1129,7 +1129,7 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
|
||||
loopaddr:
|
||||
while (!addresses.isEmpty() || !switchAddresses.isEmpty() || !unAdresses.isEmpty()) {
|
||||
while (!addresses.isEmpty() || !switchAddresses.isEmpty() || !unAddresses.isEmpty()) {
|
||||
long address;
|
||||
boolean isSwitch = false;
|
||||
boolean handleJumps = true;
|
||||
@@ -1139,7 +1139,7 @@ public class AVM2Code implements Cloneable {
|
||||
address = switchAddresses.remove(0);
|
||||
isSwitch = true;
|
||||
} else {
|
||||
address = unAdresses.remove(0);
|
||||
address = unAddresses.remove(0);
|
||||
handleJumps = false;
|
||||
}
|
||||
if (address < startPos) { // no jump outside block
|
||||
@@ -1257,7 +1257,7 @@ public class AVM2Code implements Cloneable {
|
||||
if (handleJumps) {
|
||||
long target = ais.getPosition() + actualOperands[0];
|
||||
addresses.add(target);
|
||||
unAdresses.add(ais.getPosition());
|
||||
unAddresses.add(ais.getPosition());
|
||||
continue loopaddr;
|
||||
} else {
|
||||
actualOperands[0] = 0;
|
||||
@@ -1266,7 +1266,7 @@ public class AVM2Code implements Cloneable {
|
||||
|
||||
if (instr.isExitInstruction()) { //do not process jumps if there is return/throw instruction
|
||||
if (handleJumps) {
|
||||
unAdresses.add(ais.getPosition());
|
||||
unAddresses.add(ais.getPosition());
|
||||
continue loopaddr;
|
||||
}
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ public class AVM2Code implements Cloneable {
|
||||
for (int c = 2; c < actualOperands.length; c++) {
|
||||
addresses.add(startOffset + actualOperands[c]);
|
||||
}
|
||||
unAdresses.add(ais.getPosition());
|
||||
unAddresses.add(ais.getPosition());
|
||||
continue loopaddr;
|
||||
} else {
|
||||
int swlen = (int) (endOffset - startOffset);
|
||||
@@ -1379,7 +1379,7 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets instruction addesses by their position.
|
||||
* Sets instruction addresses by their position.
|
||||
*/
|
||||
public void markOffsets() {
|
||||
long address = 0;
|
||||
|
||||
@@ -852,11 +852,11 @@ public abstract class Action implements GraphSourceItem {
|
||||
* Converts action to ASM source.
|
||||
*
|
||||
* @param container Container
|
||||
* @param knownAddreses List of important offsets to mark as labels
|
||||
* @param knownAddresses List of important offsets to mark as labels
|
||||
* @param exportMode PCode or hex?
|
||||
* @return String of P-code source
|
||||
*/
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
return toString();
|
||||
}
|
||||
|
||||
@@ -1441,13 +1441,13 @@ public abstract class Action implements GraphSourceItem {
|
||||
* Get ASM source with replaced Actions.
|
||||
*
|
||||
* @param container Container
|
||||
* @param knownAddreses Known addresses
|
||||
* @param knownAddresses Known addresses
|
||||
* @param exportMode Export mode
|
||||
* @param writer Writer
|
||||
* @return Writer
|
||||
*/
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
writer.appendNoHilight(getASMSource(container, knownAddreses, exportMode));
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
writer.appendNoHilight(getASMSource(container, knownAddresses, exportMode));
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ActionWaitForFrame extends Action implements ActionStore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
String ret = "WaitForFrame " + frame + ", " + skipCount;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class ActionIf extends Action {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
long address = getTargetAddress();
|
||||
String ofsStr = Helper.formatAddress(address);
|
||||
return "If loc" + ofsStr + (!jumpUsed ? " ;compileTimeIgnore" : (!ignoreUsed ? " ;compileTimeJump" : ""));
|
||||
|
||||
@@ -127,7 +127,7 @@ public class ActionJump extends Action {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
long address = getTargetAddress();
|
||||
String ofsStr = Helper.formatAddress(address);
|
||||
return "Jump loc" + ofsStr;
|
||||
|
||||
@@ -356,7 +356,7 @@ public class ActionPush extends Action {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
if (replacement == null || replacement.size() < values.size()) {
|
||||
return toString(writer);
|
||||
}
|
||||
@@ -370,12 +370,12 @@ public class ActionPush extends Action {
|
||||
/**
|
||||
* Converts the parameters to string - use replacements when available.
|
||||
* @param container Container
|
||||
* @param knownAddreses Known addresses
|
||||
* @param knownAddresses Known addresses
|
||||
* @param exportMode Export mode
|
||||
* @param writer Writer
|
||||
* @return Writer
|
||||
*/
|
||||
public GraphTextWriter paramsToStringReplaced(List<? extends GraphSourceItem> container, Set<Long> knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
public GraphTextWriter paramsToStringReplaced(List<? extends GraphSourceItem> container, Set<Long> knownAddresses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
if (replacement == null || replacement.size() < values.size()) {
|
||||
return paramsToString(writer);
|
||||
}
|
||||
|
||||
@@ -158,13 +158,13 @@ public class ActionWaitForFrame2 extends Action implements ActionStore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
String ret = "WaitForFrame2 " + skipCount;
|
||||
/*for (int i = 0; i < skipped.size(); i++) {
|
||||
if (skipped.get(i) instanceof ActionEnd) {
|
||||
break;
|
||||
}
|
||||
ret += "\r\n" + skipped.get(i).getASMSource(container, knownAddreses, version, exportMode);
|
||||
ret += "\r\n" + skipped.get(i).getASMSource(container, knownAddresses, version, exportMode);
|
||||
}*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
StringBuilder paramStr = new StringBuilder();
|
||||
for (int i = 0; i < paramNames.size(); i++) {
|
||||
paramStr.append(", ");
|
||||
@@ -191,7 +191,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
List<String> oldParamNames = paramNames;
|
||||
if (replacedParamNames != null) {
|
||||
paramNames = replacedParamNames;
|
||||
@@ -200,7 +200,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
if (replacedFunctionName != null) {
|
||||
functionName = replacedFunctionName;
|
||||
}
|
||||
String ret = getASMSource(container, knownAddreses, exportMode);
|
||||
String ret = getASMSource(container, knownAddresses, exportMode);
|
||||
paramNames = oldParamNames;
|
||||
functionName = oldFunctionName;
|
||||
writer.appendNoHilight(ret);
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ActionWith extends Action implements GraphSourceItemContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
return "With {";
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
public GraphTextWriter getASMSourceReplaced(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode, GraphTextWriter writer) {
|
||||
List<String> oldParamNames = paramNames;
|
||||
if (replacedParamNames != null) {
|
||||
paramNames = replacedParamNames;
|
||||
@@ -319,7 +319,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont
|
||||
if (replacedFunctionName != null) {
|
||||
functionName = replacedFunctionName;
|
||||
}
|
||||
String ret = getASMSource(container, knownAddreses, exportMode);
|
||||
String ret = getASMSource(container, knownAddresses, exportMode);
|
||||
paramNames = oldParamNames;
|
||||
functionName = oldFunctionName;
|
||||
writer.appendNoHilight(ret);
|
||||
@@ -328,7 +328,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
StringBuilder paramStr = new StringBuilder();
|
||||
for (int i = 0; i < paramNames.size(); i++) {
|
||||
paramStr.append(", ");
|
||||
|
||||
@@ -247,7 +247,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddreses, ScriptExportMode exportMode) {
|
||||
public String getASMSource(ActionList container, Set<Long> knownAddresses, ScriptExportMode exportMode) {
|
||||
StringBuilder ret = new StringBuilder();
|
||||
ret.append("Try ");
|
||||
if (catchBlockFlag) {
|
||||
|
||||
Reference in New Issue
Block a user