L L4D2node

GCSDK::EscapeStringValue

0x00090960 · 122 bytes · __cdecl

_ZN5GCSDK17EscapeStringValueEPci

Decompiled

undefined (2 params)

/* GCSDK::EscapeStringValue(char*, int) */

void GCSDK::EscapeStringValue(char *param_1,int param_2)

{
  char cVar1;
  char *pcVar2;
  int iVar3;
  int iVar4;
  
  iVar4 = 0;
  iVar3 = 0;
  cVar1 = *param_1;
  if (cVar1 != '\0') {
    do {
      iVar3 = iVar3 + 1;
      iVar4 = iVar4 + (uint)(cVar1 == '\'');
      cVar1 = param_1[iVar3];
    } while (cVar1 != '\0');
    if ((iVar4 != 0) && (iVar3 + iVar4 < param_2)) {
      pcVar2 = param_1 + iVar3 + iVar4 + -1;
      param_1[iVar3 + iVar4] = '\0';
      if (param_1 < pcVar2) {
        do {
          *pcVar2 = pcVar2[-iVar4];
          if (pcVar2[-iVar4] == '\'') {
            pcVar2[-1] = '\'';
            iVar4 = iVar4 + -1;
            pcVar2 = pcVar2 + -2;
          }
          else {
            pcVar2 = pcVar2 + -1;
          }
        } while ((param_1 < pcVar2) && (0 < iVar4));
      }
    }
  }
  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)