L L4D2node

GCSDK::CSchema::AddIndexToFieldList

0x0008f390 · 1180 bytes · __thiscall

_ZN5GCSDK7CSchema19AddIndexToFieldListEPKcS2_ii

Decompiled

undefined (5 params)

/* GCSDK::CSchema::AddIndexToFieldList(char const*, char const*, int, int) */

undefined4 __thiscall
GCSDK::CSchema::AddIndexToFieldList
          (CSchema *this,char *param_1,char *param_2,int param_3,int param_4)

{
  uint *puVar1;
  char cVar2;
  int iVar3;
  char *__ptr;
  char *pcVar4;
  undefined4 uVar5;
  int iVar6;
  char *__s;
  char *pcVar7;
  int in_GS_OFFSET;
  int local_138;
  int local_134 [5];
  int local_120 [5];
  undefined4 local_10c;
  undefined4 local_108;
  undefined4 local_104;
  undefined4 local_100;
  undefined4 local_fc;
  byte local_f8;
  byte local_f7;
  int local_f4;
  char local_f0 [208];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = _V_strlen(param_1);
  __ptr = malloc(iVar3 + 1U);
  V_strncpy(__ptr,param_1,iVar3 + 1U);
  if (param_1 == (char *)0x0) {
    uVar5 = 0xffffffff;
    iVar3 = LoggingSystem_LogAssert
                      ("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x2f8,
                       "Assertion Failed: false");
    if (iVar3 == 1) {
      cVar2 = ShouldUseNewAssertDialog();
      if ((cVar2 == '\0') ||
         (cVar2 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x2f8,
                                    "Assertion Failed: false"), cVar2 != '\0')) {
        raise(5);
      }
      uVar5 = 0xffffffff;
      _ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x2f8);
    }
  }
  else {
    local_134[0] = 0;
    local_134[1] = 0;
    local_134[2] = 0;
    local_134[3] = 0;
    local_134[4] = 0;
    __s = __ptr;
    do {
      pcVar4 = strchr(__s,0x2c);
      pcVar7 = __s;
      if (pcVar4 == (char *)0x0) {
        __s = (char *)0x0;
      }
      else {
        *pcVar4 = '\0';
        __s = pcVar4 + 1;
      }
      for (; ((cVar2 = *pcVar7, cVar2 == ' ' || ((byte)(cVar2 - 9U) < 2)) || (cVar2 == '\r'));
          pcVar7 = pcVar7 + 1) {
      }
                    /* try { // try from 0008f46d to 0008f55b has its CatchHandler @ 0008f849 */
      local_138 = FindIField(this,pcVar7);
      if (local_138 == -1) {
        CDbgFmtMsg::CDbgFmtMsg
                  ((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",
                   pcVar7,this + 8);
        iVar3 = LoggingSystem_LogAssert
                          ("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x30e,local_120);
        if (iVar3 == 1) {
          cVar2 = ShouldUseNewAssertDialog();
          if (cVar2 == '\0') {
LAB_0008f53c:
            raise(5);
          }
          else {
            CDbgFmtMsg::CDbgFmtMsg
                      ((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",
                       pcVar7,this + 8);
                    /* try { // try from 0008f73b to 0008f73f has its CatchHandler @ 0008f80f */
            cVar2 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x30e,local_120);
            if (cVar2 != '\0') goto LAB_0008f53c;
          }
          _ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x30e);
        }
      }
      puVar1 = (uint *)(local_138 * 0x118 + *(int *)(this + 0x88) + 0x110);
      *puVar1 = *puVar1 | param_3;
      CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
                ((CUtlVector<int,CUtlMemory<int,int>> *)local_134,local_134[3],&local_138);
    } while (__s != (char *)0x0);
    free(__ptr);
    iVar3 = local_134[3];
    local_120[0] = 0;
    local_120[1] = 0;
    local_120[2] = 0;
    local_120[3] = 0;
    local_120[4] = 0;
    local_10c = 0;
    local_f8 = (byte)((uint)param_3 >> 4) & 1;
    local_108 = 0;
    local_104 = 0;
    local_100 = 0;
    local_fc = 0;
    local_f7 = (byte)((uint)param_3 >> 1) & 1;
    if (local_134[3] != 0) {
      CUtlVector<int,CUtlMemory<int,int>>::GrowVector
                ((CUtlVector<int,CUtlMemory<int,int>> *)local_120,local_134[3]);
                    /* try { // try from 0008f771 to 0008f775 has its CatchHandler @ 0008f852 */
      CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight
                ((CUtlVector<int,CUtlMemory<int,int>> *)local_120,0,iVar3);
      if (0 < iVar3) {
        iVar6 = 0;
        do {
          *(undefined4 *)(local_120[0] + iVar6 * 4) = *(undefined4 *)(local_134[0] + iVar6 * 4);
          iVar6 = iVar6 + 1;
        } while (iVar6 != iVar3);
      }
    }
    local_f4 = 0;
    if (param_2 == (char *)0x0) {
      local_f0[0] = '\0';
    }
    else {
                    /* try { // try from 0008f634 to 0008f638 has its CatchHandler @ 0008f852 */
      V_strncpy(local_f0,param_2,0x80);
    }
    local_f4 = param_4;
                    /* try { // try from 0008f656 to 0008f65a has its CatchHandler @ 0008f875 */
    uVar5 = CUtlVector<GCSDK::FieldSet_t,CUtlMemory<GCSDK::FieldSet_t,int>>::InsertBefore
                      ((CUtlVector<GCSDK::FieldSet_t,CUtlMemory<GCSDK::FieldSet_t,int>> *)
                       (this + 0x9c),*(int *)(this + 0xa8),(FieldSet_t *)local_120);
    local_100 = 0;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_10c);
    local_fc = local_10c;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_10c);
    local_120[3] = 0;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_120);
    local_120[4] = local_120[0];
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_120);
    local_134[3] = 0;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_134);
    local_134[4] = local_134[0];
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_134);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar5;
}

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)