swf header editor

This commit is contained in:
honfika@gmail.com
2015-04-27 16:57:36 +02:00
parent 924627f413
commit c1226d39fd
8 changed files with 218 additions and 42 deletions

View File

@@ -179,6 +179,12 @@ public final class SWF implements SWFContainerItem, Timelined {
* Default version of SWF file format
*/
public static final int DEFAULT_VERSION = 10;
/**
* Maximum SWF file format version
* Needs to be fixed when SWF versions reaches this value
*/
public static final int MAX_VERSION = 30;
/**
* Tags inside of file

View File

@@ -94,7 +94,7 @@ public class SWFSearch {
boolean valid = swf.fileSize > 0
&& swf.version > 0
&& (!swf.tags.isEmpty() || noCheck)
&& swf.version < 30; // Needs to be fixed when SWF versions reaches this value
&& swf.version <= SWF.MAX_VERSION;
if (valid) {
long limit = pmi.getPos();
MemoryInputStream is = new MemoryInputStream(mis.getAllRead(), (int) (long) addr, (int) limit);

View File

@@ -46,7 +46,8 @@ public enum FLAVersion {
private static final Map<Integer, String> versionToPlayerMap = new HashMap<>();
static {
versionToPlayerMap.put(10, "FlashPlayer10.0"); //10 & 10.1
versionToPlayerMap.put(9, "FlashPlayer9.0"); // 9.0.115.0
versionToPlayerMap.put(10, "FlashPlayer10.0"); //10 & 10.1
versionToPlayerMap.put(11, "FlashPlayer10.2");
versionToPlayerMap.put(12, "FlashPlayer10.3");
versionToPlayerMap.put(13, "FlashPlayer11.0");
@@ -64,6 +65,7 @@ public enum FLAVersion {
versionToPlayerMap.put(25, "FlashPlayer14.0");
versionToPlayerMap.put(26, "FlashPlayer15.0");
versionToPlayerMap.put(27, "FlashPlayer16.0");
versionToPlayerMap.put(28, "FlashPlayer17.0");
}
private FLAVersion(String shortName, String applicationName, String xflVersion, int maxSwfVersion) {