Oodle kraken with size byte difference
Introduction
Sometimes it could be the case that either CSize or DSize has a byte difference. In this case I will show you how to deal with such things.
Lets start
First lets take a look on the data we have.
https://i.imgur.com/pJAVOGK.png
We have a repetitive pattern (Signature) 7 bytes long, some unknown trash 10 bytes long, DSize 4 bytes, CSize 4 bytes and our kraken header 2 bytes.
Now lets look for the sizes. I can say here that DSize matches, but what happened to CSize?
https://i.imgur.com/THt7MkJ.png
Next stream, same thing.
https://i.imgur.com/0ZYM8ey.png
And again, same thing on the next stream.
https://i.imgur.com/Y1nEpCR.png
So the CSize does not match here. In fact on every stream you have a 12 byte difference. I cannot tell you how that comes, or what happened here technically, but we can fix it within the plugin configuration. All we have to do now is to subtract the 12 bytes from the CSize.
Code:
CompressedSize=CSize - 12
And here is the finished plugin:
Code:
[Stream1]
Name=kraken
Codec=kraken:l6
BigEndian=0
Signature=0x64657070617257
Structure=Signature(7),Unknown(10),CSize(4),DSize(4),OodleHdr(2),Stream
StreamOffset=-2
CompressedSize=CSize - 12
DecompressedSize=DSize
Condition1=OodleHdr = 0x068C
Testing:
Code:
xtool:kraken
Compressed 1 file, 233,487,310 => 714,300,604 bytes. Ratio 305.93%
Compression time: cpu 0.16 sec/real 30.54 sec = 1%. Speed 7.64 mB/s
All OK
xtool:testplugin
Compressed 1 file, 233,487,310 => 714,358,929 bytes. Ratio 305.95%
Compression time: cpu 0.14 sec/real 23.04 sec = 1%. Speed 11.14 mB/s
All OK
Fairly the ratio did not increase here (just 0.02%), but this example was just a showcase on what to do if you encounter byte differences.