old_bf_read::ReadAndAllocateString
0x0009b830 · 157 bytes · __thiscall
_ZN11old_bf_read21ReadAndAllocateStringEPb
Decompiled
undefined (2 params)
/* old_bf_read::ReadAndAllocateString(bool*) */
void __thiscall old_bf_read::ReadAndAllocateString(old_bf_read *this,bool *param_1)
{
byte bVar1;
void *pvVar2;
int iVar3;
int in_GS_OFFSET;
int local_814;
char local_810 [2048];
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
bVar1 = ReadString(this,local_810,0x800,false,&local_814);
if (param_1 != (bool *)0x0) {
*param_1 = (bool)(bVar1 ^ 1);
}
pvVar2 = operator_new__(local_814 + 1);
if (-1 < local_814) {
iVar3 = 0;
do {
*(char *)((int)pvVar2 + iVar3) = local_810[iVar3];
iVar3 = iVar3 + 1;
} while (iVar3 <= local_814);
}
if (local_10 == *(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.