L L4D2node

CCommand::CCommand

0x00b6a870 · 341 bytes · __thiscall

_ZN8CCommandC2EiPPKc

Decompiled

undefined (3 params)

/* CCommand::CCommand(int, char const**) */

void __thiscall CCommand::CCommand(CCommand *this,int param_1,char **param_2)

{
  CCommand *__dest;
  char *__s;
  size_t __n;
  char *pcVar1;
  int iVar2;
  CCommand *local_24;
  CCommand *local_20;
  
  if (s_bBuiltBreakSet == '\0') {
    s_bBuiltBreakSet = '\x01';
    CharacterSetBuild((characterset_t *)s_BreakSet,"{}()\':");
  }
  *(undefined4 *)(this + 4) = 0;
  local_20 = this + 0x208;
  this[8] = (CCommand)0x0;
  local_24 = this + 8;
  *(int *)this = param_1;
  if (0 < param_1) {
    iVar2 = 0;
    do {
      *(CCommand **)(this + iVar2 * 4 + 0x408) = local_20;
      __n = _V_strlen(param_2[iVar2]);
      memcpy(local_20,param_2[iVar2],__n + 1);
      if (iVar2 == 0) {
        *(size_t *)(this + 4) = __n;
      }
      local_20 = local_20 + __n + 1;
      __s = param_2[iVar2];
      pcVar1 = strchr(__s,0x20);
      if (pcVar1 == (char *)0x0) {
        memcpy(local_24,__s,__n);
        local_24 = local_24 + __n;
      }
      else {
        *local_24 = (CCommand)0x22;
        __dest = local_24 + 1;
        memcpy(__dest,param_2[iVar2],__n);
        local_24 = __dest + __n + 1;
        __dest[__n] = (CCommand)0x22;
      }
      if (param_1 + -1 != iVar2) {
        *local_24 = (CCommand)0x20;
        local_24 = local_24 + 1;
      }
      iVar2 = iVar2 + 1;
    } while (iVar2 != param_1);
  }
  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)