mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-28 03:22:50 +00:00
Issue #698 Better obfuscated identifiers handling, separated reserved keyword for AS2/AS3
This commit is contained in:
@@ -214,7 +214,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
@@ -98,7 +98,7 @@ public abstract class AVM2Item extends GraphTargetItem {
|
||||
|
||||
public static String localRegName(HashMap<Integer, String> localRegNames, int reg) {
|
||||
if (localRegNames.containsKey(reg)) {
|
||||
return Deobfuscation.printIdentifier(localRegNames.get(reg));
|
||||
return IdentifiersDeobfuscation.printIdentifier(true,localRegNames.get(reg));
|
||||
} else {
|
||||
if (reg == 0) {
|
||||
return "this";
|
||||
|
||||
+1959
-2121
File diff suppressed because it is too large
Load Diff
+30
-50
@@ -260,7 +260,7 @@ public class ActionScriptParser {
|
||||
s = lex();
|
||||
} else {
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String propName = s.value.toString();
|
||||
GraphTargetItem propItem = null;
|
||||
s = lex();
|
||||
@@ -274,7 +274,7 @@ public class ActionScriptParser {
|
||||
expectedType(SymbolType.BRACKET_CLOSE);
|
||||
propName = null;
|
||||
} else {
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
propName = s.value.toString();
|
||||
propItem = null;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class ActionScriptParser {
|
||||
name += "@";
|
||||
s = lex();
|
||||
}
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP);
|
||||
name += s.value.toString();
|
||||
s = lex();
|
||||
boolean attrBracket = false;
|
||||
@@ -313,7 +313,7 @@ public class ActionScriptParser {
|
||||
s = lex();
|
||||
if (s.type == SymbolType.MULTIPLY) {
|
||||
name += s.value.toString();
|
||||
} else if (s.type == SymbolType.IDENTIFIER) {
|
||||
} else if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
name += s.value.toString();
|
||||
} else {
|
||||
if (s.type != SymbolType.BRACKET_OPEN) {
|
||||
@@ -323,7 +323,7 @@ public class ActionScriptParser {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.NAMESPACE);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.NAMESPACE);
|
||||
name += s.value.toString();
|
||||
}
|
||||
s = lex();
|
||||
@@ -338,7 +338,7 @@ public class ActionScriptParser {
|
||||
nsname = name;
|
||||
}
|
||||
s = lex();
|
||||
if (s.type == SymbolType.IDENTIFIER) {
|
||||
if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
nsprop = s.value.toString();
|
||||
} else if (s.type == SymbolType.BRACKET_OPEN) {
|
||||
nspropItem = expression(thisType, pkg, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, true, variables);
|
||||
@@ -350,27 +350,7 @@ public class ActionScriptParser {
|
||||
name = null;
|
||||
}
|
||||
s = lex();
|
||||
}
|
||||
/*
|
||||
List<GraphTargetItem> params = new ArrayList<>();
|
||||
if (s.type == SymbolType.TYPENAME) {
|
||||
s = lex();
|
||||
do {
|
||||
String p = "";
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
p = s.value.toString();
|
||||
s = lex();
|
||||
while (s.type == SymbolType.DOT) {
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
name += "." + s.value.toString();
|
||||
s = lex();
|
||||
}
|
||||
params.add(p);
|
||||
} while (s.type == SymbolType.COMMA);
|
||||
expected(s, lexer.yyline(), SymbolType.GREATER_THAN);
|
||||
s = lex();
|
||||
}*/
|
||||
}
|
||||
|
||||
GraphTargetItem ret = null;
|
||||
if (name != null) {
|
||||
@@ -478,7 +458,7 @@ public class ActionScriptParser {
|
||||
hasRest = true;
|
||||
s = lex();
|
||||
}
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
|
||||
paramNames.add(s.value.toString());
|
||||
s = lex();
|
||||
@@ -580,7 +560,7 @@ public class ActionScriptParser {
|
||||
s = lex();
|
||||
}
|
||||
|
||||
while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolType.IDENTIFIER)) {
|
||||
while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER)) {
|
||||
if (s.type == SymbolType.FINAL) {
|
||||
if (isFinal) {
|
||||
throw new AVM2ParseException("Only one final keyword allowed", lexer.yyline());
|
||||
@@ -607,7 +587,7 @@ public class ActionScriptParser {
|
||||
throw new AVM2ParseException("Only one static keyword allowed", lexer.yyline());
|
||||
}
|
||||
isStatic = true;
|
||||
} else if (s.type == SymbolType.IDENTIFIER) {
|
||||
} else if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
customAccess = s.value.toString();
|
||||
namespace = -2;
|
||||
} else {
|
||||
@@ -666,7 +646,7 @@ public class ActionScriptParser {
|
||||
|
||||
//GraphTargetItem classTypeStr = type(thisType,pkg,needsActivation, importedClasses, openedNamespaces, variables);
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String classTypeStr = s.value.toString();
|
||||
GraphTargetItem extendsTypeStr = null;
|
||||
s = lex();
|
||||
@@ -704,7 +684,7 @@ public class ActionScriptParser {
|
||||
}
|
||||
//GraphTargetItem interfaceTypeStr = type(thisType,pkg,needsActivation, importedClasses, openedNamespaces, variables);
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String intTypeStr = s.value.toString();
|
||||
s = lex();
|
||||
List<GraphTargetItem> intExtendsTypeStrs = new ArrayList<>();
|
||||
@@ -744,7 +724,7 @@ public class ActionScriptParser {
|
||||
s = lex();
|
||||
}
|
||||
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String fname = s.value.toString();
|
||||
if (classNameStr != null && fname.equals(classNameStr)) { //constructor
|
||||
if (isStatic) {
|
||||
@@ -803,7 +783,7 @@ public class ActionScriptParser {
|
||||
throw new AVM2ParseException("Interface cannot have namespace fields", lexer.yyline());
|
||||
}
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String nname = s.value.toString();
|
||||
String nval = "";
|
||||
s = lex();
|
||||
@@ -840,7 +820,7 @@ public class ActionScriptParser {
|
||||
}
|
||||
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String vcname = s.value.toString();
|
||||
s = lex();
|
||||
GraphTargetItem type = null;
|
||||
@@ -1194,7 +1174,7 @@ public class ActionScriptParser {
|
||||
}
|
||||
String loopLabel = null;
|
||||
|
||||
if (s.type == SymbolType.IDENTIFIER) {
|
||||
if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
ParsedSymbol sc = lex();
|
||||
if (sc.type == SymbolType.COLON) {
|
||||
loopLabel = s.value.toString();
|
||||
@@ -1206,7 +1186,7 @@ public class ActionScriptParser {
|
||||
|
||||
if (s.type == SymbolType.DEFAULT) {
|
||||
ParsedSymbol sx = lex();
|
||||
if (sx.type != SymbolType.IDENTIFIER) {
|
||||
if (sx.group != SymbolGroup.IDENTIFIER) {
|
||||
lexer.pushback(sx);
|
||||
} else {
|
||||
if (!sx.value.equals("xml")) {
|
||||
@@ -1266,13 +1246,13 @@ public class ActionScriptParser {
|
||||
break;*/
|
||||
case FUNCTION:
|
||||
s = lexer.lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
needsActivation.setVal(true);
|
||||
ret = (function(pkg, false, needsActivation, importedClasses, 0/*?*/, thisType, openedNamespaces, s.value.toString(), false, variables));
|
||||
break;
|
||||
case VAR:
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
String varIdentifier = s.value.toString();
|
||||
s = lex();
|
||||
GraphTargetItem type;
|
||||
@@ -1480,7 +1460,7 @@ public class ActionScriptParser {
|
||||
if (loops.isEmpty()) {
|
||||
throw new AVM2ParseException("No loop to break", lexer.yyline());
|
||||
}
|
||||
if (s.type == SymbolType.IDENTIFIER) {
|
||||
if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
String breakLabel = s.value.toString();
|
||||
for (Loop l : loops) {
|
||||
if (breakLabel.equals(loopLabels.get(l))) {
|
||||
@@ -1503,7 +1483,7 @@ public class ActionScriptParser {
|
||||
if (loops.isEmpty()) {
|
||||
throw new AVM2ParseException("No loop to continue", lexer.yyline());
|
||||
}
|
||||
if (s.type == SymbolType.IDENTIFIER) {
|
||||
if (s.group == SymbolGroup.IDENTIFIER) {
|
||||
String continueLabel = s.value.toString();
|
||||
for (Loop l : loops) {
|
||||
if (l.id < 0) { //negative id marks switch => no continue
|
||||
@@ -1553,7 +1533,7 @@ public class ActionScriptParser {
|
||||
while (s.type == SymbolType.CATCH) {
|
||||
expectedType(SymbolType.PARENT_OPEN);
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.THIS, SymbolType.SUPER, SymbolType.STRING_OP);
|
||||
|
||||
String enamestr = s.value.toString();
|
||||
expectedType(SymbolType.COLON);
|
||||
@@ -1696,7 +1676,7 @@ public class ActionScriptParser {
|
||||
break;
|
||||
case DESCENDANTS:
|
||||
ParsedSymbol d = lex();
|
||||
expected(d, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.MULTIPLY);
|
||||
expected(d, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.MULTIPLY);
|
||||
ret = new GetDescendantsAVM2Item(expr, d.type == SymbolType.MULTIPLY ? null : d.value.toString(), openedNamespaces);
|
||||
allowRemainder = true;
|
||||
break;
|
||||
@@ -2054,7 +2034,7 @@ public class ActionScriptParser {
|
||||
lexer.pushback(s);
|
||||
}
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER, SymbolType.STRING);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.STRING);
|
||||
|
||||
GraphTargetItem n = new StringAVM2Item(null, s.value.toString());
|
||||
//expression(thisType,pkg,needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, allowRemainder, variables);
|
||||
@@ -2082,7 +2062,7 @@ public class ActionScriptParser {
|
||||
case FUNCTION:
|
||||
s = lexer.lex();
|
||||
String fname = "";
|
||||
if (s.isType(SymbolType.IDENTIFIER)) {
|
||||
if (s.isType(SymbolGroup.IDENTIFIER)) {
|
||||
fname = s.value.toString();
|
||||
} else {
|
||||
lexer.pushback(s);
|
||||
@@ -2146,7 +2126,7 @@ public class ActionScriptParser {
|
||||
if (s.type == SymbolType.FUNCTION) {
|
||||
s = lexer.lex();
|
||||
String ffname = "";
|
||||
if (s.isType(SymbolType.IDENTIFIER)) {
|
||||
if (s.isType(SymbolGroup.IDENTIFIER)) {
|
||||
ffname = s.value.toString();
|
||||
} else {
|
||||
lexer.pushback(s);
|
||||
@@ -2221,14 +2201,14 @@ public class ActionScriptParser {
|
||||
String name = "";
|
||||
ParsedSymbol s = lex();
|
||||
if (s.type != SymbolType.CURLY_OPEN) {
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
name = s.value.toString();
|
||||
s = lex();
|
||||
}
|
||||
while (s.type != SymbolType.CURLY_OPEN) {
|
||||
expected(s, lexer.yyline(), SymbolType.DOT);
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
name += "." + s.value.toString();
|
||||
s = lex();
|
||||
}
|
||||
@@ -2241,7 +2221,7 @@ public class ActionScriptParser {
|
||||
String impName = null;
|
||||
boolean all = false;
|
||||
s = lex();
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
impName = s.value.toString();
|
||||
s = lex();
|
||||
while (s.type == SymbolType.DOT) {
|
||||
@@ -2256,7 +2236,7 @@ public class ActionScriptParser {
|
||||
s = lex();
|
||||
break;
|
||||
}
|
||||
expected(s, lexer.yyline(), SymbolType.IDENTIFIER);
|
||||
expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER);
|
||||
|
||||
impName = s.value.toString();
|
||||
s = lex();
|
||||
|
||||
+4
-2
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
*/
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
|
||||
/**
|
||||
@@ -201,5 +202,6 @@ public enum SymbolType {
|
||||
XML_INSTRATTRVALVAR_BEGIN, // aaa={
|
||||
XML_INSTRVARTAG_BEGIN, // <?{
|
||||
FILTER,
|
||||
DESCENDANTS
|
||||
DESCENDANTS,
|
||||
NATIVE
|
||||
}
|
||||
|
||||
+15
-15
@@ -15,7 +15,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.ParseException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
@@ -29,7 +29,7 @@ import java.io.StringReader;
|
||||
%unicode
|
||||
%char
|
||||
%type ParsedSymbol
|
||||
%throws ParseException
|
||||
%throws AVM2ParseException
|
||||
|
||||
%{
|
||||
|
||||
@@ -93,7 +93,7 @@ import java.io.StringReader;
|
||||
informListenersPushBack(symb);
|
||||
}
|
||||
ParsedSymbol last;
|
||||
public ParsedSymbol lex() throws java.io.IOException, ParseException{
|
||||
public ParsedSymbol lex() throws java.io.IOException, AVM2ParseException{
|
||||
ParsedSymbol ret=null;
|
||||
if(!pushedBack.isEmpty()){
|
||||
ret = last = pushedBack.pop();
|
||||
@@ -212,7 +212,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); }
|
||||
"else" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.ELSE,yytext()); }
|
||||
"for" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FOR,yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EACH,yytext()); }
|
||||
"each" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.EACH,yytext()); }
|
||||
"in" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IN,yytext()); }
|
||||
"if" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IF,yytext()); }
|
||||
"return" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.RETURN,yytext()); }
|
||||
@@ -224,23 +224,23 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
"finally" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINALLY,yytext()); }
|
||||
"while" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WHILE,yytext()); }
|
||||
"with" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.WITH,yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.DYNAMIC,yytext()); }
|
||||
"dynamic" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.DYNAMIC,yytext()); }
|
||||
"internal" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERNAL,yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.OVERRIDE,yytext()); }
|
||||
"override" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.OVERRIDE,yytext()); }
|
||||
"private" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PRIVATE,yytext()); }
|
||||
"protected" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PROTECTED,yytext()); }
|
||||
"public" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PUBLIC,yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.STATIC,yytext()); }
|
||||
"static" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.STATIC,yytext()); }
|
||||
"class" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CLASS,yytext()); }
|
||||
"const" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.CONST,yytext()); }
|
||||
"extends" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.EXTENDS,yytext()); }
|
||||
"function" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FUNCTION,yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.GET,yytext()); }
|
||||
"get" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.GET,yytext()); }
|
||||
"implements" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPLEMENTS,yytext()); }
|
||||
"interface" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.INTERFACE,yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.NAMESPACE,yytext()); }
|
||||
"namespace" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.NAMESPACE,yytext()); }
|
||||
"package" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.PACKAGE,yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.SET,yytext()); }
|
||||
"set" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.SET,yytext()); }
|
||||
"var" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.VAR,yytext()); }
|
||||
"import" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.IMPORT,yytext()); }
|
||||
"use" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.USE,yytext()); }
|
||||
@@ -251,8 +251,8 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
"undefined" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.UNDEFINED,yytext()); }
|
||||
"Infinity" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.INFINITY,yytext()); }
|
||||
"NaN" { return new ParsedSymbol(SymbolGroup.GLOBALCONST,SymbolType.NAN,yytext()); }
|
||||
"final" { return new ParsedSymbol(SymbolGroup.KEYWORD,SymbolType.FINAL,yytext()); }
|
||||
|
||||
"final" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.FINAL,yytext()); }
|
||||
"native" { return new ParsedSymbol(SymbolGroup.IDENTIFIER,SymbolType.NATIVE,yytext()); }
|
||||
|
||||
/* operators */
|
||||
|
||||
@@ -584,7 +584,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ OIdentifierCharacter = [^\r\n\u00A7\\]
|
||||
|
||||
/* escape sequences */
|
||||
|
||||
\\. { throw new ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
\\. { throw new AVM2ParseException("Illegal escape sequence \""+yytext()+"\"",yyline+1); }
|
||||
{LineTerminator} { yybegin(YYINITIAL); yyline++;}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewFunctionIns;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -283,9 +283,9 @@ public class MethodInfo {
|
||||
pdata.put("regIndex", ""+(i+1));
|
||||
if (!localRegNames.isEmpty()) {
|
||||
pdata.put("slotName", localRegNames.get(i + 1)); //assuming it is a slot
|
||||
writer.hilightSpecial(Deobfuscation.printIdentifier(localRegNames.get(i + 1)),"paramname",i,pdata);
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(true,localRegNames.get(i + 1)),"paramname",i,pdata);
|
||||
} else if ((paramNames.length > i) && (paramNames[i] != 0) && Configuration.paramNamesEnable.get()) {
|
||||
writer.hilightSpecial(Deobfuscation.printIdentifier(constants.getString(paramNames[i])),"paramname",i,pdata);
|
||||
writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(true,constants.getString(paramNames[i])),"paramname",i,pdata);
|
||||
} else {
|
||||
writer.hilightSpecial("param" + (i + 1),"paramname",i,pdata);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.abc.types;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import java.util.List;
|
||||
|
||||
@@ -264,7 +264,7 @@ public class Multiname {
|
||||
if ((fullyQualifiedNames != null) && fullyQualifiedNames.contains(name)) {
|
||||
return getNameWithNamespace(constants, raw);
|
||||
}
|
||||
return (isAttribute() ? "@" : "") + (raw ? name : Deobfuscation.printIdentifier(name));
|
||||
return (isAttribute() ? "@" : "") + (raw ? name : IdentifiersDeobfuscation.printIdentifier(true,name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.abc.types;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
|
||||
|
||||
public class Namespace {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Namespace {
|
||||
if (raw) {
|
||||
return constants.getString(name_index);
|
||||
}
|
||||
return Deobfuscation.printNamespace(constants.getString(name_index));
|
||||
return IdentifiersDeobfuscation.printNamespace(true,constants.getString(name_index));
|
||||
}
|
||||
|
||||
public boolean hasName(String name, AVM2ConstantPool constants) {
|
||||
|
||||
Reference in New Issue
Block a user