L L4D2node

CUtlBuffer::PutDelimitedChar

0x00b80080 · 536 bytes · __thiscall

_ZN10CUtlBuffer16PutDelimitedCharEP18CUtlCharConversionc

Decompiled

undefined (3 params)

/* CUtlBuffer::PutDelimitedChar(CUtlCharConversion*, char) */

void __thiscall
CUtlBuffer::PutDelimitedChar(CUtlBuffer *this,CUtlCharConversion *param_1,char param_2)

{
  CUtlBuffer CVar1;
  CUtlCharConversion CVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  CUtlBuffer *pCVar7;
  
  CVar1 = this[0x15];
  if (((byte)CVar1 & 1) != 0) {
    if (param_1 == (CUtlCharConversion *)0x0) {
      if ((*(int *)(this + 0x10) != 0) &&
         (*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'))
      {
        iVar6 = 0;
        if (((byte)CVar1 & 0x10) == 0) {
          iVar6 = *(int *)(this + 0x18);
        }
        while (iVar6 = iVar6 + -1, -1 < iVar6) {
          pCVar7 = this;
          cVar4 = CheckPut(this,1);
          if (cVar4 != '\0') {
            *(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
            iVar5 = *(int *)(this + 0x10);
            *(int *)(this + 0x10) = iVar5 + 1;
            if (*(int *)(this + 0x1c) < iVar5 + 1) {
              AddNullTermination(pCVar7);
            }
          }
        }
      }
    }
    else {
      iVar6 = *(int *)(param_1 + (uint)(byte)param_2 * 8 + 0x118);
      if (iVar6 != 0) {
        CVar2 = param_1[4];
        if ((*(int *)(this + 0x10) != 0) &&
           (*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'
           )) {
          iVar5 = 0;
          if (((byte)CVar1 & 0x10) == 0) {
            iVar5 = *(int *)(this + 0x18);
          }
LAB_00b800e8:
          iVar5 = iVar5 + -1;
          if (-1 < iVar5) {
            while (pCVar7 = this, cVar4 = CheckPut(this,1), cVar4 != '\0') {
              *(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
              iVar3 = *(int *)(this + 0x10);
              *(int *)(this + 0x10) = iVar3 + 1;
              if (iVar3 + 1 <= *(int *)(this + 0x1c)) break;
              AddNullTermination(pCVar7);
              iVar5 = iVar5 + -1;
              if (iVar5 < 0) goto LAB_00b80130;
            }
            goto LAB_00b800e8;
          }
        }
LAB_00b80130:
        pCVar7 = this;
        cVar4 = CheckPut(this,1);
        if (cVar4 != '\0') {
          *(CUtlCharConversion *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) =
               CVar2;
          iVar5 = *(int *)(this + 0x10);
          *(int *)(this + 0x10) = iVar5 + 1;
          if (*(int *)(this + 0x1c) < iVar5 + 1) {
            AddNullTermination(pCVar7);
          }
        }
        Put(this,*(void **)(param_1 + (uint)(byte)param_2 * 8 + 0x11c),iVar6);
        return;
      }
      if ((*(int *)(this + 0x10) != 0) &&
         (*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'))
      {
        if (((byte)CVar1 & 0x10) == 0) {
          iVar6 = *(int *)(this + 0x18);
        }
        else {
          iVar6 = 0;
        }
        while (iVar6 = iVar6 + -1, -1 < iVar6) {
          pCVar7 = this;
          cVar4 = CheckPut(this,1);
          if (cVar4 != '\0') {
            *(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
            iVar5 = *(int *)(this + 0x10);
            *(int *)(this + 0x10) = iVar5 + 1;
            if (*(int *)(this + 0x1c) < iVar5 + 1) {
              AddNullTermination(pCVar7);
            }
          }
        }
      }
    }
  }
  cVar4 = CheckPut(this,1);
  if (cVar4 != '\0') {
    *(char *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = param_2;
    iVar6 = *(int *)(this + 0x10);
    *(int *)(this + 0x10) = iVar6 + 1;
    if (*(int *)(this + 0x1c) < iVar6 + 1) {
      AddNullTermination(this);
      return;
    }
  }
  return;
}

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)