Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0x3E #12

Merged
merged 2 commits into from
Apr 25, 2024
Merged

Update 0x3E #12

merged 2 commits into from
Apr 25, 2024

Conversation

AudriusButkevicius
Copy link
Contributor

Seems to be incorrect:

void __fastcall ITEMS_UpdateClientStats(
        D2ClientStrc *pClient,
        D2UnitStrc *pItem,
        int32_t nPacketType,
        int32_t nStatID,
        int32_t nStatValue,
        int nParam)
{
  uint32_t dwUnitId; // edx
  D2BitBufferStrc a1; // [esp+8h] [ebp-3Ch] BYREF
  char Src[34]; // [esp+1Ch] [ebp-28h] BYREF

  *(_DWORD *)Src = 0x3E;
  memset(&Src[4], 0, 30);
  BITMANIP_Initialize(&a1, (int)&Src[2], 32);
  if ( pItem )
    dwUnitId = pItem->dwUnitId;
  else
    dwUnitId = -1;
  sub_53B0E0(&a1, dwUnitId);
  BITMANIP_Write(&a1, (_BYTE)nPacketType != 0, 1);
  BITMANIP_Write(&a1, nStatID, 9);
  sub_53B0E0(&a1, nStatValue);
  if ( (unsigned __int16)nParam >= 0x100u )
  {
    BITMANIP_Write(&a1, 1, 1);
    BITMANIP_Write(&a1, (unsigned __int16)nParam, 16);
  }
  else
  {
    BITMANIP_Write(&a1, 0, 1);
    BITMANIP_Write(&a1, (unsigned __int16)nParam, 8);
  }
  Src[1] = BITMANIP_GetSize(&a1) + 2;
  D2GAME_PACKETS_SendPacket_6FC3C710(pClient, Src, 34u);
}

Seems to be incorrect:

```
void __fastcall ITEMS_UpdateClientStats(
        D2ClientStrc *pClient,
        D2UnitStrc *pItem,
        int32_t nPacketType,
        int32_t nStatID,
        int32_t nStatValue,
        int nParam)
{
  uint32_t dwUnitId; // edx
  D2BitBufferStrc a1; // [esp+8h] [ebp-3Ch] BYREF
  char Src[34]; // [esp+1Ch] [ebp-28h] BYREF

  *(_DWORD *)Src = 0x3E;
  memset(&Src[4], 0, 30);
  BITMANIP_Initialize(&a1, (int)&Src[2], 32);
  if ( pItem )
    dwUnitId = pItem->dwUnitId;
  else
    dwUnitId = -1;
  sub_53B0E0(&a1, dwUnitId);
  BITMANIP_Write(&a1, (_BYTE)nPacketType != 0, 1);
  BITMANIP_Write(&a1, nStatID, 9);
  sub_53B0E0(&a1, nStatValue);
  if ( (unsigned __int16)nParam >= 0x100u )
  {
    BITMANIP_Write(&a1, 1, 1);
    BITMANIP_Write(&a1, (unsigned __int16)nParam, 16);
  }
  else
  {
    BITMANIP_Write(&a1, 0, 1);
    BITMANIP_Write(&a1, (unsigned __int16)nParam, 8);
  }
  Src[1] = BITMANIP_GetSize(&a1) + 2;
  D2GAME_PACKETS_SendPacket_6FC3C710(pClient, Src, 34u);
}
```
@jaenster jaenster merged commit 3663daf into blizzhackers:main Apr 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants