CC_Test_EHandle
0x0057a530 · 538 bytes · unknown
_Z15CC_Test_EHandlev
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* CC_Test_EHandle() */
void CC_Test_EHandle(void)
{
uint uVar1;
CBaseEdict *pCVar2;
int iVar3;
int *piVar4;
int *piVar5;
undefined4 *puVar6;
int iVar7;
int *piVar8;
byte bVar9;
undefined *puVar10;
if ((((g_HandleTest != 0xffffffff) &&
(puVar10 = g_pEntityList + (g_HandleTest & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
) && (*(uint *)(puVar10 + 8) == g_HandleTest >> 0xc)) &&
(iVar3 = *(int *)(puVar10 + 4), iVar3 != 0)) {
bVar9 = *(byte *)(iVar3 + 0x444) ^ 1;
if (bVar9 == *(byte *)(iVar3 + 0x444)) {
return;
}
if (*(char *)(iVar3 + 0x6c) == '\0') {
pCVar2 = *(CBaseEdict **)(iVar3 + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar7 + 2) = 0;
}
}
else {
*(byte *)(iVar3 + 0x70) = *(byte *)(iVar3 + 0x70) | 1;
}
*(byte *)(iVar3 + 0x444) = bVar9;
return;
}
iVar3 = CreateEntityByName("handle_test",-1,true);
if ((iVar3 == 0) ||
(piVar4 = (int *)__dynamic_cast(iVar3,&CBaseEntity::typeinfo,&CHandleTest::typeinfo,0),
piVar4 == (int *)0x0)) {
piVar4 = (int *)0x0;
Warning("classname %s used to create wrong class type\n","handle_test");
}
iVar3 = CreateEntityByName("handle_dummy",-1,true);
if ((iVar3 == 0) ||
(piVar5 = (int *)__dynamic_cast(iVar3,&CBaseEntity::typeinfo,&CHandleDummy::typeinfo,0),
piVar5 == (int *)0x0)) {
piVar5 = (int *)0x0;
Warning("classname %s used to create wrong class type\n","handle_dummy");
}
uVar1 = piVar4[0x110];
piVar8 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar1 >> 0xc)) {
piVar8 = *(int **)(puVar10 + 4);
}
if (piVar5 != piVar8) {
if ((char)piVar4[0x1b] == '\0') {
pCVar2 = (CBaseEdict *)piVar4[0xc];
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
*(byte *)(piVar4 + 0x1c) = *(byte *)(piVar4 + 0x1c) | 1;
}
if (piVar5 == (int *)0x0) {
piVar4[0x110] = -1;
}
else {
piVar5 = (int *)(**(code **)(*piVar5 + 0xc))(piVar5);
piVar4[0x110] = *piVar5;
}
}
(**(code **)(*piVar4 + 100))(piVar4);
puVar6 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
g_HandleTest = *puVar6;
Msg("Created EHANDLE test entity. Run this command again to transmit the second ent.\n");
return;
}
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.