CUtlBuffer::PutDelimitedString
0x0004e390 · 797 bytes · __thiscall
_ZN10CUtlBuffer18PutDelimitedStringEP18CUtlCharConversionPKc
Decompiled
undefined (3 params)
/* CUtlBuffer::PutDelimitedString(CUtlCharConversion*, char const*) */
void __thiscall
CUtlBuffer::PutDelimitedString(CUtlBuffer *this,CUtlCharConversion *param_1,char *param_2)
{
byte bVar1;
CUtlCharConversion CVar2;
int iVar3;
char cVar4;
int iVar5;
int iVar6;
int iVar7;
CUtlBuffer *pCVar8;
byte *local_20;
if ((((byte)this[0x15] & 1) == 0) || (param_1 == (CUtlCharConversion *)0x0)) {
PutString(this,param_2);
return;
}
if ((*(int *)(this + 0x10) != 0) &&
(*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n')) {
iVar5 = 0;
if (((byte)this[0x15] & 0x10) == 0) {
iVar5 = *(int *)(this + 0x18);
}
LAB_0004e3e0:
iVar5 = iVar5 + -1;
if (-1 < iVar5) {
while (pCVar8 = this, cVar4 = CheckPut(this,1), cVar4 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar7 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar7 + 1;
if (iVar7 + 1 <= *(int *)(this + 0x1c)) break;
AddNullTermination(pCVar8);
iVar5 = iVar5 + -1;
if (iVar5 < 0) goto LAB_0004e420;
}
goto LAB_0004e3e0;
}
}
LAB_0004e420:
Put(this,*(void **)(param_1 + 8),*(int *)(param_1 + 0xc));
if ((param_2 != (char *)0x0) && (iVar5 = _V_strlen(param_2), 0 < iVar5)) {
local_20 = (byte *)param_2;
do {
bVar1 = *local_20;
iVar7 = *(int *)(param_1 + (uint)bVar1 * 8 + 0x118);
if (iVar7 == 0) {
if (((((byte)this[0x15] & 1) != 0) && (*(int *)(this + 0x10) != 0)) &&
(*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'
)) {
iVar7 = 0;
if (((byte)this[0x15] & 0x10) == 0) {
iVar7 = *(int *)(this + 0x18);
}
LAB_0004e620:
iVar7 = iVar7 + -1;
if (-1 < iVar7) {
while (pCVar8 = this, cVar4 = CheckPut(this,1), cVar4 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar6 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar6 + 1;
if (iVar6 + 1 <= *(int *)(this + 0x1c)) break;
AddNullTermination(pCVar8);
iVar7 = iVar7 + -1;
if (iVar7 < 0) goto LAB_0004e660;
}
goto LAB_0004e620;
}
}
LAB_0004e660:
pCVar8 = this;
cVar4 = CheckPut(this,1);
if (cVar4 != '\0') {
*(byte *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = bVar1;
iVar7 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar7 + 1;
if (*(int *)(this + 0x1c) < iVar7 + 1) {
AddNullTermination(pCVar8);
}
}
}
else {
CVar2 = param_1[4];
if (((((byte)this[0x15] & 1) != 0) && (*(int *)(this + 0x10) != 0)) &&
(*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n'
)) {
iVar6 = 0;
if (((byte)this[0x15] & 0x10) == 0) {
iVar6 = *(int *)(this + 0x18);
}
LAB_0004e4b0:
iVar6 = iVar6 + -1;
if (-1 < iVar6) {
while (pCVar8 = this, cVar4 = CheckPut(this,1), cVar4 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar3 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar3 + 1;
if (iVar3 + 1 <= *(int *)(this + 0x1c)) break;
AddNullTermination(pCVar8);
iVar6 = iVar6 + -1;
if (iVar6 < 0) goto LAB_0004e4f0;
}
goto LAB_0004e4b0;
}
}
LAB_0004e4f0:
pCVar8 = this;
cVar4 = CheckPut(this,1);
if (cVar4 != '\0') {
*(CUtlCharConversion *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) =
CVar2;
iVar6 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar6 + 1;
if (*(int *)(this + 0x1c) < iVar6 + 1) {
AddNullTermination(pCVar8);
}
}
Put(this,*(void **)(param_1 + (uint)bVar1 * 8 + 0x11c),iVar7);
}
local_20 = local_20 + 1;
} while (local_20 != (byte *)(param_2 + iVar5));
}
if (((((byte)this[0x15] & 1) != 0) && (*(int *)(this + 0x10) != 0)) &&
(*(char *)(*(int *)this + ((*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20))) == '\n')) {
iVar5 = 0;
if (((byte)this[0x15] & 0x10) == 0) {
iVar5 = *(int *)(this + 0x18);
}
LAB_0004e580:
iVar5 = iVar5 + -1;
if (-1 < iVar5) {
while (pCVar8 = this, cVar4 = CheckPut(this,1), cVar4 != '\0') {
*(undefined1 *)(*(int *)this + (*(int *)(this + 0x10) - *(int *)(this + 0x20))) = 9;
iVar7 = *(int *)(this + 0x10);
*(int *)(this + 0x10) = iVar7 + 1;
if (iVar7 + 1 <= *(int *)(this + 0x1c)) break;
AddNullTermination(pCVar8);
iVar5 = iVar5 + -1;
if (iVar5 < 0) goto LAB_0004e5c0;
}
goto LAB_0004e580;
}
}
LAB_0004e5c0:
Put(this,*(void **)(param_1 + 8),*(int *)(param_1 + 0xc));
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.