Issues #944,#991,#939 AS3 obfuscated switch read fix, wrong constants indices fix

This commit is contained in:
Jindra Petřík
2015-07-05 12:53:03 +02:00
parent 68cd20fa9c
commit cbbdded296
11 changed files with 154 additions and 36 deletions

View File

@@ -80,7 +80,7 @@ public class ActionScript3AssemblerTest extends ActionScriptTestBase {
+ str
+ "returnvoid\r\n";
MethodBody b = new MethodBody();
MethodBody b = new MethodBody(getABC());
AVM2Code code = ASM3Parser.parse(new StringReader(str), getABC().constants, null, b, new MethodInfo());
b.setCode(code);
return b;

View File

@@ -80,12 +80,12 @@ public class ActionScript3DeobfuscatorTest extends ActionStript2TestBase {
return 0;
}
});
MethodBody b = new MethodBody();
MethodBody b = new MethodBody(abc);
AVM2Code code = ASM3Parser.parse(new StringReader(str), abc.constants, null, b, new MethodInfo());
b.setCode(code);
new AVM2DeobfuscatorJumps().deobfuscate("test", 0, true, 0, abc, abc.constants, null, new MethodInfo(), b);
HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false);
code.toASMSource(abc.constants, null, new MethodInfo(), new MethodBody(), ScriptExportMode.PCODE, writer);
code.toASMSource(abc.constants, null, new MethodInfo(), new MethodBody(abc), ScriptExportMode.PCODE, writer);
String ret = writer.toString();
return ret.substring(ret.lastIndexOf("code\r\n") + 6);
}