From 878822290ccc79502452a01b4226e6e225dff230 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 23 Apr 2026 05:01:22 +0500 Subject: [PATCH] public: crclib: fix CRC32_BlockSequence on BE --- public/crclib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/crclib.c b/public/crclib.c index 545636a4..9b2ae0f9 100644 --- a/public/crclib.c +++ b/public/crclib.c @@ -148,19 +148,19 @@ For proxy protecting byte CRC32_BlockSequence( byte *base, int length, int sequence ) { uint32_t CRC; - char *ptr; char buffer[64]; + int off; + uint32_t le[2]; if( sequence < 0 ) sequence = abs( sequence ); - ptr = (char *)crc32table + (sequence % 0x3FC); if( length > 60 ) length = 60; memcpy( buffer, base, length ); - buffer[length+0] = ptr[0]; - buffer[length+1] = ptr[1]; - buffer[length+2] = ptr[2]; - buffer[length+3] = ptr[3]; + off = sequence % 0x3FC; + le[0] = LittleLong( crc32table[off / 4] ); + le[1] = LittleLong( crc32table[off / 4 + 1] ); + memcpy( buffer + length, (char *)le + ( off & 3 ), 4 ); length += 4;