more AS2 deobfuscation fixes & cleanup

This commit is contained in:
honfika@gmail.com
2014-09-21 00:07:04 +02:00
parent 60f7e5e36f
commit 824f40c803
40 changed files with 279 additions and 261 deletions

View File

@@ -153,25 +153,25 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene
SyntaxDocument sDoc = ActionUtils.getSyntaxDocument(decompiledEditor);
if (sDoc != null) {
Token t = sDoc.getTokenAt(pos);
String ident=null;
String ident = null;
//It should be identifier or obfuscated identifier
if (t != null && (t.type == TokenType.IDENTIFIER || t.type == TokenType.REGEX)) {
if (t != null && (t.type == TokenType.IDENTIFIER || t.type == TokenType.REGEX)) {
CharSequence tData = t.getText(sDoc);
ident=tData.toString();
ident = tData.toString();
//We need to get unescaped identifier, so we use our Lexer
ActionScriptLexer lex=new ActionScriptLexer(new StringReader(ident));
ActionScriptLexer lex = new ActionScriptLexer(new StringReader(ident));
try {
ParsedSymbol symb=lex.lex();
if(symb.type==SymbolType.IDENTIFIER){
ident = (String)symb.value;
}else{
ParsedSymbol symb = lex.lex();
if (symb.type == SymbolType.IDENTIFIER) {
ident = (String) symb.value;
} else {
ident = null;
}
} catch (IOException | ActionParseException ex) {
ident=null;
}
}
if(ident==null){
ident = null;
}
}
if (ident == null) {
Highlighting h = Highlighting.search(decompiledHilights, pos);
if (h != null) {
List<Action> list = lastCode;
@@ -206,11 +206,11 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene
}
}
}else{
} else {
return ident;
}
}
return null;
return null;
}
private CachedScript getCached(ASMSource pack) {