L L4D2node

CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>::InsertBefore

0x00063d70 · 468 bytes · __thiscall

_ZN14CUtlLinkedListIN5GCSDK7CJobMgr12JobTimeout_tEiLb0Ei10CUtlMemoryI19UtlLinkedListElem_tIS2_iEiEE12InsertBeforeEi

Decompiled

undefined (2 params)

/* CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t, int, false, int,
   CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t, int>, int> >::InsertBefore(int) */

int __thiscall
CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
::InsertBefore(CUtlLinkedList<GCSDK::CJobMgr::JobTimeout_t,int,false,int,CUtlMemory<UtlLinkedListElem_t<GCSDK::CJobMgr::JobTimeout_t,int>,int>>
               *this,int param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  
  iVar4 = *(int *)(this + 0x14);
  if (iVar4 != -1) {
    iVar5 = iVar4 * 0x24;
    iVar2 = *(int *)this + iVar5;
    *(undefined4 *)(this + 0x14) = *(undefined4 *)(iVar2 + 0x20);
    goto LAB_00063d94;
  }
  iVar2 = *(int *)(this + 0x20);
  iVar5 = *(int *)(this + 4);
  if ((iVar2 < 0) || (iVar5 <= iVar2)) {
    iVar4 = 0;
    if (iVar5 < 1) goto LAB_00063e06;
  }
  else {
    iVar4 = iVar2 + 1;
    if ((iVar4 < 0) || (iVar5 <= iVar4)) {
LAB_00063e06:
      iVar4 = *(int *)(this + 8);
      if (iVar4 < 0) {
        pvVar3 = *(void **)this;
      }
      else {
        iVar1 = iVar5 + 1;
        if (iVar4 == 0) {
          iVar4 = 1;
          if (iVar5 != 0) {
            iVar4 = iVar5;
          }
          while (iVar5 = iVar4, iVar5 < iVar1) {
            iVar4 = iVar5 * 2;
          }
        }
        else {
          for (iVar5 = iVar4 * (iVar5 / iVar4 + 1); iVar5 < iVar1; iVar5 = (iVar5 + iVar1) / 2) {
          }
        }
        *(int *)(this + 4) = iVar5;
        if (*(void **)this == (void *)0x0) {
          pvVar3 = malloc(iVar5 * 0x24);
          *(void **)this = pvVar3;
        }
        else {
          pvVar3 = realloc(*(void **)this,iVar5 * 0x24);
          iVar2 = *(int *)(this + 0x20);
          iVar5 = *(int *)(this + 4);
          *(void **)this = pvVar3;
        }
      }
      *(void **)(this + 0x24) = pvVar3;
      if ((iVar2 < 0) || (iVar5 <= iVar2)) {
        iVar4 = 0;
        if (iVar5 < 1) goto LAB_00063e86;
        goto LAB_00063ec2;
      }
      iVar4 = iVar2 + 1;
      if ((iVar4 < 0) || (iVar5 <= iVar4)) {
LAB_00063e86:
        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_00063ec2:
  *(int *)(this + 0x20) = iVar4;
  *(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
  iVar5 = iVar4 * 0x24;
  iVar2 = *(int *)this + iVar5;
LAB_00063d94:
  *(int *)(iVar2 + 0x20) = iVar4;
  *(int *)(*(int *)this + 0x1c + iVar5) = iVar4;
  LinkBefore(this,param_1,iVar4);
  iVar5 = iVar5 + *(int *)this;
  if (iVar5 != 0) {
    GCSDK::CJobTime::CJobTime((CJobTime *)(iVar5 + 8));
    GCSDK::CJobTime::CJobTime((CJobTime *)(iVar5 + 0x10));
  }
  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)