L L4D2node

Cbuf_EscapeCommandArg

0x00116e10 · 121 bytes · __cdecl

_Z21Cbuf_EscapeCommandArgPKcPcj

Decompiled

undefined (3 params)

/* Cbuf_EscapeCommandArg(char const*, char*, unsigned int) */

undefined4 Cbuf_EscapeCommandArg(char *param_1,char *param_2,uint param_3)

{
  undefined4 uVar1;
  char *pcVar2;
  int iVar3;
  char cVar4;
  
  if (param_1 == (char *)0x0) {
    return 0;
  }
  cVar4 = *param_1;
  uVar1 = 0;
  pcVar2 = param_1;
  if (cVar4 != '\0') {
    do {
      if (cVar4 < ' ') {
        return 0;
      }
      if (cVar4 == '\"') {
        return 0;
      }
      pcVar2 = pcVar2 + 1;
    } while ((pcVar2 != (char *)0x0) && (cVar4 = *pcVar2, cVar4 != '\0'));
    if (param_2 == (char *)0x0) {
      return 0;
    }
    iVar3 = _V_strlen(param_1);
    if (param_3 < iVar3 + 3U) {
      return 0;
    }
    V_snprintf(param_2,param_3,"\"%s\"",param_1);
    uVar1 = 1;
  }
  return uVar1;
}

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)