Unique header on wrong offset

This commit is contained in:
Jindra Petřík
2016-11-24 13:52:09 +01:00
parent 723bf2c9b7
commit d72fc95d2e
3 changed files with 10 additions and 7 deletions

View File

@@ -79,6 +79,7 @@ public class IggyChar implements StructureInterface {
if ((one != 1) | (one2 != 1) | (one3 != 1) | (one4 != 1) | (two1 != 2)) {
LOGGER.info(String.format("Unique header at pos %d\n", offset));
//System.exit(0);
}
nodes = new ArrayList<>();

View File

@@ -2,6 +2,7 @@ package com.jpexs.decompiler.flash.iggy;
import com.jpexs.decompiler.flash.iggy.annotations.IggyFieldType;
import java.io.IOException;
import java.util.logging.Logger;
/**
*
@@ -9,6 +10,8 @@ import java.io.IOException;
*/
public class IggyCharOffset implements StructureInterface {
private static Logger LOGGER = Logger.getLogger(IggyCharOffset.class.getName());
@IggyFieldType(DataType.uint64_t)
long zero;
@IggyFieldType(DataType.uint16_t)
@@ -52,7 +55,12 @@ public class IggyCharOffset implements StructureInterface {
zero3 = stream.readUI32();
long cur_position = stream.position();
long relative_offset = stream.readUI64();
offset = ischar1 > 0 ? cur_position + relative_offset : 0;
if (ischar1 > 0) {
offset = cur_position + relative_offset;
} else {
offset = 0;
LOGGER.info(String.format("Empty char"));
}
}
@Override

View File

@@ -153,12 +153,6 @@ public class IggyFontPart implements StructureInterface {
@Override
public void readFromDataStream(AbstractDataStream stream) throws IOException {
/*byte remData[] = stream.readBytes((int) (long) stream.available());
try (FileOutputStream fos = new FileOutputStream("d:\\Dropbox\\jpexs-laptop\\iggi\\out.part")) {
fos.write(remData);
}
System.exit(0);*/
type = stream.readUI16();
order_in_iggy_file = stream.readUI16();
zeroone = stream.readBytes(28);