L L4D2node

GCSDK::CSchema::AddFK

0x0008fbb0 · 550 bytes · __thiscall

_ZN5GCSDK7CSchema5AddFKEPKcS2_S2_S2_NS_17EForeignKeyActionES3_

Decompiled

undefined (7 params)

/* GCSDK::CSchema::AddFK(char const*, char const*, char const*, char const*,
   GCSDK::EForeignKeyAction, GCSDK::EForeignKeyAction) */

void __thiscall
GCSDK::CSchema::AddFK
          (CSchema *this,undefined4 param_1,char *param_2,char *param_3,char *param_4,
          undefined4 param_6,undefined4 param_7)

{
  char *pcVar1;
  FKColumnRelation_t FVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  int in_GS_OFFSET;
  uint local_138;
  uint local_130;
  FKColumnRelation_t local_122 [129];
  char local_a1 [129];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar3 = CUtlVector<GCSDK::FKData_t,CUtlMemory<GCSDK::FKData_t,int>>::InsertBefore
                    ((CUtlVector<GCSDK::FKData_t,CUtlMemory<GCSDK::FKData_t,int>> *)(this + 0xe0),
                     *(int *)(this + 0xec));
  pcVar1 = (char *)(iVar3 * 0x124 + *(int *)(this + 0xe0));
  V_snprintf(pcVar1,0x81,"%s_%s",this + 8,param_1);
  V_strncpy(pcVar1 + 0x81,param_3,0x81);
  *(undefined4 *)(pcVar1 + 0x11c) = param_6;
  *(undefined4 *)(pcVar1 + 0x120) = param_7;
  iVar3 = 0;
  _V_memset(local_122,0,0x81);
  _V_memset(local_a1,0,0x81);
  _V_memset(local_122,0,0x102);
  local_130 = 0;
  local_138 = 0;
  do {
    iVar4 = _V_strlen(param_2);
    if (iVar4 + 1U <= local_130) {
      if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
        return;
      }
                    /* WARNING: Subroutine does not return */
      __stack_chk_fail();
    }
    FVar2 = *(FKColumnRelation_t *)(param_2 + local_130);
    if ((FVar2 == (FKColumnRelation_t)0x0) || (FVar2 == (FKColumnRelation_t)0x2c)) {
      uVar6 = local_138;
      while( true ) {
        uVar5 = _V_strlen(param_4);
        if (uVar5 <= uVar6) break;
        if (param_4[uVar6] == ',') {
          uVar6 = uVar6 + 1;
          break;
        }
        local_a1[uVar6 - local_138] = param_4[uVar6];
        uVar6 = uVar6 + 1;
      }
      iVar3 = 0;
      CUtlVector<GCSDK::FKColumnRelation_t,CUtlMemory<GCSDK::FKColumnRelation_t,int>>::InsertBefore
                ((CUtlVector<GCSDK::FKColumnRelation_t,CUtlMemory<GCSDK::FKColumnRelation_t,int>> *)
                 (pcVar1 + 0x108),*(int *)(pcVar1 + 0x114),local_122);
      _V_memset(local_122,0,0x102);
      local_138 = uVar6;
    }
    else {
      local_122[iVar3] = FVar2;
      iVar3 = iVar3 + 1;
    }
    local_130 = local_130 + 1;
  } 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)