dumpview: allow opening multiple swfs, context menu: expand all and close menu items

show abc and actionbytes in dump view, hexview style fixes
better scroll to view mode in hex editor
This commit is contained in:
honfika
2014-06-28 07:31:28 +02:00
parent 1bed823af5
commit cb7baba8e9
112 changed files with 3473 additions and 3011 deletions

View File

@@ -357,12 +357,14 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
deobfuscationCommandButton.setEnabled(hasAbc);*/
}
private void saveAs(SWF swf, SaveFileMode mode) {
private boolean saveAs(SWF swf, SaveFileMode mode) {
if (Main.saveFileDialog(swf, mode)) {
swf.fileTitle = null;
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null);
return true;
}
return false;
}
@Override
@@ -481,17 +483,19 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
case ACTION_SAVE: {
SWF swf = mainFrame.panel.getCurrentSwf();
SWFNode snode = ((TagTreeModel) mainFrame.panel.tagTree.getModel()).getSwfNode(swf);
boolean saved = false;
if (snode.binaryData != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
swf.saveTo(baos);
snode.binaryData.binaryData = baos.toByteArray();
snode.binaryData.setModified(true);
saved = true;
} catch (IOException ex) {
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
}
} else if (swf.file == null) {
saveAs(swf, SaveFileMode.SAVEAS);
saved = saveAs(swf, SaveFileMode.SAVEAS);
} else {
try {
Main.saveFile(swf, swf.file);
@@ -500,13 +504,16 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
}
}
swf.clearModified();
if (saved) {
swf.clearModified();
}
}
break;
case ACTION_SAVE_AS: {
SWF swf = mainFrame.panel.getCurrentSwf();
saveAs(swf, SaveFileMode.SAVEAS);
swf.clearModified();
if (saveAs(swf, SaveFileMode.SAVEAS)) {
swf.clearModified();
}
}
break;
case ACTION_SAVE_AS_EXE: {