mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 22:20:46 +00:00
Added: #2477 Option to disable AS2 detection of uninitialized class fields
Added: AS2 detection of uninitialized class fields is cancellable and shows progress Changed: Icon of "Deobfuscation options" menu from pile of pills to medkit Fixed: Comments color highlighting
This commit is contained in:
@@ -81,7 +81,7 @@ public class MainFrameStatusPanel extends JPanel {
|
||||
cancelButton.addActionListener((ActionEvent e) -> {
|
||||
CancellableWorker w = currentWorker;
|
||||
if (w != null) {
|
||||
w.cancel(true);
|
||||
w.userCancel(true);
|
||||
}
|
||||
});
|
||||
statusLeftPanel.add(loadingPanel);
|
||||
|
||||
@@ -3379,6 +3379,12 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
updateClassesList();
|
||||
reload(true);
|
||||
}
|
||||
|
||||
public void skipDetectionOfUnitializedClassFieldsChanged() {
|
||||
clearAllScriptCache();
|
||||
updateClassesList();
|
||||
reload(true);
|
||||
}
|
||||
|
||||
public void renameColliding(final Openable openable) {
|
||||
View.checkAccess();
|
||||
|
||||
@@ -1255,7 +1255,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
}
|
||||
});
|
||||
|
||||
PopupButton deobfuscateOptionsButton = new PopupButton(View.getIcon("deobfuscateoptions16")) {
|
||||
PopupButton deobfuscateOptionsButton = new PopupButton(View.getIcon("medkit16")) {
|
||||
@Override
|
||||
protected JPopupMenu getPopupMenu() {
|
||||
JPopupMenu popupMenu = new JPopupMenu();
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.action.Action;
|
||||
import com.jpexs.decompiler.flash.action.ActionGraph;
|
||||
import com.jpexs.decompiler.flash.action.ActionList;
|
||||
import com.jpexs.decompiler.flash.action.ConstantPoolTooBigException;
|
||||
import com.jpexs.decompiler.flash.action.as2.UninitializedClassFieldsDetector;
|
||||
import com.jpexs.decompiler.flash.action.deobfuscation.BrokenScriptDetector;
|
||||
import com.jpexs.decompiler.flash.action.parser.ActionParseException;
|
||||
import com.jpexs.decompiler.flash.action.parser.pcode.ASMParsedSymbol;
|
||||
@@ -73,6 +74,7 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.helpers.CancellableWorker;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.ProgressListener;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
@@ -577,17 +579,38 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
decompiledEditor.setShowMarkers(false);
|
||||
if (src.getSwf().needsCalculatingAS2UninitializeClassTraits(src)) {
|
||||
setEditorText(asm.getScriptName(), asm.getExportedScriptName(), "; ...", "text/flasm");
|
||||
setDecompiledText("-", "-", "// " + AppStrings.translate("work.decompiling.allScripts.ucf") + "...");
|
||||
setDecompiledText("-", "-",
|
||||
"// " + AppStrings.translate("work.decompiling.allScripts.ucf") + "..."
|
||||
+ (Configuration.skipDetectionOfUnitializedClassFields.get() ? "" : "\r\n" + "// " + AppStrings.translate("work.decompiling.allScripts.ucf.canBeSkipped"))
|
||||
);
|
||||
} else {
|
||||
setDecompiledText("-", "-", "// " + AppStrings.translate("work.decompiling") + "...");
|
||||
}
|
||||
});
|
||||
|
||||
HighlightedText htext = SWF.getCached(asm, innerActions);
|
||||
ActionList finalActions = innerActions;
|
||||
View.execInEventDispatch(() -> {
|
||||
setSourceCompleted(asm, htext, finalActions);
|
||||
});
|
||||
CancellableWorker that = this;
|
||||
//if (withUninitializedClassFields)
|
||||
ProgressListener progressListener = new ProgressListener() {
|
||||
@Override
|
||||
public void progress(int p) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void status(String status) {
|
||||
Main.startWork(AppStrings.translate("work.decompiling") + " " + status + " ...", that);
|
||||
}
|
||||
};
|
||||
UninitializedClassFieldsDetector det = asm.getSwf().getUninitializedClassFieldsDetector();
|
||||
det.addProgressListener(progressListener);
|
||||
try {
|
||||
HighlightedText htext = SWF.getCached(asm, innerActions);
|
||||
ActionList finalActions = innerActions;
|
||||
View.execInEventDispatch(() -> {
|
||||
setSourceCompleted(asm, htext, finalActions);
|
||||
});
|
||||
} finally {
|
||||
det.removeProgressListener(progressListener);
|
||||
}
|
||||
} else {
|
||||
ActionList finalActions = innerActions;
|
||||
View.execInEventDispatch(() -> {
|
||||
@@ -611,7 +634,7 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
} catch (CancellationException ex) {
|
||||
editor.setShowMarkers(false);
|
||||
setEditorText("-", "-", "; " + AppStrings.translate("work.canceled"), "text/flasm");
|
||||
setDecompiledText("-", "-", "// " + AppStrings.translate("work.canceled"));
|
||||
setDecompiledText("-", "-", "// " + AppStrings.translate("work.canceled"));
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Error", ex);
|
||||
decompiledEditor.setShowMarkers(false);
|
||||
@@ -968,7 +991,14 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
}
|
||||
});
|
||||
|
||||
PopupButton deobfuscateOptionsButton = new PopupButton(View.getIcon("deobfuscateoptions16")) {
|
||||
Configuration.skipDetectionOfUnitializedClassFields.addListener(new ConfigurationItemChangeListener<Boolean>() {
|
||||
@Override
|
||||
public void configurationItemChanged(Boolean newValue) {
|
||||
mainPanel.skipDetectionOfUnitializedClassFieldsChanged();
|
||||
}
|
||||
});
|
||||
|
||||
PopupButton deobfuscateOptionsButton = new PopupButton(View.getIcon("medkit16")) {
|
||||
@Override
|
||||
protected JPopupMenu getPopupMenu() {
|
||||
JPopupMenu popupMenu = new JPopupMenu();
|
||||
@@ -978,9 +1008,13 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
JCheckBox removeObfuscatedDeclarationsMenuItem = new JCheckBox(AppStrings.translate("deobfuscate_options.remove_obfuscated_declarations"));
|
||||
removeObfuscatedDeclarationsMenuItem.setSelected(Configuration.deobfuscateAs12RemoveInvalidNamesAssignments.get());
|
||||
removeObfuscatedDeclarationsMenuItem.addActionListener(ActionPanel.this::removeObfuscatedDeclarationsMenuItemActionPerformed);
|
||||
|
||||
JCheckBox skipUninitializedClassFieldsDetectionMenuItem = new JCheckBox(AppStrings.translate("deobfuscate_options.skip_uninitialized_class_fields_detection"));
|
||||
skipUninitializedClassFieldsDetectionMenuItem.setSelected(Configuration.skipDetectionOfUnitializedClassFields.get());
|
||||
skipUninitializedClassFieldsDetectionMenuItem.addActionListener(ActionPanel.this::skipUninitializedClassFieldsDetectionMenuItemActionPerformed);
|
||||
|
||||
popupMenu.add(simplifyExpressionsMenuItem);
|
||||
popupMenu.add(removeObfuscatedDeclarationsMenuItem);
|
||||
popupMenu.add(skipUninitializedClassFieldsDetectionMenuItem);
|
||||
|
||||
return popupMenu;
|
||||
}
|
||||
@@ -1124,6 +1158,12 @@ public class ActionPanel extends JPanel implements SearchListener<ScriptSearchRe
|
||||
Configuration.deobfuscateAs12RemoveInvalidNamesAssignments.set(checkBox.isSelected());
|
||||
mainPanel.autoDeobfuscateChanged();
|
||||
}
|
||||
|
||||
private void skipUninitializedClassFieldsDetectionMenuItemActionPerformed(ActionEvent evt) {
|
||||
JCheckBox checkBox = (JCheckBox) evt.getSource();
|
||||
Configuration.skipDetectionOfUnitializedClassFields.set(checkBox.isSelected());
|
||||
mainPanel.skipDetectionOfUnitializedClassFieldsChanged();
|
||||
}
|
||||
|
||||
private void breakPointListButtonActionPerformed(ActionEvent evt) {
|
||||
Main.showBreakpointsList();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
@@ -626,3 +626,7 @@ config.description.warning.linkTypes = Warn on clicking a link in the script edi
|
||||
|
||||
config.name.showCodeCompletionOnDot = Show code completion on dot(.) key
|
||||
config.description.showCodeCompletionOnDot = Automatically show code completion window on pressing dot(.) key. When disabled, it can be shown with Ctrl+space key.
|
||||
|
||||
#after 24.0.1
|
||||
config.name.skipDetectionOfUnitializedClassFields = AS2: Skip detection of uninitialized class fields
|
||||
config.description.skipDetectionOfUnitializedClassFields = Skips detection of uninitialized attributes in AS2 classes which includes decompilation of all scripts in current SWF before accessing any class. Set this to true if you have large obfuscated file and you want to see at least something (= incomplete class).
|
||||
|
||||
@@ -626,3 +626,7 @@ config.description.warning.linkTypes = Zobrazovat varov\u00e1n\u00ed p\u0159i kl
|
||||
|
||||
config.name.showCodeCompletionOnDot = Zobrazit dokon\u010dov\u00e1n\u00ed k\u00f3du po kl\u00e1vese te\u010dka(.)
|
||||
config.description.showCodeCompletionOnDot = Automaticky zobraz\u00ed okno dokon\u010dov\u00e1n\u00ed k\u00f3du po stisku kl\u00e1vesy te\u010dka(.). P\u0159i zak\u00e1z\u00e1n\u00ed se d\u00e1 dokon\u010dov\u00e1n\u00ed k\u00f3du vyvolat pomoc\u00ed Ctrl+mezera.
|
||||
|
||||
#after 24.0.1
|
||||
config.name.skipDetectionOfUnitializedClassFields = AS2: P\u0159esko\u010dit detekci neinicializovan\u00fdch pol\u00ed t\u0159\u00edd
|
||||
config.description.skipDetectionOfUnitializedClassFields = P\u0159esko\u010d\u00ed detekci neinicializovan\u00fdch atribut\u016f v AS2 t\u0159\u00edd\u00e1ch kter\u00e1 zahrnuje dekompilaci v\u0161ech skript\u016f v aktu\u00e1ln\u00edm SWF p\u0159ed p\u0159\u00edstupem k jak\u00e9koli t\u0159\u00edd\u011b. Nastavte toto na true pokud m\u00e1te velk\u00fd obfuskovan\u00fd soubor a chcete vid\u011bt alespo\u0148 n\u011bco (= nekompletn\u00ed t\u0159\u00eddu).
|
||||
|
||||
@@ -1083,4 +1083,8 @@ transform.copy = Copy transformation to clipboard
|
||||
transform.clipboard.paste.load = Load transformation from clipboard
|
||||
transform.clipboard.paste.apply = Apply transformation from clipboard
|
||||
|
||||
abc.link.dialog.noOtherFilesOpened = No other files opened
|
||||
abc.link.dialog.noOtherFilesOpened = No other files opened
|
||||
|
||||
#after 24.0.1
|
||||
deobfuscate_options.skip_uninitialized_class_fields_detection = Skip detection of uninitialized class fields
|
||||
work.decompiling.allScripts.ucf.canBeSkipped = You can turn off this step in the deobfuscation options (icon with the red cross)
|
||||
|
||||
@@ -1082,4 +1082,7 @@ transform.copy = Kop\u00edrovat transformaci do schr\u00e1nky
|
||||
transform.clipboard.paste.load = Na\u010d\u00edst transformaci ze schr\u00e1nky
|
||||
transform.clipboard.paste.apply = Pou\u017e\u00edt transformaci ze schr\u00e1nky
|
||||
|
||||
abc.link.dialog.noOtherFilesOpened = Nejsou otev\u0159eny \u017e\u00e1dn\u00e9 jin\u00e9 soubory
|
||||
abc.link.dialog.noOtherFilesOpened = Nejsou otev\u0159eny \u017e\u00e1dn\u00e9 jin\u00e9 soubory
|
||||
|
||||
#after 24.0.1
|
||||
deobfuscate_options.skip_uninitialized_class_fields_detection = P\u0159esko\u010dit detekci neinicializovan\u00fdch pol\u00ed t\u0159\u00edd
|
||||
Reference in New Issue
Block a user