Closed yretenai closed 2 months ago
Thanks for the info (& looking into GDeflateNet). The checksum ended up being a simple CRC, support for hash checking has been added in 0b0637a5
I'll see if i can swap to GDeflateNet (though ideally it should be available as a NuGet package)
https://github.com/Nenkai/FF16Pack/blob/ef67bbea9981159a38549f0c2cb7feb25808b7d9/FF16PackLib/FF16Pack.cs#L297-L327
The logic in this is just mixed boolean obfuscation caused by the DRM.
(u64s[0] ^ ~u64s[0]) & value
is essentially0xFFFFFFFF.... & value
The entire operation can be simplified as
u64s[0] ^= value
, same with the other branches.The two byte branch is
(ushort)(~u16s[0] ^ (u16s[0] ^ ~u16s[0]) & 0x7DB1)
is equivalent tou16s[0] ^ 0x7DB1 ^ 0xFFFF
(akau16s[0] ^= 0x824E
)https://github.com/Nenkai/FF16Pack/blob/ef67bbea9981159a38549f0c2cb7feb25808b7d9/FF16PackLib/FF16PackFile.cs#L36-L38
is
(GDeflateNet should now also have fixed DLLs)