mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-23 09:53:15 +00:00
Ignore SWF files that are not instrumented by FFDec.
Fixed: AS1/2 debug panel not visible on first break
This commit is contained in:
@@ -323,6 +323,7 @@ public class DebuggerSession {
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean modulesEmptyBefore = debuggedSwfs.isEmpty();
|
||||
try {
|
||||
for (InSwfInfo.SwfInfo s : t.swfInfos) {
|
||||
try {
|
||||
@@ -350,6 +351,7 @@ public class DebuggerSession {
|
||||
connected = false;
|
||||
}
|
||||
disconnected();
|
||||
return;
|
||||
} else {
|
||||
debuggedSwfs.put((int) s.index, debuggedSwf);
|
||||
if (debuggedSwfs.size() == 1) { //it's the first one
|
||||
@@ -370,7 +372,26 @@ public class DebuggerSession {
|
||||
}
|
||||
|
||||
try {
|
||||
if (!debuggedSwfs.isEmpty()) {
|
||||
|
||||
Set<String> hashes = new LinkedHashSet<>();
|
||||
|
||||
for (int file : modulePaths.keySet()) {
|
||||
String path = modulePaths.get(file);
|
||||
if (!path.contains(":")) {
|
||||
//This is probably SWF file instrumented by another software
|
||||
throw new IOException("Missing hash");
|
||||
}
|
||||
String hash = path.substring(0, path.indexOf(":"));
|
||||
hashes.add(hash);
|
||||
}
|
||||
for (String hash : hashes) {
|
||||
if (Main.findOpenedSwfByHash(hash) == null) {
|
||||
//This is probably SWF file instrumented by another software
|
||||
throw new IOException("SWF with hash " + hash + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
if (!debuggedSwfs.isEmpty() && modulesEmptyBefore) {
|
||||
if (con.isAS3) {
|
||||
//Widelines - only AS3, it hangs in AS1/2 and SWD does not support UI32 lines
|
||||
con.wideLines = commands.getOption("wide_line_player", "false").equals("true");
|
||||
@@ -457,6 +478,11 @@ public class DebuggerSession {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (DebuggerSession.this) {
|
||||
if (!connected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
paused = true;
|
||||
Logger.getLogger(DebuggerSession.class.getName()).log(Level.FINE, "paused");
|
||||
}
|
||||
|
||||
@@ -5776,13 +5776,14 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
private void valueChanged(Object source, TreePath selectedPath) {
|
||||
TreeItem treeItem = selectedPath == null ? null : (TreeItem) selectedPath.getLastPathComponent();
|
||||
|
||||
Main.updateSession();
|
||||
if (treeItem == null) {
|
||||
updateUi(null);
|
||||
reload(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Main.updateSession();
|
||||
|
||||
if (!(treeItem instanceof OpenableList)) {
|
||||
Openable openable = treeItem.getOpenable();
|
||||
if (openables.isEmpty()) {
|
||||
|
||||
@@ -1158,6 +1158,7 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
|
||||
editor.addTextChangedListener(this::editorTextChanged);
|
||||
decompiledEditor.addTextChangedListener(this::decompiledEditorTextChanged);
|
||||
debugPanel.refresh(Main.getCurrentDebugSession());
|
||||
}
|
||||
|
||||
private void deobfuscateButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.editor;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.gui.Main;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
@@ -142,7 +143,8 @@ public class DebuggableEditorPane extends LineMarkedEditorPane implements BreakP
|
||||
ipHash = ipPath.substring(0, ipPath.indexOf(":"));
|
||||
ipPath = ipPath.substring(ipPath.indexOf(":") + 1);
|
||||
}
|
||||
String myhash = Main.getSwfHash(Main.getMainFrame().getPanel().getCurrentSwf());
|
||||
SWF currentSwf = Main.getMainFrame().getPanel().getCurrentSwf();
|
||||
String myhash = currentSwf == null ? "myunknown" : Main.getSwfHash(currentSwf);
|
||||
if (ip > 0 && ipPath != null && ipHash.equals(myhash) && ipPath.equals(breakPointScriptName)) {
|
||||
addColorMarker(ip + firstLineOffset(), IP_MARKER);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user