L L4D2node

CUtlBuffer::PeekStringLength

0x00260a10 · 275 bytes · __thiscall

_ZN10CUtlBuffer16PeekStringLengthEv.part.20

Decompiled

undefined (1 param)

/* CUtlBuffer::PeekStringLength() [clone .part.20] */

int __thiscall CUtlBuffer::PeekStringLength(CUtlBuffer *this)

{
  char cVar1;
  CUtlBuffer *in_EAX;
  char *pcVar2;
  uint uVar3;
  int iVar4;
  int local_34;
  int local_30;
  int local_20 [4];
  
  local_34 = 0;
  if (((byte)in_EAX[0x15] & 1) != 0) {
    local_34 = PeekWhiteSpace(in_EAX,0);
  }
  local_30 = local_34;
  do {
    while( true ) {
      local_20[0] = 0x80;
      cVar1 = CheckArbitraryPeekGet(in_EAX,local_30,local_20);
      if (cVar1 == '\0') {
        iVar4 = 0;
        if (local_30 != local_34) {
          iVar4 = (local_30 - local_34) + 1;
        }
        return iVar4;
      }
      pcVar2 = (char *)(((local_30 + *(int *)(in_EAX + 0xc)) - *(int *)(in_EAX + 0x20)) +
                       *(int *)in_EAX);
      if (((byte)in_EAX[0x15] & 1) != 0) break;
      if (local_20[0] < 1) {
LAB_00260b10:
        local_30 = local_30 + local_20[0];
      }
      else {
        if (*pcVar2 == '\0') {
          iVar4 = 0;
LAB_00260a98:
          return (local_30 - local_34) + 1 + iVar4;
        }
        iVar4 = 0;
        while (iVar4 = iVar4 + 1, iVar4 != local_20[0]) {
          if (pcVar2[iVar4] == '\0') goto LAB_00260a98;
        }
        local_30 = local_30 + iVar4;
      }
    }
    iVar4 = 0;
    if (local_20[0] < 1) goto LAB_00260b10;
    do {
      uVar3 = (byte)pcVar2[iVar4] - 9;
      if (((uVar3 < 0x18) && ((1 << ((byte)uVar3 & 0x1f) & 0x80001fU) != 0)) || (pcVar2[iVar4] == 0)
         ) goto LAB_00260a98;
      iVar4 = iVar4 + 1;
    } while (iVar4 != local_20[0]);
    local_30 = local_30 + iVar4;
  } 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)