I have an idea. - After edit, we compress file with zlib - Find address your file edited in big file. - Replace compressed file from this address. - Done. But i do not know how to compress file with zlib.
shadow_lonely wrote:I have an idea. - After edit, we compress file with zlib - Find address your file edited in big file. - Replace compressed file from this address. - Done. But i do not know how to compress file with zlib.
well it is not a pure zlib as far as i know. It is kind of strange deflate
Here is result my test with font file texture! I think we only compress file after extract same with origin and use hex edit to reimport by hand. Could anyone help me do that? Thanks any way!
shadow_lonely I think the issue with reimporting is that it uses a non-standard encryption algorithm that no one knows. I'm not sure how anyone could help you even manually hex edit reimporting unless they know the algorithm?
I guess found the reason why reimport does not work. Compression is good, but problem is that on each compress file ,always last 4 bytes there is uint number, just dont know what is represent yet! So this is i guess why game crashing. I will try to recompress 1 txt file and import manually back to archive with this 4bytes in the end of the file and will see if it works. Not sure what it is could be CRC. Aluigi can you please have a look on that, i guess you missed it during the reversin (even that is not important for extraction)
I guess i found the solution for this... Also found the problem why aluigi must use _noerror for decompresion(in fact it is very easy). I will test this and let you know but it looks very promising so far. My firend point me right direction in this case.
aluigi wrote:Is it something that can be fixed in the script?
Ok here is the problem. First every compressed file has break on EOF 00 00 FF FF that is first problem with reimport. Second problem is more serious. Reason why you have to use _noerror is that in compressed files check 1 byte with decompression you have to take that number and +1 and u can use deflate without error but it will decompress only palatially but not give error(must be some trick behind this with deflate looks like block couting). However this is more problems during the reimport. In normal logic during the reimport it should work like this : compress files --> take first bit + 1 and import to archive, however this work only with small files. there is some soft of incremental or something. Problem would be in deflate compression, it seems that first bit gets incremented by the deflate blocks, not sure logic behind it is very very problematic, this compression and far beyond to my knowledge. Can you please check this aluigi wtf is that first bit represent and how to calculate it??
So once again:
file default.cfg file a 48.bimage, with default.cfg you are 100% sure that first byte +1 is made for unpack (comparison with izarc packing method, which returned exactly same compressed file except frist byte -> then pure deflate method can be used, in case of 48.bimage if first byte is modified, pure deflateis working but unpacking only part of the file - deflate blocks with modified first byte? )
Thx but still we dont know the important things for future mattaer how this first bit is calculated. Can you please give me a email or sort of contact to author or source code ?