diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a804f47d..aec206eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ All notable changes to this project will be documented in this file. - [#1858] PDF export - Applying same alpha/blendmode multiple times - [#1858] PDF export - Applying same color multiple times - [#1907] Crashing on memory search +- [#1906] Memory search - byte align opens wrong SWFs ### Changed - Warning before switching deobfuscation is now optional @@ -2796,6 +2797,7 @@ All notable changes to this project will be documented in this file. [#595]: https://www.free-decompiler.com/flash/issues/595 [#1908]: https://www.free-decompiler.com/flash/issues/1908 [#1907]: https://www.free-decompiler.com/flash/issues/1907 +[#1906]: https://www.free-decompiler.com/flash/issues/1906 [#1898]: https://www.free-decompiler.com/flash/issues/1898 [#1511]: https://www.free-decompiler.com/flash/issues/1511 [#1765]: https://www.free-decompiler.com/flash/issues/1765 diff --git a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java index 9c2295e06..6ea99ec2c 100644 --- a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java @@ -40,7 +40,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; @@ -90,6 +92,8 @@ public class LoadFromMemoryFrame extends AppFrame { private DefaultTableModel resTableModel; private List results = new ArrayList<>(); + + private Map modelToResultMap = new LinkedHashMap<>(); private final JTable tableRes; @@ -165,11 +169,17 @@ public class LoadFromMemoryFrame extends AppFrame { } resTableModel.setRowCount(0); + modelToResultMap.clear(); + int rowNum = 0; + int resultNum = 0; for (Object[] rowData:results) { long address = (long) rowData[4]; if (align == 0 || (address % align) == 0) { + modelToResultMap.put(rowNum, resultNum); resTableModel.addRow(rowData); + rowNum++; } + resultNum++; } } @@ -193,6 +203,7 @@ public class LoadFromMemoryFrame extends AppFrame { } int index = tableRes.getRowSorter().convertRowIndexToModel(tableRes.getSelectedRow()); if (index > -1) { + index = modelToResultMap.get(index); SwfInMemory swf = foundIs.get(index); ReReadableInputStream str = swf.is; try {