Fixed: Correct AS/P-code matching in editor for AS3 after using deobfuscation

This commit is contained in:
Jindra Petřík
2021-01-04 10:10:23 +01:00
parent 147a10f794
commit ac66eb740b
7 changed files with 57 additions and 3 deletions
@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.␍ */
* License along with this library.
*/
package com.jpexs.decompiler.flash.helpers;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -201,7 +202,12 @@ public class HighlightedTextWriter extends GraphTextWriter {
HighlightData ndata = new HighlightData();
ndata.merge(itemPos.data);
ndata.merge(data);
ndata.offset = src.getAddress() + pos;
long virtualAddress = src.getVirtualAddress();
if (virtualAddress != -1) {
ndata.offset = virtualAddress + pos;
} else {
ndata.offset = src.getAddress() + pos;
}
ndata.fileOffset = src.getFileOffset();
if (itemPos.startLineItem != null) {
ndata.firstLineOffset = itemPos.startLineItem.getLineOffset();