mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-08-02 16:01:15 +00:00
Propagate ABCIndex everywhere
This commit is contained in:
@@ -108,9 +108,9 @@ public abstract class ActionScript3DecompileTestBase extends ActionScriptTestBas
|
||||
|
||||
Configuration.autoDeobfuscate.set(methodName.toLowerCase().contains("obfus"));
|
||||
|
||||
abc.bodies.get(bodyIndex).convert(new ConvertData(), "run", ScriptExportMode.AS, isStatic, abc.bodies.get(bodyIndex).method_info, scriptIndex, clsIndex, abc, null, new ScopeStack(), 0, new NulWriter(), new ArrayList<>(), ts, true, new HashSet<>());
|
||||
abc.bodies.get(bodyIndex).convert(swf.getAbcIndex(), new ConvertData(), "run", ScriptExportMode.AS, isStatic, abc.bodies.get(bodyIndex).method_info, scriptIndex, clsIndex, abc, null, new ScopeStack(), 0, new NulWriter(), new ArrayList<>(), ts, true, new HashSet<>());
|
||||
writer = new HighlightedTextWriter(new CodeFormatting(), false);
|
||||
abc.bodies.get(bodyIndex).toString("run", ScriptExportMode.AS, abc, null, writer, new ArrayList<>(), new HashSet<>());
|
||||
abc.bodies.get(bodyIndex).toString(swf.getAbcIndex(), "run", ScriptExportMode.AS, abc, null, writer, new ArrayList<>(), new HashSet<>());
|
||||
} catch (InterruptedException ex) {
|
||||
fail();
|
||||
return;
|
||||
|
||||
@@ -131,7 +131,7 @@ public class ActionScript3DeobfuscatorTest extends ActionScriptTestBase {
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false);
|
||||
par.addScript(str, "Test.as", 0, 0);
|
||||
|
||||
abc.script_info.get(0).getPacks(abc, 0, "", new ArrayList<>()).get(0).toSource(writer, abc.script_info.get(0).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
abc.script_info.get(0).getPacks(abc, 0, "", new ArrayList<>()).get(0).toSource(swf.getAbcIndex(), writer, abc.script_info.get(0).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class DirectEditingTest extends FileTestBase {
|
||||
|
||||
System.out.println("Recompiling:" + classPathString + "...");
|
||||
try {
|
||||
en.toSource(htw, abc.script_info.get(s).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
en.toSource(swf.getAbcIndex(), htw, abc.script_info.get(s).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
String original = htw.toString();
|
||||
abc.replaceScriptPack(As3ScriptReplacerFactory.createFFDec() /*TODO: test the otherone*/, en, original);
|
||||
} catch (As3ScriptReplaceException ex) {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.as3decompile;
|
||||
|
||||
import com.jpexs.decompiler.flash.ActionScript3DecompileTestBase;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
||||
import com.jpexs.decompiler.flash.abc.types.ConvertData;
|
||||
@@ -50,7 +51,8 @@ public class ActionScript3ClassTest extends ActionScript3DecompileTestBase {
|
||||
DoABC2Tag tag = null;
|
||||
ABC abc = null;
|
||||
ScriptPack scriptPack = null;
|
||||
for (Tag t : getSwf(swfId).getTags()) {
|
||||
SWF swf = getSwf(swfId);
|
||||
for (Tag t : swf.getTags()) {
|
||||
if (t instanceof DoABC2Tag) {
|
||||
tag = (DoABC2Tag) t;
|
||||
abc = tag.getABC();
|
||||
@@ -65,7 +67,7 @@ public class ActionScript3ClassTest extends ActionScript3DecompileTestBase {
|
||||
HighlightedTextWriter writer = null;
|
||||
try {
|
||||
writer = new HighlightedTextWriter(new CodeFormatting(), false);
|
||||
scriptPack.toSource(writer, abc.script_info.get(scriptPack.scriptIndex).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
scriptPack.toSource(swf.getAbcIndex(), writer, abc.script_info.get(scriptPack.scriptIndex).traits.traits, new ConvertData(), ScriptExportMode.AS, false, false);
|
||||
} catch (InterruptedException ex) {
|
||||
fail();
|
||||
}
|
||||
|
||||
@@ -145,8 +145,8 @@ public class AS3Generator {
|
||||
|
||||
Configuration.autoDeobfuscate.set(clsName.toLowerCase().contains("obfus"));
|
||||
|
||||
b.convert(new ConvertData(), "", ScriptExportMode.AS, false, ((TraitMethodGetterSetter) t).method_info, pack.scriptIndex, classId, abc, null, new ScopeStack(), 0, new NulWriter(), new ArrayList<>(), ts, true, new HashSet<>());
|
||||
b.toString("", ScriptExportMode.AS, abc, null, src, new ArrayList<>(), new HashSet<>());
|
||||
b.convert(swf.getAbcIndex(),new ConvertData(), "", ScriptExportMode.AS, false, ((TraitMethodGetterSetter) t).method_info, pack.scriptIndex, classId, abc, null, new ScopeStack(), 0, new NulWriter(), new ArrayList<>(), ts, true, new HashSet<>());
|
||||
b.toString(swf.getAbcIndex(), "", ScriptExportMode.AS, abc, null, src, new ArrayList<>(), new HashSet<>());
|
||||
String[] srcs = src.toString().split("[\r\n]+");
|
||||
for (int i = 0; i < srcs.length; i++) {
|
||||
String ss = srcs[i];
|
||||
|
||||
Reference in New Issue
Block a user