mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-04 05:15:10 +00:00
detect "Non-standard LZMA compressed Flash" (signature=ABC) files in DefineBinaryData tag
This commit is contained in:
@@ -300,6 +300,15 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
@Internal
|
||||
private final Cache<ScriptPack, CachedDecompilation> as3Cache = Cache.getInstance(true, false, "as3");
|
||||
|
||||
public static List<String> swfSignatures = Arrays.asList(
|
||||
"FWS", // Uncompressed Flash
|
||||
"CWS", // ZLib compressed Flash
|
||||
"ZWS", // LZMA compressed Flash
|
||||
"GFX", // Uncompressed ScaleForm GFx
|
||||
"CFX", // Compressed ScaleForm GFx
|
||||
"ABC" // Non-standard LZMA compressed Flash
|
||||
);
|
||||
|
||||
public void updateCharacters() {
|
||||
characters = null;
|
||||
}
|
||||
@@ -1149,14 +1158,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
|
||||
String signature = new String(hdr, 0, 3, Utf8Helper.charset);
|
||||
if (!Arrays.asList(
|
||||
"FWS", // Uncompressed Flash
|
||||
"CWS", // ZLib compressed Flash
|
||||
"ZWS", // LZMA compressed Flash
|
||||
"GFX", // Uncompressed ScaleForm GFx
|
||||
"CFX", // Compressed ScaleForm GFx
|
||||
"ABC" // Non-standard LZMA compressed Flash
|
||||
).contains(signature)) {
|
||||
if (!swfSignatures.contains(signature)) {
|
||||
throw new SwfOpenException("Invalid SWF file, wrong signature.");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -115,13 +114,7 @@ public class DefineBinaryDataTag extends CharacterTag {
|
||||
try {
|
||||
if (binaryData.getLength() > 8) {
|
||||
String signature = new String(binaryData.getRangeData(0, 3), Utf8Helper.charset);
|
||||
if (Arrays.asList(
|
||||
"FWS", //Uncompressed Flash
|
||||
"CWS", //ZLib compressed Flash
|
||||
"ZWS", //LZMA compressed Flash
|
||||
"GFX", //Uncompressed ScaleForm GFx
|
||||
"CFX" //Compressed ScaleForm GFx
|
||||
).contains(signature)) {
|
||||
if (SWF.swfSignatures.contains(signature)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user