L L4D2node

AttributeAutocomplete

0x00972570 · 415 bytes · __cdecl

_ZL21AttributeAutocompletePKcPA64_c

Decompiled

undefined (2 params)

/* AttributeAutocomplete(char const*, char (*) [64]) */

int AttributeAutocomplete(char *param_1,char *param_2)

{
  int iVar1;
  undefined1 *puVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  int iVar8;
  int in_GS_OFFSET;
  char local_61 [65];
  int local_20;
  
  iVar6 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = _V_strlen(param_1);
  if (iVar1 < 0x40) {
    V_strncpy(local_61,param_1,0x41);
    puVar2 = (undefined1 *)_V_strrchr(local_61,' ');
    if (puVar2 != (undefined1 *)0x0) {
      *puVar2 = 0;
      pcVar3 = puVar2 + 1;
      iVar1 = _V_strlen(pcVar3);
      pcVar7 = "EMPTY";
      iVar8 = 0;
      do {
        iVar4 = V_strnicmp(pcVar7,pcVar3,iVar1);
        if (iVar4 != 0) {
          pcVar7 = *(char **)(spawnAttributeTable + (iVar8 + 1) * 8);
          if (pcVar7 != (char *)0x0) goto LAB_00972626;
LAB_00972689:
          if ((TheNavAttributeTable != (undefined *)0x0) && (iVar6 < 0x40)) {
            iVar4 = 0;
            pcVar7 = TheNavAttributeTable;
            iVar8 = iVar6;
            do {
              iVar5 = V_strnicmp(pcVar7,pcVar3,iVar1);
              iVar6 = iVar8;
              if (iVar5 == 0) {
                iVar6 = iVar8 + 1;
                V_snprintf(param_2 + iVar8 * 0x40,0x40,"%s %s",local_61,
                           (&TheNavAttributeTable)[iVar4 * 2]);
              }
              iVar4 = iVar4 + 1;
              pcVar7 = (&TheNavAttributeTable)[iVar4 * 2];
            } while ((pcVar7 != (char *)0x0) && (iVar8 = iVar6, iVar6 < 0x40));
          }
          break;
        }
        iVar4 = iVar6 + 1;
        V_snprintf(param_2 + iVar6 * 0x40,0x40,"%s %s",local_61,pcVar7);
        pcVar7 = *(char **)(spawnAttributeTable + (iVar8 + 1) * 8);
        iVar6 = iVar4;
        if (pcVar7 == (char *)0x0) goto LAB_00972689;
LAB_00972626:
        iVar8 = iVar8 + 1;
      } while (iVar6 < 0x40);
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar6;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)