GCSDK::CSchema::PrimaryKey
0x0008e870 · 823 bytes · __thiscall
_ZN5GCSDK7CSchema10PrimaryKeyEbiPKc
Decompiled
undefined (4 params)
/* GCSDK::CSchema::PrimaryKey(bool, int, char const*) */
undefined4 __thiscall
GCSDK::CSchema::PrimaryKey(CSchema *this,bool param_1,int param_2,char *param_3)
{
uint *puVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
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;
undefined1 local_f8;
undefined1 local_f7;
int local_f4;
undefined1 local_f0;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_138 = FindIField(this,param_3);
if (local_138 != -1) goto LAB_0008e8b1;
CDbgFmtMsg::CDbgFmtMsg
((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",param_3,
this + 8);
iVar5 = LoggingSystem_LogAssert
("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x2af,
(CDbgFmtMsg *)local_120);
if (iVar5 != 1) goto LAB_0008e8b1;
cVar2 = ShouldUseNewAssertDialog();
if (cVar2 == '\0') {
LAB_0008eb50:
raise(5);
}
else {
CDbgFmtMsg::CDbgFmtMsg
((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",param_3,
this + 8);
/* try { // try from 0008eba3 to 0008eba7 has its CatchHandler @ 0008ebe9 */
cVar2 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x2af,(CDbgFmtMsg *)local_120);
if (cVar2 != '\0') goto LAB_0008eb50;
}
_ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x2af);
LAB_0008e8b1:
*(undefined4 *)(this + 0xc0) = 1;
puVar1 = (uint *)(*(int *)(this + 0x88) + local_138 * 0x118 + 0x110);
*puVar1 = *puVar1 | 7;
if (param_1) {
puVar1 = (uint *)(local_138 * 0x118 + *(int *)(this + 0x88) + 0x110);
*puVar1 = *puVar1 | 0x10;
}
local_134[0] = 0;
local_134[1] = 0;
local_134[2] = 0;
local_134[3] = 0;
local_134[4] = 0;
/* try { // try from 0008e933 to 0008e937 has its CatchHandler @ 0008ebe5 */
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
((CUtlVector<int,CUtlMemory<int,int>> *)local_134,0,&local_138);
iVar5 = 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_108 = 0;
local_104 = 0;
local_100 = 0;
local_fc = 0;
local_f8 = param_1;
local_f7 = 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 0008eac1 to 0008eac5 has its CatchHandler @ 0008ebe3 */
CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight
((CUtlVector<int,CUtlMemory<int,int>> *)local_120,0,iVar5);
if (0 < iVar5) {
iVar4 = 0;
do {
*(undefined4 *)(local_120[0] + iVar4 * 4) = *(undefined4 *)(local_134[0] + iVar4 * 4);
iVar4 = iVar4 + 1;
} while (iVar4 != iVar5);
}
}
local_f0 = 0;
local_f4 = param_2;
/* try { // try from 0008e9eb to 0008e9ef has its CatchHandler @ 0008ebb5 */
uVar3 = 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);
*(undefined4 *)(this + 4) = uVar3;
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 uVar3;
}
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.