L L4D2node

CUtlBuffer::ParseToken

0x0004db30 · 540 bytes · __thiscall

_ZN10CUtlBuffer10ParseTokenEP14characterset_tPcib

Decompiled

undefined (5 params)

/* CUtlBuffer::ParseToken(characterset_t*, char*, int, bool) */

int __thiscall
CUtlBuffer::ParseToken
          (CUtlBuffer *this,characterset_t *param_1,char *param_2,int param_3,bool param_4)

{
  int iVar1;
  char cVar2;
  char cVar3;
  int iVar4;
  char local_1d [13];
  
  *param_2 = '\0';
  do {
    if (this[0x14] != (CUtlBuffer)0x0) {
      return -1;
    }
    EatWhiteSpace(this);
  } while ((param_4) && (cVar2 = EatCPPComment(this), cVar2 != '\0'));
  if (((byte)this[0x15] & 1) == 0) {
    cVar2 = CheckGet(this,1);
    if (cVar2 == '\0') {
      return -1;
    }
    cVar2 = *(char *)(*(int *)this + (*(int *)(this + 0xc) - *(int *)(this + 0x20)));
    *(int *)(this + 0xc) = *(int *)(this + 0xc) + 1;
  }
  else {
    local_1d[0] = '\0';
    Scanf(this,"%c",local_1d);
    cVar2 = local_1d[0];
  }
  if (cVar2 == '\0') {
    return -1;
  }
  if (cVar2 == '\"') {
    iVar4 = 0;
    do {
      if (this[0x14] != (CUtlBuffer)0x0) {
LAB_0004dd3a:
        param_2[iVar4] = '\0';
        return iVar4;
      }
      if (((byte)this[0x15] & 1) == 0) {
        cVar2 = CheckGet(this,1);
        if (cVar2 == '\0') goto LAB_0004dd3a;
        cVar2 = *(char *)(*(int *)this + (*(int *)(this + 0xc) - *(int *)(this + 0x20)));
        *(int *)(this + 0xc) = *(int *)(this + 0xc) + 1;
      }
      else {
        local_1d[0] = '\0';
        Scanf(this,"%c",local_1d);
        cVar2 = local_1d[0];
      }
      if ((cVar2 == '\0') || (cVar2 == '\"')) goto LAB_0004dd3a;
      param_2[iVar4] = cVar2;
      iVar4 = iVar4 + 1;
    } while (iVar4 != param_3);
  }
  else {
    iVar1 = 1;
    if (param_1[cVar2] != (characterset_t)0x0) {
      *param_2 = cVar2;
      param_2[1] = '\0';
      return 1;
    }
    while (iVar4 = iVar1, param_2[iVar4 + -1] = cVar2, iVar4 != param_3) {
      if (((byte)this[0x15] & 1) == 0) {
        cVar3 = CheckGet(this,1);
        cVar2 = '\0';
        if (cVar3 != '\0') {
          cVar2 = *(char *)(*(int *)this + (*(int *)(this + 0xc) - *(int *)(this + 0x20)));
          *(int *)(this + 0xc) = *(int *)(this + 0xc) + 1;
        }
      }
      else {
        local_1d[0] = '\0';
        Scanf(this,"%c",local_1d);
        cVar2 = local_1d[0];
      }
      if (this[0x14] != (CUtlBuffer)0x0) goto LAB_0004dcb8;
      if (((param_1[cVar2] != (characterset_t)0x0) || (cVar2 < '!')) ||
         (iVar1 = iVar4 + 1, cVar2 == '\"')) {
        SeekGet(this,1,0xffffffff);
LAB_0004dcb8:
        param_2[iVar4] = '\0';
        return iVar4;
      }
    }
  }
  param_2[iVar4 + -1] = '\0';
  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)