L L4D2node

CCountedStringPool::ReferenceStringHandle

0x00b796a0 · 347 bytes · __thiscall

_ZN18CCountedStringPool21ReferenceStringHandleEPKc

Decompiled

undefined (2 params)

/* CCountedStringPool::ReferenceStringHandle(char const*) */

uint __thiscall CCountedStringPool::ReferenceStringHandle(CCountedStringPool *this,char *param_1)

{
  char cVar1;
  ushort uVar2;
  uint uVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  void *pvVar7;
  int iVar8;
  
  uVar3 = 0;
  if (param_1 != (char *)0x0) {
    uVar4 = Hash(this,param_1);
    uVar4 = uVar4 & 0x3ff;
    uVar2 = *(ushort *)(*(int *)(this + 4) + uVar4 * 2);
    if (uVar2 != 0) {
      iVar5 = *(int *)(this + 0x18);
      do {
        uVar3 = (uint)uVar2;
        iVar5 = _V_stricmp(param_1,*(char **)(iVar5 + uVar3 * 8));
        if (iVar5 == 0) {
          iVar5 = uVar3 * 8 + *(int *)(this + 0x18);
          cVar1 = *(char *)(iVar5 + 6);
          if (cVar1 == -1) {
            return uVar3;
          }
          *(char *)(iVar5 + 6) = cVar1 + '\x01';
          return uVar3;
        }
        iVar5 = *(int *)(this + 0x18);
        uVar2 = *(ushort *)(iVar5 + 4 + uVar3 * 8);
      } while (uVar2 != 0);
    }
    uVar3 = (uint)*(ushort *)(this + 0x2c);
    if (*(ushort *)(this + 0x2c) == 0) {
      uVar3 = *(uint *)(this + 0x24);
      CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>::
      GrowVector((CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>
                  *)(this + 0x18),1);
      CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>::
      ShiftElementsRight((CUtlVector<CCountedStringPool::hash_item_t,CUtlMemory<CCountedStringPool::hash_item_t,int>>
                          *)(this + 0x18),uVar3,1);
      iVar8 = (uVar3 & 0xffff) * 8;
      iVar5 = *(int *)(this + 0x18) + iVar8;
    }
    else {
      iVar8 = uVar3 * 8;
      iVar5 = *(int *)(this + 0x18) + iVar8;
      *(undefined2 *)(this + 0x2c) = *(undefined2 *)(iVar5 + 4);
    }
    *(undefined1 *)(iVar5 + 6) = 1;
    *(undefined2 *)(*(int *)(this + 0x18) + 4 + iVar8) =
         *(undefined2 *)(*(int *)(this + 4) + uVar4 * 2);
    *(short *)(*(int *)(this + 4) + uVar4 * 2) = (short)uVar3;
    iVar5 = *(int *)(this + 0x18);
    iVar6 = _V_strlen(param_1);
    pvVar7 = operator_new__(iVar6 + 1);
    *(void **)(iVar5 + iVar8) = pvVar7;
    _V_strcpy(*(char **)(*(int *)(this + 0x18) + iVar8),param_1);
  }
  return uVar3;
}

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)