mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 09:33:51 +00:00
Goes beyond --info-png (header sniff only) to validate every chunk
and verify CRC32. Catches corruption that browsers silently skip:
wowee_editor --validate-png Texture.png
PNG: Texture.png
size : 256 x 256
bit depth : 8 (color type 6)
chunks : 3 (0 CRC mismatches)
file bytes : 142336
PASSED
wowee_editor --validate-png corrupted.png
chunks : 1 (1 CRC mismatches)
FAILED — 4 error(s):
- chunk 'IHDR' at offset 8: CRC mismatch (stored=0xC33E61CB
actual=0x8A716D80)
- missing required IDAT chunk
- missing required IEND chunk
Checks:
- 8-byte PNG signature (89 50 4E 47 0D 0A 1A 0A)
- Per-chunk length doesn't exceed file
- CRC32 of (chunk type + data) matches stored CRC (PNG spec)
- IHDR is the first chunk
- IHDR / IDAT / IEND all present
- No trailing bytes after IEND
CRC32 implementation uses the standard polynomial 0xEDB88320 with a
runtime-built lookup table — no zlib dependency since we already
have to compute it ourselves anyway.
Verified on real PNG (BLP→PNG conversion of pvp-banner emblem):
PASSED. Hand-corrupted IHDR byte: correctly flags the CRC mismatch
with stored vs actual hex values + cascading missing-chunk errors.
Format-validator lineup is now exhaustive across both proprietary
and open formats:
Open binary: WOM / WOB / WOC / WHM / GLB
Open text: JSON DBC / STL
Sidecar: PNG (proprietary BLP -> PNG bridge)
|
||
|---|---|---|
| .. | ||
| asset_extract | ||
| auth_login_probe | ||
| auth_probe | ||
| blp_convert | ||
| dbc_to_csv | ||
| editor | ||
| asset_pipeline_gui.py | ||
| backup_assets.sh | ||
| diff_classic_turtle_opcodes.py | ||
| gen_opcode_registry.py | ||
| generate_ffx_sdk_vk_permutations.sh | ||
| m2_viewer.py | ||
| opcode_map_utils.py | ||
| validate_opcode_maps.py | ||