From 464663852af0744fd28843188c6f6641c1b05b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 24 Nov 2016 08:30:51 +0100 Subject: [PATCH] part, info structure stub - WIP --- .../jpexs/decompiler/flash/iggy/DataType.java | 2 +- .../flash/iggy/IggyFlashHeader32.java | 6 +- .../flash/iggy/IggyFlashHeader64.java | 17 ++-- .../decompiler/flash/iggy/IggyFontInfo.java | 23 +++++ .../decompiler/flash/iggy/IggyFontPart.java | 84 +++++++++++++++++++ 5 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontInfo.java create mode 100644 libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontPart.java diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/DataType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/DataType.java index 5b4ba5d19..1471d4bf7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/DataType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/DataType.java @@ -4,6 +4,6 @@ package com.jpexs.decompiler.flash.iggy; * @author JPEXS */ public enum DataType { - ubits, uint8_t, uint16_t, uint32_t, uint64_t, unknown, + ubits, uint8_t, uint16_t, uint32_t, uint64_t, float_t, unknown, widechar_t //or maybe just "string"? It has two bytes per character and is null terminated } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader32.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader32.java index 3422e2e12..894371e66 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader32.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader32.java @@ -1,12 +1,7 @@ package com.jpexs.decompiler.flash.iggy; import com.jpexs.decompiler.flash.iggy.annotations.IggyFieldType; -import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.flash.tags.TagTypeInfo; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; /** * @@ -51,6 +46,7 @@ public class IggyFlashHeader32 implements IggyFlashHeaderInterface { long unk_38; @IggyFieldType(DataType.uint32_t) long unk_3C; + @IggyFieldType(DataType.float_t) float frameRate; @IggyFieldType(DataType.uint32_t) long unk_44; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader64.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader64.java index 208282fbd..51e091c5e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader64.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFlashHeader64.java @@ -12,7 +12,7 @@ import java.io.IOException; public class IggyFlashHeader64 implements IggyFlashHeaderInterface { @IggyFieldType(DataType.uint64_t) - long swf_name_offset; // 0 Relative offset to first section (matches sizeof header); + long main_offset; // 0 Relative offset to first section (matches sizeof header); @IggyFieldType(DataType.uint64_t) long as3_section_offset; // 8 Relative offset to as3 file names table... @IggyFieldType(DataType.uint64_t) @@ -43,6 +43,7 @@ public class IggyFlashHeader64 implements IggyFlashHeaderInterface { long unk_50; @IggyFieldType(DataType.uint32_t) long unk_54; + @IggyFieldType(DataType.float_t) float frame_rate; @IggyFieldType(DataType.uint32_t) long unk_5C; @@ -85,7 +86,7 @@ public class IggyFlashHeader64 implements IggyFlashHeaderInterface { @Override public void readFromDataStream(AbstractDataStream stream) throws IOException { - swf_name_offset = stream.readUI64(); + main_offset = stream.readUI64(); as3_section_offset = stream.readUI64(); unk_offset = stream.readUI64(); unk_offset2 = stream.readUI64(); @@ -128,28 +129,28 @@ public class IggyFlashHeader64 implements IggyFlashHeaderInterface { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("[\r\n"); - sb.append("main_offset ").append(swf_name_offset).append("\r\n"); + sb.append("main_offset ").append(main_offset).append("\r\n"); sb.append("as3_section_offset ").append(as3_section_offset); - sb.append(" global: ").append(swf_name_offset + as3_section_offset); + sb.append(" global: ").append(main_offset + as3_section_offset); sb.append("\r\n"); sb.append("unk_offset ").append(unk_offset); if (unk_offset != 1) { - sb.append(" global: ").append(swf_name_offset + unk_offset); + sb.append(" global: ").append(main_offset + unk_offset); } sb.append("\r\n"); sb.append("unk_offset2 ").append(unk_offset2); if (unk_offset2 != 1) { - sb.append(" global: ").append(swf_name_offset + unk_offset2); + sb.append(" global: ").append(main_offset + unk_offset2); } sb.append("\r\n"); sb.append("unk_offset3 ").append(unk_offset3); if (unk_offset3 != 1) { - sb.append(" global: ").append(swf_name_offset + unk_offset3); + sb.append(" global: ").append(main_offset + unk_offset3); } sb.append("\r\n"); sb.append("unk_offset4 ").append(unk_offset4); if (unk_offset4 != 1) { - sb.append(" global: ").append(swf_name_offset + unk_offset4); + sb.append(" global: ").append(main_offset + unk_offset4); } sb.append("\r\n"); sb.append("xmin ").append(xmin).append("\r\n"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontInfo.java new file mode 100644 index 000000000..bdbe2511f --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontInfo.java @@ -0,0 +1,23 @@ +package com.jpexs.decompiler.flash.iggy; + +import com.jpexs.decompiler.flash.iggy.annotations.IggyArrayFieldType; +import com.jpexs.decompiler.flash.iggy.annotations.IggyFieldType; +import java.io.IOException; + +/** + * + * @author JPEXS + */ +public class IggyFontInfo implements StructureInterface { + + @Override + public void readFromDataStream(AbstractDataStream stream) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeToDataStream(AbstractDataStream stream) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontPart.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontPart.java new file mode 100644 index 000000000..2dba0ea58 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/iggy/IggyFontPart.java @@ -0,0 +1,84 @@ +package com.jpexs.decompiler.flash.iggy; + +import com.jpexs.decompiler.flash.iggy.annotations.IggyArrayFieldType; +import com.jpexs.decompiler.flash.iggy.annotations.IggyFieldType; +import java.io.IOException; + +/** + * + * @author JPEXS + */ +public class IggyFontPart implements StructureInterface { + + @IggyFieldType(DataType.uint16_t) + int type; //stejny pro rozdilne fonty + @IggyFieldType(DataType.uint16_t) + int order_in_iggy_file; + @IggyArrayFieldType(value = DataType.uint8_t, count = 28) + byte[] zeroone; // stejny pro rozdilne fonty + @IggyFieldType(DataType.uint16_t) + int char_count2; + @IggyArrayFieldType(value = DataType.uint16_t, count = 3) + int[] what_1; + @IggyFieldType(DataType.uint64_t) + long flags; + @IggyFieldType(DataType.uint64_t) + long start_of_char_struct; + @IggyFieldType(DataType.uint64_t) + long start_of_char_index; + @IggyFieldType(DataType.uint64_t) + long start_of_scale; + @IggyFieldType(DataType.uint32_t) + long kern_count; + @IggyArrayFieldType(value = DataType.float_t, count = 5) + float[] unk_float; + @IggyFieldType(DataType.uint64_t) + long start_of_kern; + @IggyFieldType(DataType.uint64_t) + long zero_padd; + @IggyFieldType(DataType.uint64_t) + long what_2; + @IggyFieldType(DataType.uint64_t) + long zero_padd_2; + @IggyFieldType(DataType.uint64_t) + long start_of_name; + @IggyFieldType(DataType.uint64_t) + long one_padd; + @IggyFieldType(DataType.uint16_t) + int xscale; + @IggyFieldType(DataType.uint16_t) + int yscale; + @IggyFieldType(DataType.uint64_t) + long zero_padd_3; + @IggyFieldType(DataType.float_t) + float ssr1; + @IggyFieldType(DataType.float_t) + float ssr2; + @IggyFieldType(DataType.uint32_t) + int char_count; + @IggyFieldType(DataType.uint64_t) + long zero_padd_4; + @IggyFieldType(DataType.uint64_t) + long what_3; + + //TO BE CONTINUED... + + /* + local uint printchars=0; + local uint64 start_charstruct; +local uint64 start_charindex; +local uint64 start_scale; +local uint64 start_kern; +local uint64 start_name; + */ + @Override + public void readFromDataStream(AbstractDataStream stream) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void writeToDataStream(AbstractDataStream stream) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + +}