CUtlBuffer::PeekStringLength
0x0004ca80 · 275 bytes · __thiscall
_ZN10CUtlBuffer16PeekStringLengthEv.part.20
Decompiled
undefined (1 param)
/* CUtlBuffer::PeekStringLength() [clone .part.20] */
int __thiscall CUtlBuffer::PeekStringLength(CUtlBuffer *this)
{
char cVar1;
CUtlBuffer *in_EAX;
char *pcVar2;
uint uVar3;
int iVar4;
int local_34;
int local_30;
int local_20 [4];
local_34 = 0;
if (((byte)in_EAX[0x15] & 1) != 0) {
local_34 = PeekWhiteSpace(in_EAX,0);
}
local_30 = local_34;
do {
while( true ) {
local_20[0] = 0x80;
cVar1 = CheckArbitraryPeekGet(in_EAX,local_30,local_20);
if (cVar1 == '\0') {
iVar4 = 0;
if (local_30 != local_34) {
iVar4 = (local_30 - local_34) + 1;
}
return iVar4;
}
pcVar2 = (char *)(((local_30 + *(int *)(in_EAX + 0xc)) - *(int *)(in_EAX + 0x20)) +
*(int *)in_EAX);
if (((byte)in_EAX[0x15] & 1) != 0) break;
if (local_20[0] < 1) {
LAB_0004cb80:
local_30 = local_30 + local_20[0];
}
else {
if (*pcVar2 == '\0') {
iVar4 = 0;
LAB_0004cb08:
return (local_30 - local_34) + 1 + iVar4;
}
iVar4 = 0;
while (iVar4 = iVar4 + 1, iVar4 != local_20[0]) {
if (pcVar2[iVar4] == '\0') goto LAB_0004cb08;
}
local_30 = local_30 + iVar4;
}
}
iVar4 = 0;
if (local_20[0] < 1) goto LAB_0004cb80;
do {
uVar3 = (byte)pcVar2[iVar4] - 9;
if (((uVar3 < 0x18) && ((1 << ((byte)uVar3 & 0x1f) & 0x80001fU) != 0)) || (pcVar2[iVar4] == 0)
) goto LAB_0004cb08;
iVar4 = iVar4 + 1;
} while (iVar4 != local_20[0]);
local_30 = local_30 + iVar4;
} while( true );
}
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.