mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 12:40:47 +00:00
AS1/2 deobfuscation fixes
This commit is contained in:
+2
-2
@@ -466,9 +466,9 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter {
|
||||
Action action = item.action;
|
||||
|
||||
/*System.out.print(action.getASMSource(actions, new ArrayList<Long>(), ScriptExportMode.PCODE));
|
||||
for (int j = 0; j < stack.size(); j++) {
|
||||
for (int j = 0; j < stack.size(); j++) {
|
||||
System.out.print(" '" + stack.get(j).getResult() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println();*/
|
||||
if (action instanceof ActionConstantPool) {
|
||||
lastConstantPool = (ActionConstantPool) action;
|
||||
|
||||
+2
-8
@@ -98,18 +98,12 @@ public class GetVariableActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public boolean isCompileTime(Set<GraphTargetItem> dependencies) {
|
||||
if (computedValue == null) {
|
||||
return false;
|
||||
}
|
||||
return computedCompiletime;
|
||||
return false; //?
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
if (computedValue == null) {
|
||||
return Undefined.INSTANCE;
|
||||
}
|
||||
return computedResult;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setComputedValue(GraphTargetItem computedValue) {
|
||||
|
||||
@@ -47,12 +47,13 @@ public class ActionDelete extends Action {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda) {
|
||||
String memberName = lda.popAsString();
|
||||
/* String memberName = lda.popAsString();
|
||||
Object o = lda.pop();
|
||||
if (o instanceof ActionScriptObject) {
|
||||
((ActionScriptObject) o).setMember(memberName, Undefined.INSTANCE);
|
||||
}
|
||||
return true;
|
||||
return true;*/
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,8 +62,9 @@ public class ActionNewObject extends Action {
|
||||
}
|
||||
ActionScriptObject obj = new ActionScriptObject();
|
||||
//TODO:check type
|
||||
ActionScriptFunction constructor = (ActionScriptFunction) lda.stage.getMember(objectName);
|
||||
/*ActionScriptFunction constructor = (ActionScriptFunction) lda.stage.getMember(objectName);
|
||||
lda.stage.callFunction(constructor.getFunctionOffset(), constructor.getFunctionLength(), args, constructor.getFuncRegNames(), obj);
|
||||
*/
|
||||
lda.stack.push(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,13 @@ public class EcmaScript {
|
||||
if (o instanceof Boolean) {
|
||||
return (Boolean) o ? 1.0 : 0.0;
|
||||
}
|
||||
if (o instanceof Float) {
|
||||
o = (double) (float) (Float) o;
|
||||
}
|
||||
if (o instanceof Double) {
|
||||
return (Double) o;
|
||||
}
|
||||
|
||||
if (o instanceof Long) {
|
||||
return (double) (long) (Long) o;
|
||||
}
|
||||
@@ -397,6 +401,10 @@ public class EcmaScript {
|
||||
if (o instanceof Integer) {
|
||||
return ((Integer) o) != 0;
|
||||
}
|
||||
if (o instanceof Float) {
|
||||
o = (double) (float) (Float) o;
|
||||
}
|
||||
|
||||
if (o instanceof Double) {
|
||||
Double d = (Double) o;
|
||||
if (d.isNaN()) {
|
||||
|
||||
Reference in New Issue
Block a user