CUtlStreamBuffer::Close
0x0028d220 · 213 bytes · __thiscall
_ZN16CUtlStreamBuffer5CloseEv
Decompiled
undefined (1 param)
/* CUtlStreamBuffer::Close() */
void __thiscall CUtlStreamBuffer::Close(CUtlStreamBuffer *this)
{
int iVar1;
int iVar2;
int iVar3;
if ((((byte)this[0x15] & 8) == 0) &&
(iVar1 = *(int *)(this + 0x10), iVar2 = *(int *)(this + 0x20), 0 < iVar1 - iVar2)) {
iVar3 = *(int *)(this + 0x38);
if (iVar3 != 0) {
LAB_0028d246:
if (g_pFullFileSystem != 0) {
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 4))
(g_pFullFileSystem + 4,*(undefined4 *)this,iVar1 - iVar2,iVar3);
goto LAB_0028d26a;
}
goto LAB_0028d28a;
}
if (*(char **)(this + 0x3c) == (char *)0x0) goto LAB_0028d2a7;
iVar3 = OpenFile(this,*(char **)(this + 0x3c),*(char **)(this + 0x40),*(int *)(this + 0x44));
*(int *)(this + 0x38) = iVar3;
if (iVar3 != 0) goto LAB_0028d246;
}
else {
LAB_0028d26a:
if (*(int *)(this + 0x38) != 0) {
if (g_pFullFileSystem != 0) {
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 0xc))
(g_pFullFileSystem + 4,*(int *)(this + 0x38));
}
LAB_0028d28a:
*(undefined4 *)(this + 0x38) = 0;
}
}
if (*(void **)(this + 0x3c) != (void *)0x0) {
operator_delete__(*(void **)(this + 0x3c));
*(undefined4 *)(this + 0x3c) = 0;
}
LAB_0028d2a7:
if (*(void **)(this + 0x40) != (void *)0x0) {
operator_delete__(*(void **)(this + 0x40));
*(undefined4 *)(this + 0x40) = 0;
}
this[0x14] = (CUtlStreamBuffer)0x0;
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.