L L4D2node

CUtlLinkedList<CServerRemoteAccess::DataResponse_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<CServerRemoteAccess::DataResponse_t,int>,int>>::InsertBefore

0x00210530 · 601 bytes · __thiscall

_ZN14CUtlLinkedListIN19CServerRemoteAccess14DataResponse_tEiLb0Ei10CUtlMemoryI19UtlLinkedListElem_tIS1_iEiEE12InsertBeforeEi

Decompiled

undefined (2 params)

/* CUtlLinkedList<CServerRemoteAccess::DataResponse_t, int, false, int,
   CUtlMemory<UtlLinkedListElem_t<CServerRemoteAccess::DataResponse_t, int>, int>
   >::InsertBefore(int) */

int __thiscall
CUtlLinkedList<CServerRemoteAccess::DataResponse_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<CServerRemoteAccess::DataResponse_t,int>,int>>
::InsertBefore(CUtlLinkedList<CServerRemoteAccess::DataResponse_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<CServerRemoteAccess::DataResponse_t,int>,int>>
               *this,int param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  
  iVar4 = *(int *)(this + 0x14);
  if (iVar4 != -1) {
    iVar6 = iVar4 * 0x44;
    iVar2 = *(int *)this + iVar6;
    *(undefined4 *)(this + 0x14) = *(undefined4 *)(iVar2 + 0x40);
    goto LAB_0021055d;
  }
  iVar6 = *(int *)(this + 0x20);
  iVar2 = *(int *)(this + 4);
  if ((iVar6 < 0) || (iVar2 <= iVar6)) {
    iVar4 = 0;
    if (iVar2 < 1) goto LAB_00210616;
  }
  else {
    iVar4 = iVar6 + 1;
    if ((iVar4 < 0) || (iVar2 <= iVar4)) {
LAB_00210616:
      iVar4 = *(int *)(this + 8);
      if (iVar4 < 0) {
        pvVar3 = *(void **)this;
      }
      else {
        iVar1 = iVar2 + 1;
        if (iVar4 == 0) {
          iVar4 = 1;
          if (iVar2 != 0) {
            iVar4 = iVar2;
          }
          while (iVar2 = iVar4, iVar2 < iVar1) {
            iVar4 = iVar2 * 2;
          }
        }
        else {
          for (iVar2 = iVar4 * (iVar2 / iVar4 + 1); iVar2 < iVar1; iVar2 = (iVar2 + iVar1) / 2) {
          }
        }
        *(int *)(this + 4) = iVar2;
        if (*(void **)this == (void *)0x0) {
          pvVar3 = malloc(iVar2 * 0x44);
          *(void **)this = pvVar3;
        }
        else {
          pvVar3 = realloc(*(void **)this,iVar2 * 0x44);
          iVar6 = *(int *)(this + 0x20);
          iVar2 = *(int *)(this + 4);
          *(void **)this = pvVar3;
        }
      }
      *(void **)(this + 0x24) = pvVar3;
      if ((iVar6 < 0) || (iVar2 <= iVar6)) {
        iVar4 = 0;
        if (iVar2 < 1) goto LAB_002106a2;
        goto LAB_002106ea;
      }
      iVar4 = iVar6 + 1;
      if ((iVar4 < 0) || (iVar2 <= iVar4)) {
LAB_002106a2:
        if (AllocInternal(bool)::__executeCount < 10) {
          AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
          Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
        }
        return -1;
      }
    }
    if (iVar4 == -1) {
      if (9 < AllocInternal(bool)::__executeCount) {
        return -1;
      }
      AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
      Warning("CUtlLinkedList overflow! (exhausted index range)\n");
      return -1;
    }
  }
LAB_002106ea:
  *(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
  *(int *)(this + 0x20) = iVar4;
  iVar6 = iVar4 * 0x44;
  iVar2 = *(int *)this + iVar6;
LAB_0021055d:
  *(int *)(iVar2 + 0x40) = iVar4;
  *(int *)(*(int *)this + 0x3c + iVar6) = iVar4;
  Unlink(this,iVar4);
  iVar2 = *(int *)this + iVar6;
  *(int *)(iVar2 + 0x40) = param_1;
  if (param_1 == -1) {
    iVar1 = *(int *)(this + 0x10);
    *(int *)(iVar2 + 0x3c) = iVar1;
    *(int *)(this + 0x10) = iVar4;
  }
  else {
    iVar5 = param_1 * 0x44 + *(int *)this;
    iVar1 = *(int *)(iVar5 + 0x3c);
    *(int *)(iVar2 + 0x3c) = iVar1;
    *(int *)(iVar5 + 0x3c) = iVar4;
  }
  if (iVar1 == -1) {
    *(int *)(this + 0xc) = iVar4;
  }
  else {
    *(int *)(iVar1 * 0x44 + *(int *)this + 0x40) = iVar4;
  }
  *(int *)(this + 0x18) = *(int *)(this + 0x18) + 1;
  if ((CUtlBuffer *)(iVar6 + *(int *)this) != (CUtlBuffer *)0x0) {
    CUtlBuffer::CUtlBuffer((CUtlBuffer *)(iVar6 + *(int *)this),0,0,0);
  }
  return iVar4;
}

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)