GCSDK::CRecordInfo::GetFKListString
0x00093790 · 717 bytes · __thiscall
_ZN5GCSDK11CRecordInfo15GetFKListStringEP8CFmtStrNILi1024EEi
Decompiled
undefined (3 params)
/* GCSDK::CRecordInfo::GetFKListString(CFmtStrN<1024>*, int) */
void __thiscall GCSDK::CRecordInfo::GetFKListString(CRecordInfo *this,CFmtStrN *param_1,int param_2)
{
CFmtStrN *pCVar1;
undefined4 uVar2;
undefined4 uVar3;
int iVar4;
CFmtStrN *pCVar5;
int iVar6;
char *pcVar7;
int in_GS_OFFSET;
int local_244;
undefined **local_238;
undefined1 local_234;
undefined1 local_233 [259];
undefined4 local_130;
undefined **local_12c;
undefined1 local_128;
undefined1 local_127 [259];
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CFmtStrN<1024>::sprintf((CFmtStrN<1024> *)param_1,"Table %s Foreign Keys: \n",this + 8);
if (*(int *)(this + 0x110) == 0) {
iVar4 = *(int *)(param_1 + 0x408);
if (0x3ff < (uint)(iVar4 + param_2)) {
param_2 = 0x3ff - iVar4;
}
if (param_2 != 0) {
pCVar1 = param_1 + iVar4 + 5;
pCVar5 = pCVar1 + param_2;
do {
*pCVar1 = (CFmtStrN)0x9;
pCVar1 = pCVar1 + 1;
} while (pCVar1 != pCVar5);
iVar4 = iVar4 + param_2;
*(int *)(param_1 + 0x408) = iVar4;
}
param_1[iVar4 + 5] = (CFmtStrN)0x0;
CFmtStrN<1024>::AppendFormat((CFmtStrN<1024> *)param_1,"No foreign keys for table\n");
}
else {
local_244 = 0;
if (0 < *(int *)(this + 0x110)) {
do {
iVar4 = *(int *)(param_1 + 0x408);
iVar6 = param_2;
if (0x3ff < (uint)(param_2 + iVar4)) {
iVar6 = 0x3ff - iVar4;
}
if (iVar6 != 0) {
pCVar1 = param_1 + iVar4 + 5;
do {
*pCVar1 = (CFmtStrN)0x9;
pCVar1 = pCVar1 + 1;
} while (pCVar1 != param_1 + iVar6 + iVar4 + 5);
iVar4 = iVar4 + iVar6;
*(int *)(param_1 + 0x408) = iVar4;
}
local_234 = 1;
local_238 = &PTR_InitQuietTruncation_000b0520;
local_233[0] = 0;
local_130 = 0;
param_1[iVar4 + 5] = (CFmtStrN)0x0;
local_12c = &PTR_InitQuietTruncation_000b0520;
local_128 = 1;
local_127[0] = 0;
local_24 = 0;
iVar4 = local_244 * 0x124 + *(int *)(this + 0x104);
if (0 < *(int *)(iVar4 + 0x114)) {
pcVar7 = *(char **)(iVar4 + 0x108);
iVar6 = 0;
while( true ) {
iVar6 = iVar6 + 1;
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_238,pcVar7);
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_12c,pcVar7 + 0x81);
if (*(int *)(iVar4 + 0x114) <= iVar6) break;
pcVar7 = (char *)(iVar6 * 0x102 + *(int *)(iVar4 + 0x108));
if (0 < iVar6) {
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_238,",");
CFmtStrN<256>::AppendFormat((CFmtStrN<256> *)&local_12c,",");
}
}
}
uVar2 = PchNameFromEForeignKeyAction(*(undefined4 *)(iVar4 + 0x120));
uVar3 = PchNameFromEForeignKeyAction(*(undefined4 *)(iVar4 + 0x11c));
CFmtStrN<1024>::AppendFormat
((CFmtStrN<1024> *)param_1,
"CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s) ON DELETE %s ON UPDATE %s\n",
iVar4,local_233,iVar4 + 0x81,local_127,uVar3,uVar2);
local_244 = local_244 + 1;
} while (local_244 < *(int *)(this + 0x110));
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.