L L4D2node

CUtlBuffer::PeekLineLength

0x00b7eb00 · 162 bytes · __thiscall

_ZN10CUtlBuffer14PeekLineLengthEv.part.21

Decompiled

undefined (1 param)

/* CUtlBuffer::PeekLineLength() [clone .part.21] */

int __thiscall CUtlBuffer::PeekLineLength(CUtlBuffer *this)

{
  char cVar1;
  CUtlBuffer *in_EAX;
  char *pcVar2;
  int iVar3;
  int iVar4;
  int local_20 [4];
  
  iVar4 = 0;
  do {
    local_20[0] = 0x80;
    cVar1 = CheckArbitraryPeekGet(in_EAX,iVar4,local_20);
    if (cVar1 == '\0') {
      iVar3 = 0;
      if (iVar4 != 0) {
        iVar3 = iVar4 + 1;
      }
      return iVar3;
    }
    pcVar2 = (char *)(((*(int *)(in_EAX + 0xc) + iVar4) - *(int *)(in_EAX + 0x20)) + *(int *)in_EAX)
    ;
    if (0 < local_20[0]) {
      cVar1 = *pcVar2;
      if ((cVar1 == '\r') || (cVar1 == '\n')) {
        iVar3 = 0;
LAB_00b7eb78:
        return iVar4 + 2 + iVar3;
      }
      if (cVar1 == '\0') {
        iVar3 = 0;
LAB_00b7eb90:
        return iVar4 + 1 + iVar3;
      }
      iVar3 = 0;
      while (iVar3 = iVar3 + 1, iVar3 != local_20[0]) {
        cVar1 = pcVar2[iVar3];
        if ((cVar1 == '\r') || (cVar1 == '\n')) goto LAB_00b7eb78;
        if (cVar1 == '\0') goto LAB_00b7eb90;
      }
    }
    iVar4 = iVar4 + local_20[0];
  } 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)