L L4D2node

GCSDK::BuildInsertAndReadStatementText

0x00091110 · 424 bytes · __cdecl

_ZN5GCSDK31BuildInsertAndReadStatementTextEP8CFmtStrNILi1024EEP10CUtlVectorIi10CUtlMemoryIiiEEPKNS_11CRecordInfoE

Decompiled

undefined (3 params)

/* GCSDK::BuildInsertAndReadStatementText(CFmtStrN<1024>*, CUtlVector<int, CUtlMemory<int, int> >*,
   GCSDK::CRecordInfo const*) */

void GCSDK::BuildInsertAndReadStatementText
               (CFmtStrN *param_1,CUtlVector *param_2,CRecordInfo *param_3)

{
  int iVar1;
  bool bVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  int local_20 [4];
  
  CFmtStrN<1024>::sprintf((CFmtStrN<1024> *)param_1,"INSERT INTO %s (",param_3 + 8);
  iVar1 = *(int *)(param_3 + 0x9c);
  if (iVar1 < 1) {
    CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1," VALUES (");
  }
  else {
    iVar4 = 0;
    bVar2 = false;
    iVar5 = *(int *)(param_3 + 0x90);
    do {
      pcVar3 = (char *)(iVar4 * 0xa0 + iVar5);
      if ((pcVar3[0x88] & 8U) == 0) {
        if (bVar2) {
          CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,", ");
        }
        CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,pcVar3);
        iVar5 = *(int *)(param_3 + 0x90);
        bVar2 = true;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 != iVar1);
    local_20[0] = 0;
    bVar2 = false;
    while( true ) {
      pcVar3 = (char *)(local_20[0] * 0xa0 + iVar5);
      if ((pcVar3[0x88] & 8U) != 0) {
        if (bVar2) {
          CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,", INSERTED.");
        }
        else {
          CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,") OUTPUT INSERTED.");
        }
        CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,pcVar3);
        CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
                  ((CUtlVector<int,CUtlMemory<int,int>> *)param_2,*(int *)(param_2 + 0xc),local_20);
        bVar2 = true;
      }
      local_20[0] = local_20[0] + 1;
      if (iVar1 <= local_20[0]) break;
      iVar5 = *(int *)(param_3 + 0x90);
    }
    iVar5 = 0;
    CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1," VALUES (");
    bVar2 = false;
    do {
      if ((*(byte *)(iVar5 * 0xa0 + *(int *)(param_3 + 0x90) + 0x88) & 8) == 0) {
        if (bVar2) {
          CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,", ");
        }
        CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,"?");
        bVar2 = true;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 != iVar1);
  }
  CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,")");
  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)