mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-16 12:11:55 +00:00
ABCPanel exec in event dispatch fix
Issue #1083 Fixed offsets of try after AS3 deobfuscation
This commit is contained in:
@@ -2088,9 +2088,9 @@ public class AVM2Code implements Cloneable {
|
||||
|
||||
@Override
|
||||
public int updateOperandOffset(long insAddr, long targetAddress, int offset) {
|
||||
if (insAddr == -1) { //do not check exceptions
|
||||
return offset;
|
||||
}
|
||||
/*if (insAddr == -1) {
|
||||
return offset;
|
||||
}*/
|
||||
adr2pos(targetAddress);
|
||||
return offset;
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple {
|
||||
listedLastBodies.add(bodybefore);
|
||||
}
|
||||
|
||||
body.getCode().removeDeadCode(body);
|
||||
originalBody.exceptions = body.exceptions;
|
||||
originalBody.setCode(body.getCode());
|
||||
body.getCode().removeDeadCode(body);
|
||||
//System.err.println("/deo");
|
||||
}
|
||||
|
||||
|
||||
@@ -146,37 +146,11 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld {
|
||||
listedLastBodies.add(bodybefore);
|
||||
}
|
||||
|
||||
body.getCode().removeDeadCode(body);
|
||||
|
||||
originalBody.exceptions = body.exceptions;
|
||||
originalBody.setCode(body.getCode());
|
||||
body.getCode().removeDeadCode(body);
|
||||
//System.err.println("/deo");
|
||||
}
|
||||
|
||||
private void replaceSingleUseRegisters(Map<Integer, GraphTargetItem> singleRegisters, List<AVM2Instruction> setInss, int classIndex, boolean isStatic, int scriptIndex, ABC abc, AVM2ConstantPool cpool, Trait trait, MethodInfo minfo, MethodBody body) throws InterruptedException {
|
||||
AVM2Code code = body.getCode();
|
||||
|
||||
for (int i = 0; i < code.code.size(); i++) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
}
|
||||
|
||||
AVM2Instruction ins = code.code.get(i);
|
||||
if (((setInss == null) || setInss.contains(ins)) && (ins.definition instanceof SetLocalTypeIns)) {
|
||||
SetLocalTypeIns slt = (SetLocalTypeIns) ins.definition;
|
||||
int regId = slt.getRegisterId(ins);
|
||||
if (singleRegisters.containsKey(regId)) {
|
||||
code.replaceInstruction(i, new AVM2Instruction(ins.offset, DeobfuscatePopIns.getInstance(), null), body);
|
||||
}
|
||||
}
|
||||
|
||||
if (ins.definition instanceof GetLocalTypeIns) {
|
||||
GetLocalTypeIns glt = (GetLocalTypeIns) ins.definition;
|
||||
int regId = glt.getRegisterId(ins);
|
||||
if (singleRegisters.containsKey(regId)) {
|
||||
code.replaceInstruction(i, cpool.makePush(singleRegisters.get(regId).getResult()), body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getFirstRegisterSetter(Reference<AVM2Instruction> assignment, int classIndex, boolean isStatic, int scriptIndex, ABC abc, MethodBody body, Set<Integer> ignoredRegisters, Set<Integer> ignoredGets) throws InterruptedException {
|
||||
|
||||
Reference in New Issue
Block a user