GCSDK::CSchema::UniqueField
0x0008f000 · 829 bytes · __thiscall
_ZN5GCSDK7CSchema11UniqueFieldEPKcS2_
Decompiled
undefined (3 params)
/* GCSDK::CSchema::UniqueField(char const*, char const*) */
undefined4 __thiscall GCSDK::CSchema::UniqueField(CSchema *this,char *param_1,char *param_2)
{
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;
undefined4 local_f4;
char local_f0 [208];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_138 = FindIField(this,param_2);
if (local_138 != -1) goto LAB_0008f041;
CDbgFmtMsg::CDbgFmtMsg
((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",param_2,
this + 8);
iVar5 = LoggingSystem_LogAssert
("%s (%d) : %s\n","/data/src/gcsdk/sqlaccess/schema.cpp",0x3f2,
(CDbgFmtMsg *)local_120);
if (iVar5 != 1) goto LAB_0008f041;
cVar2 = ShouldUseNewAssertDialog();
if (cVar2 == '\0') {
LAB_0008f2e0:
raise(5);
}
else {
CDbgFmtMsg::CDbgFmtMsg
((CDbgFmtMsg *)local_120,"Could not find index column \"%s\" on table \"%s\"",param_2,
this + 8);
/* try { // try from 0008f333 to 0008f337 has its CatchHandler @ 0008f379 */
cVar2 = DoNewAssertDialog("/data/src/gcsdk/sqlaccess/schema.cpp",0x3f2,(CDbgFmtMsg *)local_120);
if (cVar2 != '\0') goto LAB_0008f2e0;
}
_ExitOnFatalAssert("/data/src/gcsdk/sqlaccess/schema.cpp",0x3f2);
LAB_0008f041:
local_134[0] = 0;
local_134[1] = 0;
local_134[2] = 0;
local_134[3] = 0;
local_134[4] = 0;
puVar1 = (uint *)(local_138 * 0x118 + *(int *)(this + 0x88) + 0x110);
*puVar1 = *puVar1 | 3;
/* try { // try from 0008f0a1 to 0008f0a5 has its CatchHandler @ 0008f373 */
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 = 0;
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 0008f241 to 0008f245 has its CatchHandler @ 0008f345 */
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_f4 = 0;
if (param_1 == (char *)0x0) {
local_f0[0] = '\0';
}
else {
/* try { // try from 0008f15f to 0008f163 has its CatchHandler @ 0008f345 */
V_strncpy(local_f0,param_1,0x80);
}
/* try { // try from 0008f178 to 0008f17c has its CatchHandler @ 0008f377 */
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);
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.