L L4D2node

CBaseAutoCompleteFileList::AutoCompletionFunc

0x000f6cd0 · 857 bytes · __thiscall

_ZN25CBaseAutoCompleteFileList18AutoCompletionFuncEPKcPA64_c

Decompiled

undefined (3 params)

/* CBaseAutoCompleteFileList::AutoCompletionFunc(char const*, char (*) [64]) */

int __thiscall
CBaseAutoCompleteFileList::AutoCompletionFunc
          (CBaseAutoCompleteFileList *this,char *param_1,char *param_2)

{
  char *__s;
  int iVar1;
  size_t sVar2;
  char *pcVar3;
  undefined4 uVar4;
  int iVar5;
  int in_GS_OFFSET;
  CUtlMemory<CUtlSymbol,int> *local_144;
  short local_12e;
  short *local_12c;
  undefined4 local_128;
  undefined4 local_124;
  int local_120;
  short *local_11c;
  CUtlSymbolTable local_118 [56];
  char local_e0 [96];
  char local_80 [96];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __s = *(char **)this;
  iVar1 = _V_strstr(param_1,__s);
  if (iVar1 != 0) {
    sVar2 = strlen(__s);
    param_1 = param_1 + sVar2 + 1;
  }
  pcVar3 = *(char **)(this + 4);
  if (((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) ||
     (iVar1 = V_strcasecmp(pcVar3,"NULL"), iVar1 == 0)) {
    V_snprintf(local_e0,0x60,"*.%s",*(undefined4 *)(this + 8));
  }
  else {
    V_snprintf(local_e0,0x60,"%s/*.%s",*(undefined4 *)(this + 4),*(undefined4 *)(this + 8));
  }
  CUtlSymbolTable::CUtlSymbolTable(local_118,0,0,true);
  local_12c = (short *)0x0;
  local_128 = 0;
  local_124 = 0;
  local_120 = 0;
  local_11c = (short *)0x0;
                    /* try { // try from 000f6dc8 to 000f6faf has its CatchHandler @ 000f7037 */
  pcVar3 = (char *)Sys_FindFirst(local_e0,(char *)0x0,0);
  if (pcVar3 != (char *)0x0) {
    do {
      V_snprintf(local_80,0x60,"%s",pcVar3);
      if (*param_1 == '\0') {
LAB_000f6e15:
        CUtlSymbolTable::AddString((char *)&local_12e);
        if (local_120 < 1) {
LAB_000f6e69:
          CUtlVector<CUtlSymbol,CUtlMemory<CUtlSymbol,int>>::InsertBefore
                    ((CUtlVector<CUtlSymbol,CUtlMemory<CUtlSymbol,int>> *)&local_12c,local_120,
                     (CUtlSymbol *)&local_12e);
        }
        else if (*local_12c != local_12e) {
          iVar1 = 0;
          do {
            iVar1 = iVar1 + 1;
            if (iVar1 == local_120) goto LAB_000f6e69;
          } while (local_12c[iVar1] != local_12e);
          if (iVar1 == -1) goto LAB_000f6e69;
        }
      }
      else {
        sVar2 = strlen(param_1);
        iVar1 = V_strncasecmp(pcVar3,param_1,sVar2);
        if (iVar1 == 0) goto LAB_000f6e15;
      }
      pcVar3 = (char *)Sys_FindNext((char *)0x0,0);
    } while ((local_120 < 0x40) && (pcVar3 != (char *)0x0));
  }
  local_144 = (CUtlMemory<CUtlSymbol,int> *)&local_12c;
  Sys_FindClose();
  iVar1 = local_120;
  if (0 < local_120) {
    iVar5 = 0;
    do {
      local_12e = local_12c[iVar5];
      uVar4 = CUtlSymbolTable::String(local_118,&local_12e);
      V_snprintf(param_2,0x40,"%s %s",__s,uVar4);
      iVar5 = iVar5 + 1;
      sVar2 = strlen(param_2);
      param_2[sVar2 - 4] = '\0';
      iVar1 = local_120;
      param_2 = param_2 + 0x40;
    } while (iVar5 < local_120);
  }
  local_120 = 0;
  CUtlMemory<CUtlSymbol,int>::Purge(local_144);
  local_11c = local_12c;
  CUtlMemory<CUtlSymbol,int>::Purge(local_144);
  CUtlSymbolTable::~CUtlSymbolTable(local_118);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return iVar1;
}

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)