L L4D2node

V_AddBackSlashesToSpecialChars

0x0025f630 · 208 bytes · __cdecl

_Z30V_AddBackSlashesToSpecialCharsPKc

Decompiled

undefined (1 param)

/* V_AddBackSlashesToSpecialChars(char const*) */

void V_AddBackSlashesToSpecialChars(char *param_1)

{
  char *pcVar1;
  int iVar2;
  uint uVar3;
  char cVar4;
  char cVar5;
  char *pcVar6;
  char *pcVar7;
  
  cVar5 = *param_1;
  if (cVar5 == '\0') {
    uVar3 = 1;
  }
  else {
    iVar2 = 0;
    pcVar6 = param_1;
    do {
      iVar2 = iVar2 + 1;
      if (s_BackSlashMap != '\0') {
        pcVar1 = &s_BackSlashMap;
        cVar4 = s_BackSlashMap;
        do {
          pcVar1 = pcVar1 + 2;
          iVar2 = iVar2 + (uint)(cVar5 == cVar4);
          cVar4 = *pcVar1;
        } while (cVar4 != '\0');
      }
      pcVar6 = pcVar6 + 1;
      cVar5 = *pcVar6;
    } while (cVar5 != '\0');
    uVar3 = iVar2 + 1;
  }
  pcVar6 = operator_new__(uVar3);
  cVar5 = *param_1;
  do {
    if (cVar5 == '\0') {
      *pcVar6 = '\0';
      return;
    }
    if (s_BackSlashMap != '\0') {
      pcVar1 = &s_BackSlashMap;
      cVar4 = s_BackSlashMap;
      do {
        if (cVar5 == cVar4) {
          *pcVar6 = '\\';
          pcVar7 = pcVar6 + 2;
          pcVar6[1] = pcVar1[1];
          goto LAB_0025f6d7;
        }
        pcVar1 = pcVar1 + 2;
        cVar4 = *pcVar1;
      } while (cVar4 != '\0');
    }
    pcVar7 = pcVar6 + 1;
    *pcVar6 = *param_1;
LAB_0025f6d7:
    param_1 = param_1 + 1;
    cVar5 = *param_1;
    pcVar6 = pcVar7;
  } while( true );
}

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)