Kelsidavis-WoWee/tools
Kelsi e531901de8 feat(editor): add --validate-png for full PNG structural + CRC validation
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)
2026-05-06 14:38:17 -07:00
..
asset_extract feat(extract): --purge-proprietary --json for machine-readable purge report 2026-05-06 11:32:42 -07:00
auth_login_probe Auth: include CRC in legacy proof; extend Turtle integrity set 2026-02-13 01:41:59 -08:00
auth_probe Add authenticator opcode support + auth_probe tool 2026-02-13 00:55:36 -08:00
blp_convert Replace MPQ runtime with loose file asset system 2026-02-12 20:32:14 -08:00
dbc_to_csv tools: fix DBC string-column detection false positives in both dbc_to_csv and asset_extract 2026-03-10 03:49:06 -07:00
editor feat(editor): add --validate-png for full PNG structural + CRC validation 2026-05-06 14:38:17 -07:00
asset_pipeline_gui.py feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
backup_assets.sh Fix macOS build process and make shell scripts cross-platform 2026-02-23 18:35:53 -08:00
diff_classic_turtle_opcodes.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
gen_opcode_registry.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
generate_ffx_sdk_vk_permutations.sh Fix FSR3 permutation script failures on arm64 Linux and Windows 2026-03-09 13:11:03 -07:00
m2_viewer.py feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
opcode_map_utils.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
validate_opcode_maps.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00