L L4D2node

GCSDK::CSchema::AddIncludedFields

0x0008e190 · 790 bytes · __thiscall

_ZN5GCSDK7CSchema17AddIncludedFieldsEPKcS2_

Decompiled

undefined (3 params)

/* GCSDK::CSchema::AddIncludedFields(char const*, char const*) */

void __thiscall GCSDK::CSchema::AddIncludedFields(CSchema *this,char *param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  char *__ptr;
  char *pcVar3;
  int iVar4;
  int iVar5;
  char *__s;
  int iVar6;
  int in_GS_OFFSET;
  char *local_130;
  int local_124;
  CDbgFmtMsg local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (0 < *(int *)(this + 0xa8)) {
    iVar6 = 0;
    iVar5 = 0;
    do {
      iVar2 = _V_stricmp((char *)(*(int *)(this + 0x9c) + iVar6 + 0x30),param_1);
      if (iVar2 == 0) goto LAB_0008e216;
      iVar5 = iVar5 + 1;
      iVar6 = iVar6 + 0xb0;
    } while (iVar5 < *(int *)(this + 0xa8));
  }
  CDbgFmtMsg::CDbgFmtMsg(local_120,"Index \"%s\" not found",param_1);
  iVar5 = LoggingSystem_LogAssert
                    ("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x363,local_120);
  if (iVar5 != 1) goto LAB_0008e3fc;
  cVar1 = ShouldUseNewAssertDialog();
  if (cVar1 == '\0') {
LAB_0008e462:
    raise(5);
  }
  else {
    CDbgFmtMsg::CDbgFmtMsg(local_120,"Index \"%s\" not found",param_1);
                    /* try { // try from 0008e4ae to 0008e4b2 has its CatchHandler @ 0008e4ca */
    cVar1 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x363,local_120);
    if (cVar1 != '\0') goto LAB_0008e462;
  }
  _ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x363);
LAB_0008e3fc:
  iVar6 = -0xb0;
LAB_0008e216:
  iVar5 = *(int *)(this + 0x9c);
  iVar2 = _V_strlen(param_2);
  __ptr = malloc(iVar2 + 1U);
  V_strncpy(__ptr,param_2,iVar2 + 1U);
  __s = __ptr;
  do {
    pcVar3 = strchr(__s,0x2c);
    if (pcVar3 == (char *)0x0) {
      local_130 = (char *)0x0;
    }
    else {
      local_130 = pcVar3 + 1;
      *pcVar3 = '\0';
    }
    for (; ((cVar1 = *__s, cVar1 == ' ' || ((byte)(cVar1 - 9U) < 2)) || (cVar1 == '\r'));
        __s = __s + 1) {
    }
    iVar2 = FindIField(this,__s);
    if (iVar2 == -1) {
      CDbgFmtMsg::CDbgFmtMsg
                (local_120,"Could not find index column \"%s\" on table \"%s\"",__s,this + 8);
      iVar4 = LoggingSystem_LogAssert
                        ("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x37b,local_120);
      if (iVar4 == 1) {
        cVar1 = ShouldUseNewAssertDialog();
        if (cVar1 == '\0') {
LAB_0008e380:
          raise(5);
        }
        else {
          CDbgFmtMsg::CDbgFmtMsg
                    (local_120,"Could not find index column \"%s\" on table \"%s\"",__s,this + 8);
                    /* try { // try from 0008e443 to 0008e447 has its CatchHandler @ 0008e4b9 */
          cVar1 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x37b,local_120);
          if (cVar1 != '\0') goto LAB_0008e380;
        }
        _ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x37b);
      }
    }
    local_124 = iVar2;
    CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
              ((CUtlVector<int,CUtlMemory<int,int>> *)(iVar6 + iVar5 + 0x14),
               *(int *)(iVar6 + iVar5 + 0x20),&local_124);
    __s = local_130;
    if (local_130 == (char *)0x0) {
      if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
        __stack_chk_fail();
      }
      free(__ptr);
      return;
    }
  } 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)