175 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
32 lines
1.5 KiB
C
32 lines
1.5 KiB
C
/* Bounded observer for the three Spell pages in the W14 composite package.
|
|
* This is diagnostic metadata only: no packet is created, delayed or replayed.
|
|
* The caller invokes this on a fully validated, deduplicated one-push request.
|
|
*/
|
|
#ifndef GW_SPELL_HOTFIX_TRACE_H
|
|
#define GW_SPELL_HOTFIX_TRACE_H
|
|
#include <stdint.h>
|
|
static inline uint32_t gw_spell_hotfix_trace_push(const unsigned char* b, uint32_t n) {
|
|
uint32_t id;
|
|
if (!b || n != 16 || b[8] != 1 || b[9] || b[10] || b[11]) return 0;
|
|
id=(uint32_t)b[12]|((uint32_t)b[13]<<8)|((uint32_t)b[14]<<16)|((uint32_t)b[15]<<24);
|
|
return id==1700860167u || id==878652721u || id==867881837u ? id : 0;
|
|
}
|
|
/* Validate the existing initial-known writer's exact body before observing.
|
|
* Presence bits: 1=23922 control, 2=45595, 4=51602. No spell IDs are retained.
|
|
*/
|
|
static inline int gw_spell_hotfix_trace_initial(const unsigned char* b, uint32_t n,
|
|
uint32_t* count, uint32_t* present) {
|
|
uint32_t total, at, mask=0;
|
|
if (!b || !count || !present || n<9 || b[0]!=0x80 || b[5] || b[6] || b[7] || b[8]) return -1;
|
|
total=(uint32_t)b[1]|((uint32_t)b[2]<<8)|((uint32_t)b[3]<<16)|((uint32_t)b[4]<<24);
|
|
if (total>4096 || n!=9u+4u*total) return -1;
|
|
for (at=9;at<n;at+=4) {
|
|
uint32_t id=(uint32_t)b[at]|((uint32_t)b[at+1]<<8)|((uint32_t)b[at+2]<<16)|((uint32_t)b[at+3]<<24);
|
|
if(id==23922u)mask|=1u;
|
|
else if(id==45595u)mask|=2u;
|
|
else if(id==51602u)mask|=4u;
|
|
}
|
|
*count=total;*present=mask;return 0;
|
|
}
|
|
#endif
|