L L4D2node

CUtlBuffer::ParseToken

0x00b7f860 · 481 bytes · __thiscall

_ZN10CUtlBuffer10ParseTokenEPKcS1_Pci

Decompiled

undefined (5 params)

/* CUtlBuffer::ParseToken(char const*, char const*, char*, int) */

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

{
  byte bVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  uint local_30;
  byte local_1e;
  char local_1d [13];
  
  local_1e = 0;
  if (param_1 == (char *)0x0) {
    param_1 = (char *)&local_1e;
  }
  iVar4 = _V_strlen(param_2);
  uVar2 = *(undefined4 *)(this + 0xc);
  EatWhiteSpace(this);
  do {
    bVar1 = *param_1;
    while( true ) {
      if (bVar1 == 0) {
        EatWhiteSpace(this);
        iVar6 = *(int *)(this + 0xc);
        local_30 = GetToken(this,param_2);
        if ((char)local_30 == '\0') goto LAB_00b7f8f4;
        iVar5 = *(int *)(this + 0xc);
        iVar4 = (iVar5 - iVar4) - iVar6;
        if (param_4 <= iVar4) {
          iVar4 = param_4 + -1;
        }
        if (iVar4 < 1) goto LAB_00b7fa20;
        SeekGet(this,0,iVar6);
        Get(this,param_3,iVar4);
        if (this[0x14] != (CUtlBuffer)0x0) goto LAB_00b7f8f4;
        local_30 = local_30 & 0xff;
        goto LAB_00b7f9f7;
      }
      param_1 = param_1 + 1;
      if ((0x17 < bVar1 - 9) || ((1 << ((byte)(bVar1 - 9) & 0x1f) & 0x80001fU) == 0)) break;
      EatWhiteSpace(this);
      bVar1 = *param_1;
    }
    if (((byte)this[0x15] & 1) == 0) {
      cVar3 = CheckGet(this,1);
      iVar6 = 0;
      if (cVar3 != '\0') {
        iVar6 = (int)*(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);
      iVar6 = (int)local_1d[0];
    }
    iVar6 = tolower(iVar6);
    iVar5 = tolower((int)(char)bVar1);
    if (iVar6 != iVar5) {
LAB_00b7f8f4:
      SeekGet(this,0,uVar2);
      *param_3 = '\0';
      return 0;
    }
  } while( true );
  while (iVar4 = iVar4 + -1, iVar4 != 0) {
LAB_00b7f9f7:
    if ((0x17 < (byte)param_3[iVar4 + -1] - 9) ||
       ((1 << ((byte)((byte)param_3[iVar4 + -1] - 9) & 0x1f) & 0x80001fU) == 0)) goto LAB_00b7fa20;
  }
  iVar4 = 0;
LAB_00b7fa20:
  param_3[iVar4] = '\0';
  SeekGet(this,0,iVar5);
  return local_30;
}

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)