wowdev / WoWDBDefs

Client database definitions for World of Warcraft
Other
246 stars 95 forks source link

Update SpellChainEffects.dbd #114

Closed robinsch closed 2 years ago

robinsch commented 2 years ago

BlendMode size is 4 bytes.

This is accessing m_Combo and does not line up with WoWDBDefs.

            (iVar7 = CLightning::DecodeChainEffectsID
                               (*(undefined4 *)(*(int *)(spellChainEffectsEntry + 0xa4) + local_2c))
Marlamin commented 2 years ago

Seeing this is for 3.3.5, I pretty much only have wiki to look at and that seems to agree: https://wowdev.wiki/DB/SpellChainEffects

The 4.x definition after it also has 3 padding bytes behind it which is mildly suspicious

bloerwald commented 2 years ago

Yeah, this is evil. <8> is correct, as seen on wiki (before the edit). I don't remember where this dump came from, but it apparently is missing padding bytes. The correct fix is not to change size here and on wiki, but to add the padding bytes.

The worse part of this is, that we don't know whether any <8> columns for 3.3.5 are correct now, they can all have this issue.

bloerwald commented 2 years ago

@robinsch I pushed changes to your branch. The diff should be technically equivalent to your definition of having four bytes due to the architecture: uint8 x; uint8 padd[3] == uint32 x | x ≤ 0xff. You should be able to change that in your decompilation to see the same effect. I'll change it on wiki as well (i.e. revert + add a comment). Please disagree if you feel like!

@Marlamin We really should double check all 3.3.5 definitions, as horrible as it sounds. :(

robinsch commented 2 years ago

Hm, I'm not really sure, something else needs to be wrong in the struct definition. The client checks for row size of 0xb1

If we add padding or change it to uint32 it will no longer match client row size check.

robinsch commented 2 years ago

The definition is correct, no padding in the definition and size is uint8. This is saved as uint32 in memory (or the struct is padded, doesn't matter - same result).

Check for row size 0xb1: image

Access to m_BlendMode found in 0x009aa210:

uVar13 = (uint)(*(char *)((int)param_1_00[7] + 0xa0) == '\x02');