mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-06 08:55:50 +00:00
#1241 File content is different to what FFDEC shows in HEX view near instructions
This commit is contained in:
@@ -2586,6 +2586,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
int version = swf == null ? SWF.DEFAULT_VERSION : swf.version;
|
||||
ActionList list = ActionListReader.readActionListTimeout(listeners, rri, version, prevLength, prevLength + actionBytes.getLength(), src.toString()/*FIXME?*/, deobfuscationMode);
|
||||
list.fileData = actionBytes.getArray();
|
||||
list.deobfuscationMode = deobfuscationMode;
|
||||
if (swf != null) {
|
||||
swf.as2PcodeCache.put(src, list);
|
||||
|
||||
@@ -528,6 +528,7 @@ public abstract class Action implements GraphSourceItem {
|
||||
offset = address;
|
||||
int pos = 0;
|
||||
boolean lastPush = false;
|
||||
byte[] fileData = list.fileData;
|
||||
for (Action a : list) {
|
||||
informListeners(listeners, pos, list.size());
|
||||
|
||||
@@ -537,7 +538,21 @@ public abstract class Action implements GraphSourceItem {
|
||||
lastPush = false;
|
||||
}
|
||||
writer.appendNoHilight("; ");
|
||||
writer.appendNoHilight(Helper.bytesToHexString(a.getBytes(version)));
|
||||
byte[] bytes = a.getBytes(version);
|
||||
writer.appendNoHilight(Helper.bytesToHexString(bytes));
|
||||
long fileOffset = a.getFileOffset();
|
||||
if (fileData != null && fileOffset != -1 && fileData.length > fileOffset + bytes.length - 1) {
|
||||
writer.appendNoHilight(" (");
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
writer.appendNoHilight(Helper.byteToHex(fileData[(int) (fileOffset + i)]));
|
||||
writer.appendNoHilight(" ");
|
||||
}
|
||||
|
||||
writer.appendNoHilight("@");
|
||||
writer.appendNoHilight(Helper.formatHex(a.getFileOffset(), 8));
|
||||
writer.appendNoHilight(")");
|
||||
}
|
||||
|
||||
writer.newLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ public class ActionList extends ArrayList<Action> {
|
||||
|
||||
public int deobfuscationMode;
|
||||
|
||||
public byte[] fileData;
|
||||
|
||||
public ActionList() {
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ public class ActionListReader {
|
||||
getContainerLastActions(actions, containerLastActions);
|
||||
|
||||
ActionList ret = new ActionList();
|
||||
ret.fileData = actions.fileData;
|
||||
|
||||
if (nextOffsets != null) {
|
||||
int index = 0;
|
||||
|
||||
@@ -397,6 +397,15 @@ public class Helper {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String formatHex(long value, int width) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(Long.toHexString(value));
|
||||
if (width > sb.length()) {
|
||||
sb.insert(0, ZEROS8, 0, width - sb.length());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String formatInt(int value, int width) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(value);
|
||||
|
||||
Reference in New Issue
Block a user