L L4D2node

CSentence::CountWords

0x000dde20 · 105 bytes · __cdecl

_ZN9CSentence10CountWordsEPKc

Decompiled

undefined (1 param)

/* CSentence::CountWords(char const*) */

int CSentence::CountWords(char *param_1)

{
  char cVar1;
  char *pcVar2;
  int iVar3;
  byte bVar4;
  
  if (param_1 == (char *)0x0) {
    return 0;
  }
  bVar4 = *param_1;
  iVar3 = 0;
  if (bVar4 != 0) {
    iVar3 = 1;
    do {
      if (bVar4 < 0x21) {
        iVar3 = iVar3 + 1;
        cVar1 = *param_1;
        while (pcVar2 = param_1, (byte)(cVar1 - 1U) < 0x20) {
          param_1 = param_1 + 1;
          cVar1 = *param_1;
        }
      }
      else {
        cVar1 = *param_1;
        pcVar2 = param_1;
      }
      if (cVar1 == '\0') {
        return iVar3;
      }
      param_1 = pcVar2 + 1;
      bVar4 = pcVar2[1];
    } while (bVar4 != 0);
  }
  return iVar3;
}

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)