L L4D2node

GCSDK::CRecordInfo::CalculateChecksum

0x000940f0 · 517 bytes · __thiscall

_ZN5GCSDK11CRecordInfo17CalculateChecksumEv

Decompiled

undefined (1 param)

/* GCSDK::CRecordInfo::CalculateChecksum() */

void __thiscall GCSDK::CRecordInfo::CalculateChecksum(CRecordInfo *this)

{
  pthread_mutex_t *__mutex;
  ushort uVar1;
  int iVar2;
  short *psVar3;
  ushort *puVar4;
  CColumnInfo *this_00;
  uint uVar5;
  ulong local_24;
  undefined4 local_20 [4];
  
  __mutex = (pthread_mutex_t *)(this + 0x118);
  pthread_mutex_lock(__mutex);
  if (this[0xe3] != (CRecordInfo)0x0) {
    pthread_mutex_unlock(__mutex);
    return;
  }
  if (this[0xe2] == (CRecordInfo)0x0) {
    BuildColumnNameIndex(this);
  }
                    /* try { // try from 0009412d to 000942f7 has its CatchHandler @ 00094313 */
  CRC32_Init(&local_24);
  uVar1 = *(ushort *)(this + 0xb4);
  do {
    uVar5 = (uint)uVar1;
    if ((CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
         ::Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar2 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                     ::Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
      CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_000d28da = 0xffff;
      DAT_000d28dc = 0xffff;
      __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           ::Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_000941e8;
LAB_0009415a:
      psVar3 = (short *)(uVar5 * 0x10 + *(int *)(this + 0xa8));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_0009415a;
LAB_000941e8:
      psVar3 = &CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    if (*psVar3 == -1) {
      for (; uVar5 != 0xffff; uVar5 = uVar5 & 0xffff) {
        this_00 = (CColumnInfo *)
                  (*(int *)(uVar5 * 0x10 + *(int *)(this + 0xa8) + 0xc) * 0xa0 +
                  *(int *)(this + 0x90));
        CColumnInfo::CalculateChecksum(this_00);
        local_20[0] = *(undefined4 *)(this_00 + 0x98);
        CRC32_ProcessBuffer(&local_24,local_20,4);
        uVar5 = CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::NextInorder((CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                               *)(this + 0xa4),(ushort)uVar5);
      }
      CRC32_Final(&local_24);
      this[0xe3] = (CRecordInfo)0x1;
      *(ulong *)(this + 0xe4) = local_24;
      pthread_mutex_unlock(__mutex);
      return;
    }
    if (CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        DAT_000d28da = 0xffff;
        CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d28dc = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 != 0xffff) goto LAB_00094189;
LAB_000942a9:
      puVar4 = &CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_000942a9;
LAB_00094189:
      puVar4 = (ushort *)(uVar5 * 0x10 + *(int *)(this + 0xa8));
    }
    uVar1 = *puVar4;
  } while( true );
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)