mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-03 18:05:15 +00:00
format source code
This commit is contained in:
@@ -60,6 +60,7 @@ public class AVM2LocalData extends BaseLocalData {
|
||||
public Map<Integer, List<Integer>> finallyJumps;
|
||||
|
||||
public Map<Integer, Integer> ignoredSwitches;
|
||||
|
||||
public List<Integer> ignoredSwitches2;
|
||||
|
||||
public Integer scriptIndex;
|
||||
|
||||
@@ -1,46 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DeobfuscatePopIns extends PopIns {
|
||||
|
||||
public DeobfuscatePopIns() {
|
||||
instructionName = "ffdec_deobfuscatepop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List<MethodInfo> method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.pop(); //Just ignore the value
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DeobfuscatePopIns extends PopIns {
|
||||
|
||||
public DeobfuscatePopIns() {
|
||||
instructionName = "ffdec_deobfuscatepop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List<MethodInfo> method_info, List<GraphTargetItem> output, MethodBody body, ABC abc, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, String path, HashMap<Integer, Integer> localRegsAssignmentIps, int ip, HashMap<Integer, List<Integer>> refs, AVM2Code code) {
|
||||
stack.pop(); //Just ignore the value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +23,4 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy;
|
||||
public interface AlchemyTypeIns {
|
||||
|
||||
public static final String ALCHEMY_PACKAGE = "avm2.intrinsics.memory";
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.List;
|
||||
public class AlchemyLoadAVM2Item extends AVM2Item {
|
||||
|
||||
private final char type;
|
||||
|
||||
private final int size;
|
||||
|
||||
private final GraphTargetItem ofs;
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.List;
|
||||
public class AlchemyStoreAVM2Item extends AVM2Item {
|
||||
|
||||
private final char type;
|
||||
|
||||
private final int size;
|
||||
|
||||
private final GraphTargetItem ofs;
|
||||
@@ -93,5 +94,4 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
|
||||
}
|
||||
return toSourceMerge(localData, generator, ofs, ins(def));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SimpleValue;
|
||||
import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.TypeItem;
|
||||
import com.jpexs.decompiler.graph.model.IntegerValueTypeItem;
|
||||
@@ -86,5 +85,4 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer
|
||||
public int intValue() {
|
||||
return (int) (long) value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -147,5 +147,4 @@ public class LocalRegAVM2Item extends AVM2Item {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -373,5 +373,4 @@ public class Multiname {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -102,5 +102,4 @@ public class DottedChain {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,5 +7,4 @@ import com.jpexs.decompiler.graph.model.BinaryOp;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public interface EqualsTypeItem extends BinaryOp {
|
||||
|
||||
}
|
||||
|
||||
@@ -312,5 +312,4 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
|
||||
public GraphTargetItem invert(GraphSourceItem src) {
|
||||
return new NotItem(src, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -73,5 +73,4 @@ public class TranslateStack extends Stack<GraphTargetItem> {
|
||||
}
|
||||
return super.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,37 +31,37 @@ import java.util.Objects;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TypeItem extends GraphTargetItem {
|
||||
|
||||
|
||||
public static TypeItem BOOLEAN = new TypeItem("Boolean");
|
||||
|
||||
|
||||
public static TypeItem STRING = new TypeItem("String");
|
||||
|
||||
|
||||
public static TypeItem ARRAY = new TypeItem("Array");
|
||||
|
||||
|
||||
public static UnboundedTypeItem UNBOUNDED = new UnboundedTypeItem();
|
||||
|
||||
|
||||
public DottedChain fullTypeName;
|
||||
|
||||
|
||||
public TypeItem(String s) {
|
||||
this(s == null ? new DottedChain() : new DottedChain(s.split("\\.")));
|
||||
}
|
||||
|
||||
|
||||
public TypeItem(DottedChain fullTypeName) {
|
||||
this(fullTypeName, new ArrayList<GraphTargetItem>());
|
||||
}
|
||||
|
||||
|
||||
public TypeItem(DottedChain fullTypeName, List<GraphTargetItem> subtypes) {
|
||||
super(null, NOPRECEDENCE);
|
||||
this.fullTypeName = fullTypeName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 83 * hash + Objects.hashCode(this.fullTypeName);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
@@ -76,7 +76,7 @@ public class TypeItem extends GraphTargetItem {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (localData.fullyQualifiedNames.contains(fullTypeName)) {
|
||||
@@ -84,25 +84,25 @@ public class TypeItem extends GraphTargetItem {
|
||||
} else {
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(localData.constantsAvm2 != null, fullTypeName.getLast()), HighlightSpecialType.TYPE_NAME, fullTypeName.toPrintableString());
|
||||
}
|
||||
|
||||
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public GraphTargetItem returnType() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasReturnValue() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return fullTypeName.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
|
||||
return generator.generate(localData, this);
|
||||
|
||||
@@ -105,5 +105,4 @@ public class DuplicateItem extends GraphTargetItem implements SimpleValue {
|
||||
public boolean isSimpleValue() {
|
||||
return ((value instanceof SimpleValue) && ((SimpleValue) value).isSimpleValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,5 +74,4 @@ public class FalseItem extends GraphTargetItem implements LogicalOpItem, SimpleV
|
||||
public Object getResult() {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -55,5 +54,4 @@ public class GotoItem extends GraphTargetItem {
|
||||
public Object getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.graph.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -65,5 +64,4 @@ public class LabelItem extends GraphTargetItem {
|
||||
public Object getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
@@ -81,5 +81,4 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted {
|
||||
public GraphTargetItem invert(GraphSourceItem src) {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,5 +53,4 @@ public class PopItem extends GraphTargetItem {
|
||||
public Object getResult() {
|
||||
return new Null();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,5 +63,4 @@ public class PushItem extends GraphTargetItem {
|
||||
public GraphTargetItem getThroughRegister() {
|
||||
return value.getThroughRegister();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,5 +75,4 @@ public class TrueItem extends GraphTargetItem implements LogicalOpItem, SimpleVa
|
||||
public Object getResult() {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user