L L4D2node

CCvarUtilities::CvarFindFlags_f

0x00129150 · 277 bytes · __thiscall

_ZN14CCvarUtilities15CvarFindFlags_fERK8CCommand

Decompiled

undefined (2 params)

/* CCvarUtilities::CvarFindFlags_f(CCommand const&) */

void __thiscall CCvarUtilities::CvarFindFlags_f(CCvarUtilities *this,CCommand *param_1)

{
  char *pcVar1;
  undefined *puVar2;
  char cVar3;
  int *piVar4;
  ConCommandBase *pCVar5;
  int iVar6;
  undefined **ppuVar7;
  
  if (1 < *(int *)param_1) {
    pcVar1 = *(char **)(param_1 + 0x40c);
    piVar4 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
                    /* try { // try from 00129185 to 0012921a has its CatchHandler @ 0012926e */
    (**(code **)(*piVar4 + 8))(piVar4);
    while( true ) {
      cVar3 = (**(code **)(*piVar4 + 0x10))(piVar4);
      if (cVar3 == '\0') break;
      pCVar5 = (ConCommandBase *)(**(code **)(*piVar4 + 0x14))(piVar4);
      cVar3 = (**(code **)(*(int *)pCVar5 + 0xc))(pCVar5,2);
      if (cVar3 == '\0') {
        cVar3 = (**(code **)(*(int *)pCVar5 + 0xc))(pCVar5,0x10);
        if (cVar3 == '\0') {
          ppuVar7 = (undefined **)&g_ConVarFlags;
          do {
            cVar3 = (**(code **)(*(int *)pCVar5 + 0xc))(pCVar5,*ppuVar7);
            if (cVar3 != '\0') {
              iVar6 = _V_stricmp(ppuVar7[1],pcVar1);
              if (iVar6 == 0) {
                ConVar_PrintDescription(pCVar5);
              }
            }
            ppuVar7 = ppuVar7 + 3;
          } while (ppuVar7 != &cv);
        }
      }
      (**(code **)(*piVar4 + 0xc))(piVar4);
    }
                    /* WARNING: Could not recover jumptable at 0x0012922a. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*piVar4 + 4))();
    return;
  }
  ppuVar7 = &PTR_s_ARCHIVE_00340cc4;
  ConMsg("Usage:  findflags <string>\n");
  ConMsg("Available flags to search for: \n");
  do {
    puVar2 = *ppuVar7;
    ppuVar7 = ppuVar7 + 3;
    ConMsg("   - %s\n",puVar2);
  } while (ppuVar7 !=
           (undefined **)
           &CUtlRBTree<ConCommandBase_const*,unsigned_short,bool(*)(ConCommandBase_const*const&,ConCommandBase_const*const&),CUtlMemory<UtlRBTreeNode_t<ConCommandBase_const*,unsigned_short>,unsigned_short>>
            ::Links(unsigned_short)::s_Sentinel);
  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)