L L4D2node

CUtlBuffer::PeekDelimitedStringLength

0x00260c30 · 326 bytes · __thiscall

_ZN10CUtlBuffer25PeekDelimitedStringLengthEP18CUtlCharConversionb

Decompiled

undefined (3 params)

/* CUtlBuffer::PeekDelimitedStringLength(CUtlCharConversion*, bool) */

int __thiscall
CUtlBuffer::PeekDelimitedStringLength(CUtlBuffer *this,CUtlCharConversion *param_1,bool param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  CUtlBuffer *in_stack_ffffffb4;
  CUtlBuffer *this_00;
  int iVar5;
  char *pcVar6;
  int local_30;
  int local_20 [4];
  
  if ((((byte)this[0x15] & 1) == 0) || (param_1 == (CUtlCharConversion *)0x0)) {
    if (this[0x14] == (CUtlBuffer)0x0) {
      iVar2 = PeekStringLength(in_stack_ffffffb4);
      return iVar2;
    }
  }
  else {
    iVar2 = PeekWhiteSpace(this,0);
    cVar1 = PeekStringMatch(this,iVar2,*(char **)(param_1 + 8),*(int *)(param_1 + 0xc));
    if (cVar1 != '\0') {
      iVar3 = *(int *)(param_1 + 0xc);
      local_30 = 1;
      iVar4 = iVar2 + iVar3;
      do {
        pcVar6 = *(char **)(param_1 + 8);
        this_00 = this;
        iVar5 = iVar4;
        cVar1 = PeekStringMatch(this,iVar4,pcVar6,iVar3);
        if (((cVar1 != '\0') || (((byte)this[0x14] & 2) != 0)) ||
           (cVar1 = CheckPeekGet(this_00,iVar5,(int)pcVar6), cVar1 == '\0')) goto LAB_00260d60;
        local_30 = local_30 + 1;
        iVar3 = *(int *)(this + 0xc) + iVar4;
        iVar4 = iVar4 + 1;
        if (*(CUtlCharConversion *)(*(int *)this + (iVar3 - *(int *)(this + 0x20))) == param_1[4]) {
          local_20[0] = *(int *)(param_1 + 0x14);
          cVar1 = CheckArbitraryPeekGet(this,iVar4,local_20);
          if (cVar1 == '\0') {
LAB_00260d60:
            if (param_2) {
              return local_30;
            }
            return (iVar4 - iVar2) + *(int *)(param_1 + 0xc) + 1;
          }
          (*(code *)**(undefined4 **)param_1)
                    (param_1,((*(int *)(this + 0xc) + iVar4) - *(int *)(this + 0x20)) + *(int *)this
                     ,local_20);
          iVar4 = iVar4 + local_20[0];
        }
        iVar3 = *(int *)(param_1 + 0xc);
      } while( true );
    }
  }
  return 0;
}

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)