Fixed: #2486 AS1/2 deobfuscator pop handling

This commit is contained in:
Jindra Petřík
2025-07-20 18:45:26 +02:00
parent 7076cdfc36
commit c462dbfb9c
2 changed files with 65 additions and 37 deletions

View File

@@ -596,6 +596,7 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter {
boolean skippedInstructionsUnknown = false;
boolean jumpedHere = true;
boolean jumpFound = false;
boolean pushDuplicateBefore = false;
while (true) {
if (item.isExcluded()) {
break;
@@ -665,7 +666,7 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter {
if (!(action instanceof ActionPush
|| action instanceof ActionPushDuplicate
|| action instanceof ActionPop
|| (action instanceof ActionPop && pushDuplicateBefore)
|| action instanceof ActionAsciiToChar
|| action instanceof ActionCharToAscii
|| action instanceof ActionDecrement
@@ -727,6 +728,12 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter {
break;
}
}
if (action instanceof ActionPushDuplicate) {
pushDuplicateBefore = true;
} else if (!(action instanceof ActionIf) && !(action instanceof ActionJump) && !(action instanceof ActionNot)) {
pushDuplicateBefore = false;
}
boolean isEnd = action instanceof ActionEnd;
if (!isEnd) {