mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 18:20:43 +00:00
AS3 PCode serach
This commit is contained in:
@@ -40,6 +40,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedText;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
@@ -616,4 +617,15 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
|
||||
((Tag) abc.parentTag).setModified(true);
|
||||
}
|
||||
|
||||
public void getMethodInfos(List<MethodId> methodInfos) {
|
||||
int script_init = abc.script_info.get(scriptIndex).init_index;
|
||||
methodInfos.add(new MethodId(-1, script_init));
|
||||
|
||||
List<Trait> traits = abc.script_info.get(scriptIndex).traits.traits;
|
||||
for (int t = 0; t < traitIndices.size(); t++) {
|
||||
Trait trait = traits.get(t);
|
||||
trait.getMethodInfos(abc, -1, methodInfos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.jpexs.decompiler.flash.exporters.script.DependencyType;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -110,8 +111,8 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
}
|
||||
if (Configuration.handleSkinPartsAutomatically.get()) {
|
||||
/*
|
||||
private static var _skinParts:Object = {"attr":false,"attr2":true};
|
||||
=>
|
||||
private static var _skinParts:Object = {"attr":false,"attr2":true};
|
||||
=>
|
||||
[SkinPart required="false"]
|
||||
public var attr;
|
||||
[SkinPart required="true"]
|
||||
@@ -509,4 +510,6 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
public boolean isVisible(boolean isStatic, ABC abc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.exporters.script.DependencyType;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TypeItem;
|
||||
@@ -275,4 +276,21 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
writer.newLine();
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos) {
|
||||
InstanceInfo instanceInfo = abc.instance_info.get(class_info);
|
||||
ClassInfo classInfo = abc.class_info.get(class_info);
|
||||
|
||||
//class initializer
|
||||
methodInfos.add(new MethodId(class_info, classInfo.cinit_index));
|
||||
|
||||
//constructor - instance initializer
|
||||
methodInfos.add(new MethodId(class_info, instanceInfo.iinit_index));
|
||||
|
||||
//static variables,constants & methods
|
||||
classInfo.static_traits.getMethodInfos(abc, class_info, methodInfos);
|
||||
|
||||
instanceInfo.instance_traits.getMethodInfos(abc, class_info, methodInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.exporters.script.DependencyParser;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -144,4 +145,9 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
writer.hilightSpecial(Integer.toString(slot_id), HighlightSpecialType.SLOT_ID);
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos) {
|
||||
methodInfos.add(new MethodId(classIndex, method_info));
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.exporters.script.DependencyParser;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -225,4 +226,9 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
writer.newLine();
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos) {
|
||||
methodInfos.add(new MethodId(classIndex, method_info));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.jpexs.decompiler.flash.exporters.script.DependencyType;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
@@ -245,4 +246,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.exporters.script.Dependency;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.search.MethodId;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
@@ -250,4 +251,11 @@ public class Traits implements Cloneable, Serializable {
|
||||
t.getDependencies(customNs, abc, dependencies, uses, ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
public void getMethodInfos(ABC abc, int classIndex, List<MethodId> methodInfos) {
|
||||
for (int t = 0; t < traits.size(); t++) {
|
||||
Trait trait = traits.get(t);
|
||||
trait.getMethodInfos(abc, classIndex, methodInfos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user