old_bf_read::ReadString
0x0009b6f0 · 136 bytes · __thiscall
_ZN11old_bf_read10ReadStringEPcibPi
Decompiled
undefined (5 params)
/* old_bf_read::ReadString(char*, int, bool, int*) */
uint __thiscall
old_bf_read::ReadString(old_bf_read *this,char *param_1,int param_2,bool param_3,int *param_4)
{
char cVar1;
uint uVar2;
int iVar3;
uint uVar4;
uVar4 = 0;
iVar3 = 0;
while (cVar1 = ReadSBitLong(this,8), cVar1 != '\0') {
if (cVar1 == '\n') {
if (param_3) break;
if (param_2 + -1 <= iVar3) goto LAB_0009b721;
LAB_0009b778:
param_1[iVar3] = cVar1;
iVar3 = iVar3 + 1;
}
else {
if (iVar3 < param_2 + -1) goto LAB_0009b778;
LAB_0009b721:
uVar4 = 1;
}
}
param_1[iVar3] = '\0';
if (param_4 != (int *)0x0) {
*param_4 = iVar3;
}
uVar2 = 0;
if (this[0x10] == (old_bf_read)0x0) {
uVar2 = uVar4 ^ 1;
}
return uVar2;
}
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.