mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 10:55:12 +00:00
Checkstyle fix
This commit is contained in:
@@ -54,10 +54,11 @@ import natorder.NaturalOrderComparator;
|
||||
public class IdentifiersDeobfuscation {
|
||||
|
||||
/**
|
||||
* Prefix to be put instead of obfuscated name. It will by suffixed with a number.
|
||||
* Prefix to be put instead of obfuscated name. It will by suffixed with a
|
||||
* number.
|
||||
*/
|
||||
public static final String SAFE_STR_PREFIX = "_SafeStr_";
|
||||
|
||||
|
||||
/**
|
||||
* Random number generator.
|
||||
*/
|
||||
@@ -546,7 +547,7 @@ public class IdentifiersDeobfuscation {
|
||||
*
|
||||
* @param swf SWF
|
||||
* @param used Used deobfuscations
|
||||
* @param s String
|
||||
* @param s String
|
||||
* @param writer Writer
|
||||
* @return Writer
|
||||
*/
|
||||
@@ -559,12 +560,12 @@ public class IdentifiersDeobfuscation {
|
||||
writer.append(map.get(s));
|
||||
} else {
|
||||
String ret = IdentifiersDeobfuscation.SAFE_STR_PREFIX + map.size();
|
||||
map.put(s, ret);
|
||||
map.put(s, ret);
|
||||
writer.append(ret);
|
||||
}
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
writer.append("\u00A7");
|
||||
escapeOIdentifier(s, writer);
|
||||
return writer.append("\u00A7");
|
||||
@@ -574,7 +575,8 @@ public class IdentifiersDeobfuscation {
|
||||
* Ensures identifier is valid and if not, uses paragraph syntax.
|
||||
*
|
||||
* @param swf SWF
|
||||
* @param used Set of used obfuscated identifiers in this script - the method will add to it
|
||||
* @param used Set of used obfuscated identifiers in this script - the
|
||||
* method will add to it
|
||||
* @param as3 Is ActionScript3
|
||||
* @param s Identifier
|
||||
* @param validExceptions Exceptions which are valid (e.g. some reserved
|
||||
@@ -585,23 +587,20 @@ public class IdentifiersDeobfuscation {
|
||||
if (s == null || s.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
if (Configuration.autoDeobfuscateIdentifiers.get()) {
|
||||
|
||||
|
||||
if (swf != null) {
|
||||
map = swf.getObfuscatedIdentifiersMap();
|
||||
}
|
||||
|
||||
|
||||
if (map.containsKey(s)) {
|
||||
used.add(s);
|
||||
return map.get(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (s.startsWith("\u00A7") && s.endsWith("\u00A7")) { // Assuming already printed - TODO:detect better
|
||||
return s;
|
||||
}
|
||||
@@ -629,7 +628,7 @@ public class IdentifiersDeobfuscation {
|
||||
used.add(s);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
String ret = "\u00A7" + escapeOIdentifier(s) + "\u00A7";
|
||||
nameCache.put(s, ret);
|
||||
return ret;
|
||||
@@ -679,8 +678,8 @@ public class IdentifiersDeobfuscation {
|
||||
}
|
||||
|
||||
return writer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes obfuscated identifier.
|
||||
*
|
||||
@@ -726,16 +725,17 @@ public class IdentifiersDeobfuscation {
|
||||
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unescapes deobfuscated identifier
|
||||
*
|
||||
* @param swf SWF
|
||||
* @param s String
|
||||
* @return Unescaped string
|
||||
*/
|
||||
public static String unescapeOIdentifier(SWF swf, String s) {
|
||||
StringBuilder ret = new StringBuilder(s.length());
|
||||
|
||||
|
||||
Map<String, String> map = swf.getObfuscatedIdentifiersMap();
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
if (s.equals(entry.getValue())) {
|
||||
@@ -767,8 +767,8 @@ public class IdentifiersDeobfuscation {
|
||||
} else if (c == '\\') {
|
||||
ret.append("\\");
|
||||
} else if (c == '\u00A7') {
|
||||
ret.append("\u00A7");
|
||||
} else if (c == 'x' && i + 2 < s.length() - 1) {
|
||||
ret.append("\u00A7");
|
||||
} else if (c == 'x' && i + 2 < s.length() - 1) {
|
||||
ret.append((char) Integer.parseInt(s.substring(i + 1, i + 3), 16));
|
||||
i += 2;
|
||||
} else if (c == '{') {
|
||||
@@ -798,7 +798,7 @@ public class IdentifiersDeobfuscation {
|
||||
as2NameCache.clear();
|
||||
as3NameCache.clear();
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static GraphTextWriter writeCurrentScriptReplacements(GraphTextWriter writer, Set<String> usedDeobfuscations, SWF swf) {
|
||||
if (!usedDeobfuscations.isEmpty() && Configuration.autoDeobfuscateIdentifiers.get()) {
|
||||
@@ -819,12 +819,12 @@ public class IdentifiersDeobfuscation {
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, String> getReplacementsFromDoc(String s) throws Exception {
|
||||
ActionScriptDocParser asd = new ActionScriptDocParser();
|
||||
List<AsDocComment> comments = asd.parse(s);
|
||||
Map<String, String> replacements = new LinkedHashMap<>();
|
||||
for (AsDocComment comment:comments) {
|
||||
for (AsDocComment comment : comments) {
|
||||
for (AsDocTag tag : comment.tags) {
|
||||
if ("identifier".equals(tag.tagName)) {
|
||||
String tagText = tag.tagText;
|
||||
|
||||
@@ -640,9 +640,6 @@ public class ABC implements Openable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void getObfuscatedIdentifier(int strIndex, Map<String, String> ret) {
|
||||
if (strIndex >= constants.getStringCount()) {
|
||||
return;
|
||||
@@ -653,15 +650,15 @@ public class ABC implements Openable {
|
||||
String s = constants.getString(strIndex);
|
||||
if (ret.containsKey(s)) {
|
||||
return;
|
||||
}
|
||||
AVM2Deobfuscation deobfuscation = getDeobfuscation();
|
||||
}
|
||||
AVM2Deobfuscation deobfuscation = getDeobfuscation();
|
||||
if (deobfuscation.isValidName(strIndex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ret.put(s, IdentifiersDeobfuscation.SAFE_STR_PREFIX + ret.size());
|
||||
}
|
||||
|
||||
|
||||
private void getObfuscatedPackageIdentifier(int strIndex, Map<String, String> ret) {
|
||||
if (strIndex >= constants.getStringCount()) {
|
||||
return;
|
||||
@@ -672,7 +669,7 @@ public class ABC implements Openable {
|
||||
String s = constants.getString(strIndex);
|
||||
if (ret.containsKey(s)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
AVM2Deobfuscation deobfuscation = getDeobfuscation();
|
||||
if (deobfuscation.isValidPackageName(strIndex)) {
|
||||
return;
|
||||
@@ -682,21 +679,21 @@ public class ABC implements Openable {
|
||||
for (String part : parts) {
|
||||
if (!deobfuscation.isValidNSPart(part)) {
|
||||
deobfuscatedList.add(IdentifiersDeobfuscation.SAFE_STR_PREFIX + ret.size());
|
||||
ret.put(part, IdentifiersDeobfuscation.SAFE_STR_PREFIX + ret.size());
|
||||
ret.put(part, IdentifiersDeobfuscation.SAFE_STR_PREFIX + ret.size());
|
||||
} else {
|
||||
deobfuscatedList.add(part);
|
||||
}
|
||||
}
|
||||
ret.put(s, String.join(".", deobfuscatedList));
|
||||
}
|
||||
|
||||
|
||||
public void getObfuscatedIdentifiers(Map<String, String> ret) {
|
||||
for (int i = 0; i < instance_info.size(); i++) {
|
||||
InstanceInfo insti = instance_info.get(i);
|
||||
if (insti.name_index != 0) {
|
||||
getObfuscatedIdentifier(constants.getMultiname(insti.name_index).name_index, ret);
|
||||
if (constants.getMultiname(insti.name_index).namespace_index != 0) {
|
||||
getObfuscatedPackageIdentifier( constants.getNamespace(constants.getMultiname(insti.name_index).namespace_index).name_index, ret);
|
||||
getObfuscatedPackageIdentifier(constants.getNamespace(constants.getMultiname(insti.name_index).namespace_index).name_index, ret);
|
||||
}
|
||||
}
|
||||
if (insti.super_index != 0) {
|
||||
@@ -706,7 +703,7 @@ public class ABC implements Openable {
|
||||
getObfuscatedIdentifier(constants.getMultiname(iface).name_index, ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 1; i < constants.getMultinameCount(); i++) {
|
||||
Multiname m = constants.getMultiname(i);
|
||||
int strIndex = m.name_index;
|
||||
@@ -720,9 +717,9 @@ public class ABC implements Openable {
|
||||
continue;
|
||||
}
|
||||
getObfuscatedPackageIdentifier(constants.getNamespace(i).name_index, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deobfuscates identifiers.
|
||||
*
|
||||
@@ -868,9 +865,10 @@ public class ABC implements Openable {
|
||||
public boolean hasFloatSupport() {
|
||||
return minVersionCheck(47, 16);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether the ABC has float4 support
|
||||
*
|
||||
* @return Whether the ABC has float4 support
|
||||
*/
|
||||
public boolean hasFloat4Support() {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ClassPath implements Serializable {
|
||||
* Namespace suffix
|
||||
*/
|
||||
public final String namespaceSuffix;
|
||||
|
||||
|
||||
/**
|
||||
* SWF
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ public class ClassPath implements Serializable {
|
||||
* @param packageStr Package name
|
||||
* @param className Class name
|
||||
* @param namespaceSuffix Namespace suffix
|
||||
* @param SWF swf
|
||||
* @param swf SWF
|
||||
*/
|
||||
public ClassPath(DottedChain packageStr, String className, String namespaceSuffix, SWF swf) {
|
||||
this.packageStr = packageStr == null ? DottedChain.TOPLEVEL : packageStr;
|
||||
|
||||
@@ -2042,7 +2042,7 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
if (debugMode) {
|
||||
System.err.println("CLOSE SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2083,7 +2083,7 @@ public class AVM2Code implements Cloneable {
|
||||
if (ins.definition instanceof SetLocalTypeIns) {
|
||||
if (prev != null) {
|
||||
if (prev.definition instanceof CoerceOrConvertTypeIns) {
|
||||
ret.put(((SetLocalTypeIns) ins.definition).getRegisterId(ins), ((CoerceOrConvertTypeIns) prev.definition).getTargetType(usedDeobfuscations,abc, constants, prev));
|
||||
ret.put(((SetLocalTypeIns) ins.definition).getRegisterId(ins), ((CoerceOrConvertTypeIns) prev.definition).getTargetType(usedDeobfuscations, abc, constants, prev));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3648,7 +3648,7 @@ public class AVM2Code implements Cloneable {
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
if ((ins.definition instanceof LabelIns) || (ins.definition instanceof DebugLineIns)) {
|
||||
if ((ins.definition instanceof LabelIns) || (ins.definition instanceof DebugLineIns)) {
|
||||
ins.setIgnored(true, 0);
|
||||
if (minChangedIp == -1 || minChangedIp > i) {
|
||||
minChangedIp = i;
|
||||
@@ -3663,23 +3663,24 @@ public class AVM2Code implements Cloneable {
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes label and debugline instructions
|
||||
*
|
||||
* @param body Method body
|
||||
* @return Number of removed instructions
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public int removeLabelsAndDebugLine(MethodBody body) throws InterruptedException {
|
||||
public int removeLabelsAndDebugLine(MethodBody body) throws InterruptedException {
|
||||
int cnt = 0;
|
||||
for (int i = code.size() - 1; i >= 0; i--) {
|
||||
AVM2Instruction ins = code.get(i);
|
||||
if ((ins.definition instanceof LabelIns) || (ins.definition instanceof DebugLineIns)) {
|
||||
AVM2Instruction ins = code.get(i);
|
||||
if ((ins.definition instanceof LabelIns) || (ins.definition instanceof DebugLineIns)) {
|
||||
ins.setIgnored(true, 0);
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
removeIgnored(body);
|
||||
removeIgnored(body);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
@@ -701,7 +701,8 @@ public class ActionScript3Parser {
|
||||
//s = lex();
|
||||
|
||||
ParsedSymbol s = lex();
|
||||
loops: while (s.isType(SymbolType.NATIVE, SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER, SymbolType.INTERNAL, SymbolType.PREPROCESSOR)) {
|
||||
loops:
|
||||
while (s.isType(SymbolType.NATIVE, SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER, SymbolType.INTERNAL, SymbolType.PREPROCESSOR)) {
|
||||
if (s.type == SymbolType.FINAL) {
|
||||
if (isFinal) {
|
||||
throw new AVM2ParseException("Only one final keyword allowed", lexer.yyline());
|
||||
@@ -2753,7 +2754,7 @@ public class ActionScript3Parser {
|
||||
}
|
||||
|
||||
private ActionScriptLexer lexer = null;
|
||||
|
||||
|
||||
private Map<String, String> replacements = new LinkedHashMap<>();
|
||||
|
||||
private List<String> constantPool;
|
||||
@@ -3024,11 +3025,11 @@ public class ActionScript3Parser {
|
||||
* @throws CompilationException On compilation error
|
||||
* @throws InterruptedException On interrupt
|
||||
*/
|
||||
public void addScript(String s, String fileName, int classPos, int scriptIndex, String documentClass, ABC abc) throws AVM2ParseException, IOException, CompilationException, InterruptedException {
|
||||
public void addScript(String s, String fileName, int classPos, int scriptIndex, String documentClass, ABC abc) throws AVM2ParseException, IOException, CompilationException, InterruptedException {
|
||||
try {
|
||||
replacements = IdentifiersDeobfuscation.getReplacementsFromDoc(s);
|
||||
} catch (Exception ex) {
|
||||
throw new AVM2ParseException(ex.getMessage(), -1);
|
||||
throw new AVM2ParseException(ex.getMessage(), -1);
|
||||
}
|
||||
List<List<NamespaceItem>> allOpenedNamespaces = new ArrayList<>();
|
||||
Reference<Integer> numberContextRef = new Reference<>(null);
|
||||
|
||||
@@ -71,6 +71,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@Override
|
||||
@@ -80,8 +81,9 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param ABC abc
|
||||
* @param abc ABC
|
||||
* @param constants AVM2 constant pool
|
||||
* @param fullyQualifiedNames Fully qualified names
|
||||
* @return String
|
||||
@@ -92,6 +94,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param abc ABC
|
||||
* @param constants AVM2 constant pool
|
||||
@@ -109,6 +112,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Checks if exception is finally.
|
||||
*
|
||||
* @return True if exception is finally
|
||||
*/
|
||||
public boolean isFinally() {
|
||||
@@ -117,6 +121,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Gets variable name.
|
||||
*
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param abc ABC
|
||||
* @param constants AVM2 constant pool
|
||||
@@ -132,6 +137,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Gets type name.
|
||||
*
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param abc ABC
|
||||
* @param constants AVM2 constant pool
|
||||
@@ -147,6 +153,7 @@ public class ABCException implements Serializable, Cloneable {
|
||||
|
||||
/**
|
||||
* Clones exception.
|
||||
*
|
||||
* @return Cloned exception
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -699,7 +699,7 @@ public class Multiname {
|
||||
return (isAttribute() ? "@" : "") + (dontDeobfuscate ? name : IdentifiersDeobfuscation.printIdentifier(abc.getSwf(), usedDeobfuscations, true, name)) + (withSuffix ? getNamespaceSuffix() : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the name with custom namespace.
|
||||
*
|
||||
@@ -741,7 +741,7 @@ public class Multiname {
|
||||
DottedChain dc = getNameWithNamespace(usedDeobfuscations, abc, abc.constants, withSuffix);
|
||||
return dontDeobfuscate ? dc.toRawString() : dc.toPrintableString(usedDeobfuscations, abc.getSwf(), true);
|
||||
}
|
||||
return (isAttribute() ? "@" : "") + (dontDeobfuscate ? name : IdentifiersDeobfuscation.printIdentifier(abc.getSwf(), usedDeobfuscations,true, name)) + (withSuffix ? getNamespaceSuffix() : "");
|
||||
return (isAttribute() ? "@" : "") + (dontDeobfuscate ? name : IdentifiersDeobfuscation.printIdentifier(abc.getSwf(), usedDeobfuscations, true, name)) + (withSuffix ? getNamespaceSuffix() : "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -773,13 +773,13 @@ public class Multiname {
|
||||
NamespaceSet nss = getNamespaceSet(constants);
|
||||
if (nss != null) {
|
||||
if (nss.namespaces.length == 1) {
|
||||
ns = constants.getNamespace(nss.namespaces[0]);
|
||||
ns = constants.getNamespace(nss.namespaces[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ns != null && (ns.kind == Namespace.KIND_PACKAGE || ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
isPublic = true;
|
||||
}
|
||||
}
|
||||
if (isPublic && fullyQualifiedNames != null && !fullyQualifiedNames.isEmpty() && fullyQualifiedNames.contains(DottedChain.parseWithSuffix(name))) {
|
||||
DottedChain dc = getNameWithNamespace(usedDeobfuscations, abc, constants, withSuffix);
|
||||
return dontDeobfuscate ? dc.toRawString() : dc.toPrintableString(usedDeobfuscations, abc.getSwf(), true);
|
||||
@@ -1032,8 +1032,8 @@ public class Multiname {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this multiname is effectively a QName. Effectively means that it
|
||||
* is a QName or QNameA or MULTINAME with only one namespace.
|
||||
* Checks if this multiname is effectively a QName. Effectively means that
|
||||
* it is a QName or QNameA or MULTINAME with only one namespace.
|
||||
*
|
||||
* @param thisCpool This constant pool
|
||||
* @return True if it's effectively a QName
|
||||
|
||||
@@ -181,9 +181,9 @@ public class Namespace {
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
*
|
||||
* @param usedDeobfuscations Used deobuscations
|
||||
* @param ABC abc
|
||||
* @param abc ABC
|
||||
* @param constants Constant pool
|
||||
* @return String representation
|
||||
*/
|
||||
|
||||
@@ -422,7 +422,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
imports.add(d.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<String> importedNames = new ArrayList<>();
|
||||
|
||||
importedNames.addAll(Arrays.asList(builtInClasses));
|
||||
@@ -485,13 +485,13 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
writer.appendNoHilight("import ");
|
||||
|
||||
if (imp.size() > 1) {
|
||||
writer.appendNoHilight(imp.getWithoutLast().toPrintableString(usedDeobfuscations,abc.getSwf(), true));
|
||||
writer.appendNoHilight(imp.getWithoutLast().toPrintableString(usedDeobfuscations, abc.getSwf(), true));
|
||||
writer.appendNoHilight(".");
|
||||
}
|
||||
if ("*".equals(imp.getLast())) {
|
||||
writer.appendNoHilight("*");
|
||||
} else {
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(abc.getSwf(),usedDeobfuscations, true, imp.getLast()), HighlightSpecialType.TYPE_NAME, imp.toRawString());
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(abc.getSwf(), usedDeobfuscations, true, imp.getLast()), HighlightSpecialType.TYPE_NAME, imp.toRawString());
|
||||
}
|
||||
writer.appendNoHilight(";").newLine();
|
||||
hasImport = true;
|
||||
@@ -676,7 +676,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
if (!(classIndex == -1 && nskind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
if (!(classIndex == -1 && nskind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
String nsPrefix = Namespace.getPrefix(nskind);
|
||||
if (nsPrefix != null && !nsPrefix.isEmpty()) {
|
||||
writer.appendNoHilight(nsPrefix).appendNoHilight(" ");
|
||||
@@ -888,8 +888,8 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
}
|
||||
writer.startBlock();
|
||||
List<Trait> traits = new ArrayList<>();
|
||||
traits.add(this);
|
||||
writeImports(usedDeobfuscations, traits, -1, abcIndex, scriptIndex, classIndex, isStatic, abc, writer, getPackage(abc), fullyQualifiedNames);
|
||||
traits.add(this);
|
||||
writeImports(usedDeobfuscations, traits, -1, abcIndex, scriptIndex, classIndex, isStatic, abc, writer, getPackage(abc), fullyQualifiedNames);
|
||||
toString(usedDeobfuscations, swfVersion, abcIndex, name.getNameWithNamespace(usedDeobfuscations, abc, abc.constants, true).getWithoutLast(), parent, convertData, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel, insideInterface);
|
||||
writer.endBlock();
|
||||
writer.newLine();
|
||||
@@ -900,7 +900,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
/**
|
||||
* Converts trait including package.
|
||||
*
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param usedDeobfuscations Used deobfuscations
|
||||
* @param swfVersion
|
||||
* @param abcIndex ABC indexing
|
||||
* @param parent Parent trait
|
||||
|
||||
@@ -256,12 +256,12 @@ public class ActionScript2Parser {
|
||||
* Charset
|
||||
*/
|
||||
private String charset;
|
||||
|
||||
|
||||
/**
|
||||
* SWF
|
||||
*/
|
||||
private SWF swf;
|
||||
|
||||
|
||||
/**
|
||||
* Obfuscation identifiers replacements
|
||||
*/
|
||||
@@ -1821,7 +1821,7 @@ public class ActionScript2Parser {
|
||||
//Both ASs
|
||||
case "dup":
|
||||
ret = new DuplicateItem(DIALECT, null, null, expression(inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, false, hasEval));
|
||||
allowMemberOrCall = true;
|
||||
allowMemberOrCall = true;
|
||||
break;
|
||||
case "push":
|
||||
ret = new PushItem(expression(inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, false, hasEval));
|
||||
@@ -2210,13 +2210,13 @@ public class ActionScript2Parser {
|
||||
* @throws InterruptedException On interrupt
|
||||
*/
|
||||
public List<GraphTargetItem> treeFromString(String str, List<String> constantPool) throws ActionParseException, IOException, InterruptedException {
|
||||
|
||||
|
||||
try {
|
||||
replacements = IdentifiersDeobfuscation.getReplacementsFromDoc(str);
|
||||
} catch (Exception ex) {
|
||||
throw new ActionParseException(ex.getMessage(), -1);
|
||||
throw new ActionParseException(ex.getMessage(), -1);
|
||||
}
|
||||
|
||||
|
||||
List<GraphTargetItem> retTree = new ArrayList<>();
|
||||
this.constantPool = constantPool;
|
||||
lexer = new ActionScriptLexer(new StringReader(str));
|
||||
|
||||
@@ -27,14 +27,15 @@ import java.util.logging.Logger;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ActionScriptDocParser {
|
||||
|
||||
public List<AsDocComment> parse(String str) {
|
||||
List<AsDocComment> comments = new ArrayList<>();
|
||||
List<AsDocComment> comments = new ArrayList<>();
|
||||
ActionScriptDocLexer lexer = new ActionScriptDocLexer(str);
|
||||
try {
|
||||
ParsedSymbol s = lexer.yylex();
|
||||
String startText = null;
|
||||
List<AsDocTag> tags = new ArrayList<>();
|
||||
while(s.type != SymbolType.EOF) {
|
||||
while (s.type != SymbolType.EOF) {
|
||||
if (s.type == SymbolType.DOC_BEGIN) {
|
||||
startText = s.text;
|
||||
}
|
||||
@@ -49,7 +50,7 @@ public class ActionScriptDocParser {
|
||||
s = lexer.yylex();
|
||||
}
|
||||
} catch (IOException | AsDocParseException ex) {
|
||||
|
||||
//ignored
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
|
||||
|
||||
return Action.actionsToSource(requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), this, actions, getScriptName(), writer, getCharset(), treeOperations);
|
||||
}
|
||||
|
||||
|
||||
private boolean requiresUninitielizedClassTraitsDetection() {
|
||||
return swf.needsCalculatingAS2UninitializeClassTraits(this);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
|
||||
@Override
|
||||
public List<GraphTargetItem> getActionsToTree() {
|
||||
try {
|
||||
return Action.actionsToTree(new LinkedHashSet<>(),requiresUninitielizedClassTraitsDetection(), requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), true, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
|
||||
return Action.actionsToTree(new LinkedHashSet<>(), requiresUninitielizedClassTraitsDetection(), requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), true, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
|
||||
} catch (InterruptedException ex) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ public class ButtonAction implements ASMSource {
|
||||
@Override
|
||||
public List<GraphTargetItem> getActionsToTree() {
|
||||
try {
|
||||
return Action.actionsToTree(new LinkedHashSet<>(),false, new HashMap<>(), false, false, getActions(), buttonTag.getSwf().version, 0, getScriptName(), buttonTag.getSwf().getCharset());
|
||||
return Action.actionsToTree(new LinkedHashSet<>(), false, new HashMap<>(), false, false, getActions(), buttonTag.getSwf().version, 0, getScriptName(), buttonTag.getSwf().getCharset());
|
||||
} catch (InterruptedException ex) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Get parent CLIPACTIONS object
|
||||
*
|
||||
* @return Parent CLIPACTIONS object
|
||||
*/
|
||||
public CLIPACTIONS getParentClipActions() {
|
||||
@@ -130,6 +131,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Converts key code to string
|
||||
*
|
||||
* @param key Key code
|
||||
* @return String representation of key code
|
||||
*/
|
||||
@@ -143,6 +145,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Converts string to key code
|
||||
*
|
||||
* @param str String representation of key code
|
||||
* @return Key code
|
||||
*/
|
||||
@@ -160,9 +163,6 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for Generic tag editor.
|
||||
*/
|
||||
@@ -175,6 +175,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param swf SWF
|
||||
* @param tag Tag
|
||||
*/
|
||||
@@ -192,6 +193,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Sets parent CLIPACTIONS object
|
||||
*
|
||||
* @param parentClipActions Parent CLIPACTIONS object
|
||||
*/
|
||||
public void setParentClipActions(CLIPACTIONS parentClipActions) {
|
||||
@@ -211,6 +213,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param swf SWF
|
||||
* @param sis SWF input stream
|
||||
* @param tag Tag
|
||||
@@ -406,7 +409,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag {
|
||||
@Override
|
||||
public List<GraphTargetItem> getActionsToTree() {
|
||||
try {
|
||||
return Action.actionsToTree(new LinkedHashSet<>(),false, new HashMap<>(), false, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
|
||||
return Action.actionsToTree(new LinkedHashSet<>(), false, new HashMap<>(), false, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
|
||||
} catch (InterruptedException ex) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -534,7 +534,6 @@ public class DottedChain implements Serializable, Comparable<DottedChain> {
|
||||
/**
|
||||
* To raw string. (without deobfuscation)
|
||||
*
|
||||
* @param swf SWF
|
||||
* @return Raw string
|
||||
*/
|
||||
public String toRawString() { //Is SUFFIX correctly handled?
|
||||
|
||||
Reference in New Issue
Block a user