CUtlBuffer::PutString
0x00261e60 · 473 bytes · __thiscall
_ZN10CUtlBuffer9PutStringEPKc
Decompiled
undefined (2 params)
/* CUtlBuffer::PutString(char const*) */
void __thiscall CUtlBuffer::PutString(CUtlBuffer *this,char *param_1)
{
int iVar1;
char *pcVar2;
char cVar3;
int iVar4;
char *pcVar5;
CUtlBuffer *pCVar6;
if (((byte)this[0x15] & 1) == 0) {
if (param_1 == (char *)0x0) {
cVar3 = CheckPut(this,1);
if (cVar3 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 0;
iVar4 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar4 + 1;
if (*(int *)(this + 0x1c) < iVar4 + 1) {
AddNullTermination(this);
return;
}
}
}
else {
iVar4 = _V_strlen(param_1);
Put(this,param_1,iVar4 + 1);
}
}
else if (param_1 != (char *)0x0) {
if ((((byte)this[0x15] & 0x10) == 0) && (iVar4 = *(int *)(this + 0x18), 0 < iVar4)) {
if ((*(int *)(this + 0x10) != 0) &&
(*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'))
{
while (iVar4 = iVar4 + -1, iVar4 != -1) {
pCVar6 = this;
cVar3 = CheckPut(this,1);
if (cVar3 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar1 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar1 + 1;
if (*(int *)(this + 0x1c) < iVar1 + 1) {
AddNullTermination(pCVar6);
}
}
}
}
pcVar5 = strchr(param_1,10);
pcVar2 = param_1;
while (param_1 = pcVar2, pcVar5 != (char *)0x0) {
param_1 = pcVar5 + 1;
Put(this,pcVar2,(int)param_1 - (int)pcVar2);
if (pcVar5[1] == '\0') break;
iVar4 = 0;
if (((byte)this[0x15] & 0x10) == 0) {
iVar4 = *(int *)(this + 0x18);
}
LAB_00261f18:
iVar4 = iVar4 + -1;
if (-1 < iVar4) {
while (pCVar6 = this, cVar3 = CheckPut(this,1), cVar3 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar1 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar1 + 1;
if (iVar1 + 1 <= *(int *)(this + 0x1c)) break;
AddNullTermination(pCVar6);
iVar4 = iVar4 + -1;
if (iVar4 < 0) goto LAB_00261f57;
}
goto LAB_00261f18;
}
LAB_00261f57:
pcVar5 = strchr(param_1,10);
pcVar2 = param_1;
}
}
iVar4 = _V_strlen(param_1);
if (iVar4 != 0) {
Put(this,param_1,iVar4);
return;
}
}
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.