L L4D2node

VOX_ParseLineCommands

0x000f0b30 · 786 bytes · __cdecl

_Z21VOX_ParseLineCommandsPci

Decompiled

undefined (2 params)

/* VOX_ParseLineCommands(char*, int) */

void VOX_ParseLineCommands(char *param_1,int param_2)

{
  char *pcVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  char cVar6;
  char *pcVar7;
  int iVar8;
  int in_GS_OFFSET;
  bool bVar9;
  double dVar10;
  size_t local_230;
  undefined2 local_222;
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 != (char *)0x0) {
    cVar6 = *param_1;
    iVar8 = param_2 * 0xc;
    uVar3 = 0;
    pcVar1 = param_1;
    while (cVar6 != '\0') {
      pcVar7 = pcVar1;
      if (cVar6 == '{') {
        local_230 = 0;
      }
      else {
        do {
          pcVar7 = pcVar7 + 1;
          if (*pcVar7 == '\0') break;
        } while (*pcVar7 != '{');
        local_230 = (int)pcVar7 - (int)pcVar1;
      }
      uVar2 = uVar3 + local_230;
      if (0x200 < uVar2) {
        DevMsg("Error! sentence too long!\n");
        goto LAB_000f0cc0;
      }
      memcpy(local_220 + uVar3,pcVar1,local_230);
      if (*pcVar7 == '\0') {
        cVar6 = '\0';
      }
      else {
        cVar6 = pcVar7[1];
        pcVar7 = pcVar7 + 1;
      }
      do {
        while ((cVar6 < '!' && (cVar6 != '\0'))) {
          pcVar1 = pcVar7 + 1;
          pcVar7 = pcVar7 + 1;
          cVar6 = *pcVar1;
        }
        iVar4 = tolower((int)cVar6);
        if (iVar4 == 99) {
          iVar4 = V_strnicmp(pcVar7,"closecaption",0xc);
          if (iVar4 == 0) {
            *(byte *)(g_Sentences + 8 + iVar8) = *(byte *)(g_Sentences + 8 + iVar8) & 0x80 | 1;
            pcVar7 = (char *)COM_Parse(pcVar7 + 0xc);
            if ((*pcVar7 != '}') && (' ' < *pcVar7)) {
              do {
                pcVar7 = pcVar7 + 1;
                if (*pcVar7 < '!') break;
              } while (*pcVar7 != '}');
            }
            iVar4 = _V_strlen(&com_token);
            if (iVar4 < 1) {
              *(undefined2 *)(g_Sentences + 10 + iVar8) = 0xffff;
              cVar6 = *pcVar7;
              goto LAB_000f0c39;
            }
            CUtlSymbol::CUtlSymbol((CUtlSymbol *)&local_222,&com_token);
            *(undefined2 *)(g_Sentences + 10 + iVar8) = local_222;
          }
LAB_000f0c36:
          cVar6 = *pcVar7;
        }
        else if (iVar4 == 0x6c) {
          iVar5 = V_strnicmp(pcVar7,"len",3);
          iVar4 = g_Sentences;
          if (iVar5 != 0) goto LAB_000f0c36;
          dVar10 = strtod(pcVar7 + 3,(char **)0x0);
          *(float *)(iVar4 + iVar8 + 4) = (float)dVar10;
          cVar6 = pcVar7[4];
          pcVar7 = pcVar7 + 4;
          while( true ) {
            if (cVar6 == '\0') goto LAB_000f0c74;
            if ((cVar6 < '!') || (cVar6 == '}')) break;
            pcVar7 = pcVar7 + 1;
            cVar6 = *pcVar7;
          }
        }
        else {
          while ((' ' < cVar6 && (cVar6 != '}'))) {
            pcVar7 = pcVar7 + 1;
            cVar6 = *pcVar7;
            if (cVar6 == '\0') goto LAB_000f0c74;
          }
        }
LAB_000f0c39:
      } while ((cVar6 != '}') && (cVar6 != '\0'));
      pcVar7 = pcVar7 + (cVar6 != '\0');
LAB_000f0c74:
      cVar6 = *pcVar7;
      while ((uVar3 = uVar2, pcVar1 = pcVar7, cVar6 < '!' &&
             (bVar9 = cVar6 != '\0', cVar6 = '\0', bVar9))) {
        pcVar7 = pcVar7 + 1;
        cVar6 = *pcVar7;
      }
    }
    if (uVar3 < 0x200) {
      local_220[uVar3] = '\0';
      _V_strcpy(param_1,local_220);
    }
  }
LAB_000f0cc0:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)