mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-19 04:41:53 +00:00
AS1/2 deobfuscation fix.
This commit is contained in:
@@ -81,6 +81,8 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
|
||||
@@ -235,8 +237,10 @@ public class SWFOutputStream extends OutputStream {
|
||||
* @throws IOException
|
||||
*/
|
||||
public void writeSI16(int value) throws IOException {
|
||||
|
||||
if (value > 0x7fff) {
|
||||
throw new Error("Value is too large for SI16: " + value);
|
||||
Logger.getLogger(SWFOutputStream.class.getName()).log(Level.WARNING, "Value is too large for SI16: " + value + ", 0 written", new Exception());
|
||||
value = 0;
|
||||
}
|
||||
|
||||
writeUI16(value);
|
||||
|
||||
@@ -697,6 +697,7 @@ public class ActionListReader {
|
||||
ActionJump aJump = new ActionDeobfuscateJump(0);
|
||||
int jumpLength = aJump.getTotalActionLength();
|
||||
aJump.setAddress(a.getAddress());
|
||||
//FIXME! This offset can be larger than SI16 value!
|
||||
aJump.setJumpOffset(actionLengthWithHeader - jumpLength);
|
||||
a = aJump;
|
||||
actionLengthWithHeader = a.getTotalActionLength();
|
||||
|
||||
@@ -192,8 +192,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
ActionPush push = new ActionPush(0);
|
||||
push.values.clear();
|
||||
for (GraphTargetItem graphTargetItem : result.stack) {
|
||||
DirectValueActionItem dv = (DirectValueActionItem) graphTargetItem;
|
||||
push.values.add(dv.value);
|
||||
push.values.add(graphTargetItem.getResult());
|
||||
}
|
||||
push.setAddress(prevAction.getAddress());
|
||||
actions.addAction(i++, push);
|
||||
|
||||
@@ -155,8 +155,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
ActionPush push = new ActionPush(0);
|
||||
push.values.clear();
|
||||
for (GraphTargetItem graphTargetItem : result.stack) {
|
||||
DirectValueActionItem dv = (DirectValueActionItem) graphTargetItem;
|
||||
push.values.add(dv.value);
|
||||
push.values.add(graphTargetItem.getResult());
|
||||
}
|
||||
push.setAddress(prevAction.getAddress());
|
||||
actions.addAction(i++, push);
|
||||
|
||||
Reference in New Issue
Block a user