Commit graph

173 commits

Author SHA1 Message Date
Kelsi
f4f23eab7a Detect server disconnect during character loading and show error
GameHandler::update() now detects when the socket closes mid-session
(e.g. Warden rejection) and transitions to DISCONNECTED state.
Character screen shows a disconnect message instead of hanging on
"Loading characters..." forever. Reverted SHA1(seed+module) fallback
to SHA1(seed) since neither is correct without module execution.
2026-02-14 18:46:54 -08:00
Kelsi
0ef4af9c99 Fix CharSections DBC layout and Warden SHA1 hash computation
CharSections fields were mapped incorrectly (Variation/Color at 4-5,
textures at 6-8) — corrected to textures at 4-6, Flags at 7,
Variation at 8, Color at 9. Fixed in both dbc_layout.cpp and all
expansion JSON configs. Also fix Warden HASH_REQUEST to SHA1 over
seed+moduleImage instead of just seed.
2026-02-14 18:35:08 -08:00
Kelsi
c2467cf2fc Add chat channels, chat settings, and fix missing chat text
Fix WotLK chat parser not stripping null terminators from messages,
fix channel message local echo missing channelName, expand default
channels to General/Trade/LocalDefense/LookingForGroup with
configurable auto-join, add Classic packet format for join/leave
channel, display channel index prefix in chat, and add Chat settings
tab with timestamps, font size, and auto-join toggles.
2026-02-14 18:27:59 -08:00
Kelsi
139a2f39fe Fix Classic/Turtle spell casting, cast fail parsing, and empty chat
Three Classic packet format fixes:

1. CMSG_CAST_SPELL: target flags are uint32 (not uint16). The wrong
   size caused the server to misparse the packet as an item enchant
   operation, returning "item already enchanted".

2. SMSG_CAST_FAILED: Classic has no castCount byte prefix (added in
   TBC). Added parseCastFailed override to ClassicPacketParsers.
   Without this, the parser read the wrong bytes and produced
   "Spell cast failed (error 0)" for every failure.

3. SMSG_MESSAGECHAT: Removed spurious receiverGuid read for SAY/YELL
   types. Classic chat format has no second GUID before the message
   body — the extra 8-byte read consumed messageLen + message data,
   producing empty chat messages.
2026-02-14 16:54:43 -08:00
Kelsi
f6a0be6a08 Fix empty chat messages and /dismount on Classic/Turtle
Chat: renderTextWithLinks now properly handles |cAARRGGBB color codes
that aren't item links (e.g. colored player names), rendering the text
in the specified color instead of discarding it.

Dismount: Classic/Vanilla lacks CMSG_CANCEL_MOUNT_AURA (TBC+ opcode).
Track mount aura spell ID when mountDisplayId changes, then use
CMSG_CANCEL_AURA as fallback on expansions without the dedicated opcode.
2026-02-14 16:42:47 -08:00
Kelsi
8282583b9a Fix equipment textures: correct DBC field indices and stop texture cycling
Binary ItemDisplayInfo.dbc has 23 fields with texture components at
14-21, not 15-22. The previous "fix" shifted all fields by +1 which
read wrong columns and broke both player and NPC equipment rendering.

Also fix local player texture cycling: rebuildOnlineInventory() was
called on every item query response (including for other players),
unconditionally setting onlineEquipDirty_ which triggered redundant
texture recompositing. Now tracks previous equipment displayInfoIds
and only sets dirty when they actually change.

Unified all 3 equipment texture code paths (local player, other
players, NPCs) to use the DBC layout system with correct field 14
base index.
2026-02-14 16:33:24 -08:00
Kelsi
3675721016 Improve equipment texture performance and accuracy
Cache composite textures by input key so identical NPC equipment
combos share one GPU texture. Use DBC layout system for
ItemDisplayInfo texture component fields instead of hardcoded
indices (cross-expansion support). Selective player equipment
re-emission on item query response instead of broadcasting to
all players.
2026-02-14 15:48:58 -08:00
Kelsi
d4bea91e37 Fix naked players and NPC gear textures
Default PLAYER_VISIBLE_ITEM layout to known WotLK 3.3.5a values
(base=284, stride=2) so equipment reads work immediately without
waiting for heuristic detection. Add equipment texture compositing
for humanoid NPCs over baked body textures using ItemDisplayInfo.dbc
region lookups (texture-only, no geoset changes to avoid invisibility).
2026-02-14 15:43:09 -08:00
Kelsi
58d8b88721 Fix inspect spam and emote text lookup for other players
Two bugs fixed:
1. SMSG_INSPECT_RESULTS (0x115) was falling through to the inspect
   handler, but this opcode is not the real inspect response. Removed
   the case so only SMSG_INSPECT_TALENT (0x3F4) triggers the handler.
2. EmotesText DBC layout was missing "ID" field in all 4 expansion
   JSON files, causing operator[] to return 0xFFFFFFFF instead of 0.
   This broke the dbcId reverse lookup, so other players' emotes
   always fell back to generic "performs an emote" text. Added ID
   and OthersTargetTextID/OthersNoTargetTextID to all layouts.
2026-02-14 15:23:32 -08:00
Kelsi
9c61d7ecad Fix SMSG_TALENTS_INFO spam by checking talentType field
Opcode 0x3F4 is SMSG_TALENTS_INFO, sent both for the player's own
talents (type=0, on login/respec) and inspect results (type=1). The
handler was missing the type byte read, treating all packets as
inspect results and spamming "Inspecting target" messages.
2026-02-14 15:16:26 -08:00
Kelsi
3acb42b363 Resolve emote text from DBC for other players' text emotes
Load third-person emote text templates (othersTarget/othersNoTarget)
from EmotesText.dbc fields 3 and 7 alongside existing sender text.
Build reverse lookup map from dbcId to EmoteInfo for incoming
SMSG_TEXT_EMOTE resolution. Other players now show proper emote
descriptions like "Player dances with Target" instead of generic
"Player performs an emote" text.
2026-02-14 15:11:43 -08:00
Kelsi
a90c130d6e Fix guild roster, /who, /inspect, and character preview bugs
Guild O tab: fallback to character guildId when guildName_ not yet
queried, re-query guild info on roster open. /who: add missing
stringCount field and fix maxLevel default (0→100). /inspect: add
SMSG_INSPECT_TALENT opcode (0x3F4) and rewrite parser for WotLK
PackedGUID+talent format. Character preview: reset all tracking
variables in setAssetManager() to force model reload on login.
2026-02-14 15:05:18 -08:00
Kelsi
9bcead6a0f Add chat tabs, networked text emotes, channel system, and chat bubbles
Chat tabs filter messages into General/Combat/Whispers/Trade tabs. Text
emotes now send CMSG_TEXT_EMOTE to server and display incoming emotes
from other players. Channel system auto-joins General/Trade on login with
/join, /leave, and /1-/9 shortcuts. Chat bubbles render as ImGui overlays
above entities for SAY/YELL messages with fade-out animation.
2026-02-14 14:30:09 -08:00
Kelsi
5e8384f34e Load WoW.exe PE image for Warden MEM_CHECK responses
Parse PE sections from WoW.exe into a flat virtual memory image so
MEM_CHECK returns real binary contents instead of zeros. Also mocks
KUSER_SHARED_DATA (0x7FFE026C) with Windows 7 version info.
2026-02-14 02:00:15 -08:00
Kelsi
cb79e43a29 Fix vanilla Warden PAGE_B check size (29 bytes, not 24)
PAGE_A uses 24 bytes in vanilla (no addr+len), but PAGE_B always uses
29 bytes (with addr+len) regardless of expansion. Splitting the cases
fixes remaining unknown check type errors on Turtle WoW.
2026-02-14 01:43:40 -08:00
Kelsi
1a44c85264 Fix vanilla Warden check parsing and crypto reset
Vanilla PAGE_A/B checks are 24 bytes (no addr+len), PROC checks are
25 bytes (no second strIdx+offset), unlike WotLK's 29/30. Wrong sizes
caused incomplete responses with bad checksums, silently blocking
character creation on Turtle WoW.
2026-02-14 01:26:26 -08:00
Kelsi
5b08e47941 Fix character creation for expansion-filtered servers (Turtle WoW)
Filter races/classes in character creation screen by expansion profile
constraints, add 10s server response timeout, and reset Warden crypto
state on disconnect so reconnections use the correct session key.
2026-02-14 00:57:33 -08:00
Kelsi
886f4daf2e Add per-expansion asset overlay system and fix CharSections DBC layout
Expansion overlays allow each expansion to supplement the base asset data
via an assetManifest field in expansion.json, loaded at priority 50 (below
HD packs). The asset extractor gains --reference-manifest for delta-only
extraction. Also fixes CharSections field indices (VariationIndex=4,
ColorIndex=5, Texture1=6) across all DBC layout references.
2026-02-14 00:00:26 -08:00
Kelsi
85864ab05b Add separate draggable bag windows, fix dismount and player equipment
Bags are now individual draggable ImGui windows (backpack + each equipped
bag) with per-bag toggle from the bag bar. B key opens/closes all. A
settings toggle under Gameplay lets users switch back to the original
aggregate single-window mode. Window width adapts to bag item name length.

Fix dismount by clearing local mount state immediately (optimistic) instead
of waiting for server confirmation, and allow buff bar right-click dismount
regardless of the aura's buff flag.

Fix other players appearing naked by queuing them for auto-inspect when
the visible item field layout hasn't been detected yet.
2026-02-13 22:51:49 -08:00
Kelsi
89ccb0720a Fix vanilla spell casting and bag contents
Vanilla CMSG_CAST_SPELL target mask is uint16 (not uint32 like WotLK),
the extra 2 bytes were corrupting packets. Also implement full bag
content tracking: extract container slot GUIDs from CONTAINER update
objects, set proper bag sizes, and populate bag items in inventory
rebuild.
2026-02-13 22:14:34 -08:00
Kelsi
22728b461f Fix vanilla M2 animations, movement packets, and DBC locale
- Parse vanilla M2 animation tracks (flat arrays with M2Range indices)
  instead of skipping them, fixing T-pose on all vanilla models
- Use C4Quaternion (float[4]) for vanilla bone rotations instead of
  CompressedQuat (int16[4]) which produced garbage transforms
- Fix vanilla M2 attachment struct size (48 bytes, not 40) so weapons
  attach to correct bones instead of model origin
- Route movement packets through expansion-specific packet parsers
  instead of hardcoded WotLK format, fixing server-side position sync
- Fix Spell.dbc field indices for classic/turtle (Name=120, Rank=129,
  IconID=117) - were pointing to Portuguese locale column (+7 offset)
- Change guild roster keybind from J to O (WoW default)
- Add guild opcodes for all expansions
2026-02-13 21:39:48 -08:00
Kelsi
60c93fa1e3 Fix weapon attachments and inspect fallback 2026-02-13 20:26:55 -08:00
Kelsi
2774b47867 Fix movement animations and NPC baked textures 2026-02-13 20:19:33 -08:00
Kelsi
65fe5e8e1d Fix visible equipment item queries 2026-02-13 20:13:37 -08:00
Kelsi
d3211f5493 Show online player equipment 2026-02-13 20:10:19 -08:00
Kelsi
6af9d6ba2d Fix name query parsing for Classic/TBC 2026-02-13 19:52:49 -08:00
Kelsi
bf39c0b900 Auto-detect coinage and inventory fields 2026-02-13 19:47:49 -08:00
Kelsi
24d780e669 Fix chat sender names via name queries 2026-02-13 19:42:42 -08:00
Kelsi
5afd1b65a8 Fix Turtle/Classic parsing and online player textures 2026-02-13 19:40:54 -08:00
Kelsi
fb0ae26fe6 Vanilla/Turtle WoW compatibility: fix UPDATE_OBJECT, chat, equipment, creatures
- Route SMSG_UPDATE_OBJECT through polymorphic parsers for correct
  vanilla format (uint8 updateFlags, 6 speeds vs WotLK uint16/9)
- Fix SMSG_DESTROY_OBJECT for vanilla (8 bytes, no isDeath field)
- Add MSG_MOVE_* handlers for other player movement relay
- Add ClassicPacketParsers::parseMessageChat with targetGuid read
  and monster-type name handling
- Resolve chat sender names from player name cache before display
- Fix CSV DBC field 0 always treated as numeric ID (fixes 16+ garbled
  Turtle CSVs including Map, AreaTable, Spell, CreatureDisplayInfo)
- Add CSV DBC validation: reject garbled CSVs (>80% zero IDs) and
  fall back to binary DBC files
- Fix ItemDisplayInfo texture component field index (14+ not 15+)
  for binary DBC with gender-aware suffix resolution
- Spawn other players as visible M2 models via creature callback
- Map name cache dedup prevents overwrites from duplicate CSV records
2026-02-13 18:59:09 -08:00
Kelsi
430c2bdcfa Vanilla/Turtle WoW support: M2 loading, bone parsing, textures, auth
- Vanilla M2 bone struct (108 bytes) with 28-byte animation tracks
- Version-aware bone parsing (vanilla vs WotLK format detection)
- Fix CharSections.dbc field layout for vanilla (variation/color at 4-5)
- Remove broken CharSections.csv files (all fields marked as strings)
- Expansion data reload on profile switch (DBC cache clear, layout reload)
- Vanilla packet encryption (VanillaCrypt XOR-based header crypt)
- Extended character preview geoset range (0-99) for vanilla models
- DBC cache clear support in AssetManager
2026-02-13 16:53:28 -08:00
Kelsi
81e082dc46 World auth: include realmId in AUTH_SESSION 2026-02-13 01:51:49 -08:00
Kelsi
7092844b5e Add multi-expansion support with data-driven protocol layer
Replace hardcoded WotLK protocol constants with a data-driven architecture
supporting Classic 1.12.1, TBC 2.4.3, and WotLK 3.3.5a. Each expansion
has JSON profiles for opcodes, update fields, and DBC layouts, plus C++
polymorphic packet parsers for binary format differences (movement flags,
speed fields, transport data, spline format, char enum layout).

Key components:
- ExpansionRegistry: scans Data/expansions/*/expansion.json at startup
- OpcodeTable: logical enum <-> wire values loaded from JSON
- UpdateFieldTable: field indices loaded from JSON per expansion
- DBCLayout: schema-driven DBC field lookups replacing magic numbers
- PacketParsers: WotLK/TBC/Classic parsers with correct flag positions
- Multi-manifest AssetManager: layered manifests with priority ordering
- HDPackManager: overlay texture packs with expansion compatibility
- Auth screen expansion picker replacing hardcoded version dropdown
2026-02-12 22:56:36 -08:00
Kelsi
76edd3260f Infer and animate elevator transport paths 2026-02-12 15:38:39 -08:00
Kelsi
3dac9ae657 Fix yaw conversions for online movement/entities 2026-02-12 15:08:21 -08:00
Kelsi
275914b4db Fix character appearance, previews, mount seat, and online unequip 2026-02-12 14:55:27 -08:00
Kelsi
4a023e773b WARDEN work 2026-02-12 03:50:28 -08:00
Kelsi
4b425f1225 Implement Warden module execution foundation (Phase 1 & 2)
Added architecture for loading and executing native x86 Warden modules:

New classes:
- WardenModule: Individual module loader with 8-step pipeline
   MD5 verification (working)
   RC4 decryption (working)
   RSA/zlib/exe-parsing/relocation/API-binding/execution (TODOs)
- WardenModuleManager: Module lifecycle and disk caching
  ~/.local/share/wowee/warden_cache/<MD5>.wdn
- WardenFuncList: Callback structure for module execution

Integration:
- Added wardenModuleManager_ to GameHandler
- Module manager initialized on startup
- Foundation ready for phases 3-7 (validation → execution)

Documentation:
- WARDEN_MODULE_ARCHITECTURE.md (comprehensive 7-phase roadmap)
- Estimated 2-3 months for full native code execution
- Alternative: packet capture approach (1-2 weeks)

Status: Crypto layer complete, execution layer TODO
2026-02-12 02:43:20 -08:00
Kelsi
615efd01b7 Harden packet framing/logging and checkpoint current workspace state 2026-02-12 02:27:59 -08:00
Kelsi
4b48fcdab2 Enhanced Warden implementation with comprehensive documentation
Added MD5 hashing and extensive testing documentation for future attempts
at supporting strict Warden servers like Warmane.

Enhancements:
- Added MD5 hash support to Crypto class (OpenSSL-based)
- Tested 6 different module ACK response formats against Warmane
- Analyzed module packet structure (37 bytes: opcode + seed + trailing)
- Enhanced debug logging for plaintext and encrypted Warden data

Documentation:
- WARDEN_IMPLEMENTATION.md: Complete implementation guide with all attempts
- WARDEN_QUICK_REFERENCE.md: Quick troubleshooting and testing guide

Test Results (Warmane):
- Empty ACK (0 bytes): Server silent
- XOR/MD5 checksum (18 bytes): Server silent
- Single byte (1 byte): Server disconnects (rejected)
- Echo trailing (20 bytes): Server silent
- Result + SHA1 (21 bytes): Server silent

Conclusion:
- Current implementation works with permissive/disabled Warden servers
- Warmane requires module execution or undocumented response format
- Full documentation provided for future reverse engineering attempts

Next steps documented:
1. Capture packets from real WoW client (protocol analysis)
2. Implement module execution engine (months of work)
3. Test with local AzerothCore server
2026-02-12 02:22:04 -08:00
Kelsi
b9147baca6 Implement full Warden anti-cheat crypto system (WoW 3.3.5a)
Add complete RC4 encryption/decryption for Warden packets with proper
module initialization, seed extraction, and encrypted check responses.

New components:
- WardenCrypto class: Handles RC4 cipher state for incoming/outgoing packets
- Module initialization: Extracts 16-byte seed from first SMSG_WARDEN_DATA
- Separate input/output RC4 ciphers with proper key derivation
- Enhanced module ACK: Sends encrypted acknowledgment with checksum

Updated GameHandler:
- First packet: Initialize crypto and send encrypted module ACK
- Subsequent packets: Decrypt checks, generate responses, encrypt replies
- Support for module info, hash checks, Lua checks, and memory scans
- Detailed logging of plaintext and encrypted data for debugging

Works with servers that:
- Use standard WoW 3.3.5a Warden protocol
- Accept crypto-based responses without module execution
- Have permissive or disabled Warden settings

Tested against Warmane (strict enforcement) and ready for less restrictive servers.
2026-02-12 02:09:15 -08:00
Kelsi
89fb0e3663 Fix Warden response packet write method 2026-02-12 01:54:33 -08:00
Kelsi
fcaa70b5e3 Implement Warden anti-cheat response system
Add CMSG_WARDEN_DATA opcode (0x2E7) and proper response handling for
server Warden checks. Responds appropriately to module info, hash checks,
Lua checks, and memory scans with legitimate client responses.

Replaces previous fail-and-disconnect behavior with active response system
that works with most private servers' Warden implementations.
2026-02-12 01:53:21 -08:00
Kelsi
4a9c86b1e6 Harden transport updates and fix waterfall particle tint 2026-02-12 00:45:24 -08:00
Kelsi
d6e7b0809c Fix transport sync and stabilize WMO/tunnel grounding 2026-02-12 00:04:53 -08:00
Kelsi
5171f9cad4 Fix taxi state sync and transport authority; reduce runtime log overhead; restore first-person self-hide 2026-02-11 22:27:02 -08:00
Kelsi
40b50454ce Stabilize taxi/state sync and creature spawn handling 2026-02-11 21:14:35 -08:00
Kelsi
38cef8d9c6 Fix taxi startup/attachment and reduce taxi streaming hitches 2026-02-11 19:28:15 -08:00
Kelsi
f752a4f517 Fix NPC visibility and stabilize world transport/taxi updates 2026-02-11 18:25:04 -08:00
Kelsi
5dae994830 Stabilize transports and correct minimap orientation 2026-02-11 17:30:57 -08:00